Create Session

Create an authenticated session.
Supported methods:

Source codePermissions

Usage

Input

Parameter Description Type Required Default value
access_key AWS Access Key string No None
secret_key AWS Secret Key string No None
session_token AWS Session Token string No None
profile AWS Profile string No None
role_arn AWS Role ARN string No None
mfa_serial MFA Device ARN string No None
mfa_token MFA Token string No None
debug Increase log verbosity bool No False
silent Decrease log verbosity bool No False

Output

Returns a Boto3 Session object.

Examples

Assume a role with MFA:

This will export temporary credentials to the environment: AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, AWS_SESSION_TOKEN

Linux

eval $(aaws sts create_session --role_arn arn:aws:iam::123456789012:role/ExampleRole --mfa_serial arn:aws:iam::111111111111:mfa/Example --mfa_token 123456)

Windows

aaws sts create_session --role_arn arn:aws:iam::123456789012:role/ExampleRole --mfa_serial arn:aws:iam::111111111111:mfa/Example --mfa_token 123456 | Invoke-Expression