Skip to main content

Switch AWS profile on local

Project description

Switch AWS Profile on local

GitHub Actions Pypi
Deploy PyPI version

demo-swtich-aws-profile

Choose one AWS profile to set default when you have multiple AWS profile.

Typically, the location of credential file is ~/.aws/credentials

Platform support

  • macOS (test ok)
  • Linux (ready for test)

Feature

  • Switch AWS profile for setting default
  • Assume role for getting credential base on choosing AWS profile

prerequisites

  • Python3
  • jq

Credential file examples

No Assume role

[test1]
aws_access_key_id = AKI11111111111111111
aws_secret_access_key = aaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbb

[test2]
aws_access_key_id = AKI22222222222222222
aws_secret_access_key = cccccccccccccccccccccccdddddddddddddddddd

Assume role

[test1]
aws_access_key_id = AKI11111111111111111
aws_secret_access_key = aaaaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbb
custom_assume_role = ci-assume-role1
duration_seconds = 3600

[test2]
aws_access_key_id = AKI22222222222222222
aws_secret_access_key = cccccccccccccccccccccccdddddddddddddddddd
custom_assume_role = ci-assume-role2
duration_seconds = 3600

If custom_assume_role is specified, the question as Input your role name to assume role can be pressed enter to pass it directly.

duration_seconds setting same as the custom_assume_role.

Installation

pip3 install switch-aws-profile

After installation, use awssp command directly

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

switch_aws_profile-0.0.6-py3-none-any.whl (6.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page