aws_session_token - AWS SDKs and Tools

aws_session_token

Specifies an AWS session token used as part of the credentials to authenticate the user. A session token is required only if you manually specify temporary security credentials.

Details

Although this setting can be stored in the config file, for security reasons, we recommend that you store this in the credentials file.

You receive this value as part of the temporary credentials returned by successful requests to assume a role.

Ways to set this value

Location Supported Example
config file Yes - Not recommended
aws_session_token = AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
credentials file Yes - Recommended
aws_session_token = AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
Environment variable Yes Linux/macOS
export AWS_SESSION_TOKEN=AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
Windows
setx AWS_SESSION_TOKEN AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
AWS CLI parameter -

Compatibility with AWS SDKS and tools

SDK or tool Supported Notes or more information
AWS Command Line Interface (AWS CLI) Yes
AWS SDK for .NET Yes
AWS SDK for PHP Yes
AWS SDK for Python (Boto3) Yes

AWS Toolkit for JetBrains

Yes This SDK/Tool doesn't support the environment variable equivalent: AWS_SESSION_TOKEN
AWS Toolkit for Visual Studio Yes This SDK/Tool doesn't support the environment variable equivalent: AWS_SESSION_TOKEN
AWS Toolkit for Visual Studio Code Yes This SDK/Tool doesn't support the environment variable equivalent: AWS_SESSION_TOKEN
AWS Tools for PowerShell Yes