aws_session_token - AWS SDKs and Tools Shared Configuration and Credentials

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 X Linux/macOS
export AWS_SESSION_TOKEN AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
Windows
setx AWS_SESSION_TOKEN AQoEXAMPLEH4aoAH0gNCAPy...truncated...zrkuWJOgQs8IZZaIv2BXIa2R4Olgk
CLI parameter -

Compatibility with AWS SDKS and tools

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

AWS Toolkit for JetBrains consists of:

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