Skip to content

Simple script to export current AWS SSO credentials or run a sub-process with them

License

Notifications You must be signed in to change notification settings

krabbit/aws2-wrap

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quality Gate Status

aws2-wrap

This is a simple script to facilitate exporting the current AWS SSO credentials or runing a command with them. It is installed with pip.

Run a command using AWS SSO credentials

aws2-wrap --profile <awsprofilename> --exec "<command>"

Note that you must enclose the command to be executed within double-quotes in order to ensure that any parameters are passed to that sub-command and not to aws2-wrap.

For example:

aws2-wrap --profile MySSOProfile --exec "terraform"

Export the credentials

There may be circumstances when it is easier/better to set the appropriate environment variables so that they can be re-used by any aws command.

Since the script cannot directly set the environment variables in the calling shell process, it is necessary to use the following syntax:

eval "$(aws2-wrap --profile <awsprofilename> --export)"

For example:

eval "$(aws2-wrap --profile MySSOProfile --export)"

About

Simple script to export current AWS SSO credentials or run a sub-process with them

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%