Skip to main content

A wrapper for executing a command with AWS CLI v2 and SSO

Project description

[![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)”

Project details

Release history Release notifications

This version


Download files

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

Files for aws2-wrap, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size aws2_wrap-1.0.0-py3-none-any.whl (5.7 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size aws2-wrap-1.0.0.tar.gz (3.7 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page