Skip to content
Config

Config

AWS config file

aws-vault uses your ~/.aws/config to load AWS config. This should work identically to the config specified by the aws-cli docs.

include_profile

(Note: aws-vault v5 calls this parent_profile)

AWS Vault also recognises an extra config variable, include_profile, which is not recognised by the aws-cli. This variable allows a profile to load configuration horizontally from another profile.

This is a flexible mechanism for more complex configurations.

For example you can use it in “mixin” style where you import a common fragment. In this example, the root, order-dev and order-staging-admin profiles include the region, mfa_serial and source_profile configuration from common.

; The "common" profile here operates as a "config fragment" rather than a profile
[profile common]
region=eu-west-1
mfa_serial=arn:aws:iam::123456789:mfa/johnsmith
source_profile = root

[profile root]
include_profile = common

[profile order-dev]
include_profile = common
role_arn=arn:aws:iam::123456789:role/developers

[profile order-staging-admin]
include_profile = common
role_arn=arn:aws:iam::123456789:role/administrators

Or you could use it in “parent” style where you conflate the fragment with the profile. In this example the order-dev and order-staging-admin profiles include the region, mfa_serial and source_profile configuration from root, while also using the credentials stored against the root profile as the source credentials source_profile = root

; The "root" profile here operates as a profile, a config fragment as well as a source_profile
[profile root]
region=eu-west-1
mfa_serial=arn:aws:iam::123456789:mfa/johnsmith
source_profile = root

[profile order-dev]
include_profile = root
role_arn=arn:aws:iam::123456789:role/developers

[profile order-staging-admin]
include_profile = root
role_arn=arn:aws:iam::123456789:role/administrators

session_tags and transitive_session_tags

It is possible to set session tags when AssumeRole is used. Two custom config variables could be defined for that: session_tags and transitive_session_tags. The former defines a comma separated key=value list of tags and the latter is a comma separated list of tags that should be persisted during role chaining:

[profile root]
region=eu-west-1

[profile order-dev]
source_profile = root
role_arn=arn:aws:iam::123456789:role/developers
session_tags = key1=value1,key2=value2,key3=value3
transitive_session_tags = key1,key2

source_identity

It is possible to set source identity when AssumeRole is used. Custom config variable source_identity allows you to set the value.

[profile root]
region=eu-west-1

[profile order-dev]
source_profile = root
role_arn=arn:aws:iam::123456789:role/developers
source_identity=your_user_name

mfa_process

If you have a method to generate an MFA token, you can use it with aws-vault by specifying the mfa_process option in a profile of your ~/.aws/config file. The value of mfa_process should be a command that will output the MFA token to stdout.

For example, to use pass to retrieve an MFA token from a password store entry, you could use the following:

[profile foo]
mfa_serial=arn:aws:iam::123456789:mfa/johnsmith
mfa_process=pass otp my_aws_mfa

Or another example using 1Password

[profile foo]
mfa_serial=arn:aws:iam::123456789:mfa/johnsmith
mfa_process=op item get my_aws_mfa --otp

WARNING: Use of this option runs against security best practices. It is recommended that you use a dedicated MFA device.

Environment variables

To configure the default flag values of aws-vault and its subcommands:

VariableDescriptionFlag
AWS_VAULT_BACKENDSecret backend to use--backend
AWS_VAULT_BIOMETRICSUse biometric authentication using TouchID, if supported--biometrics
AWS_VAULT_KEYCHAIN_NAMEName of macOS keychain to use--keychain
AWS_VAULT_AUTO_LOGOUTEnable auto-logout when doing login--auto-logout
AWS_VAULT_PROMPTPrompt driver to use--prompt
AWS_VAULT_PASS_PASSWORD_STORE_DIRPass password store directory--pass-dir
AWS_VAULT_PASS_CMDName of the pass executable--pass-cmd
AWS_VAULT_PASS_PREFIXPrefix to prepend to the item path stored in pass--pass-prefix
AWS_VAULT_FILE_DIRDirectory for the “file” password store--file-dir
AWS_VAULT_FILE_PASSPHRASEPassword for the “file” password store
AWS_VAULT_DURATIONDuration of the temporary or assume-role session--duration
AWS_VAULT_OP_TIMEOUTTimeout for 1Password Service Account operations--op-timeout
AWS_VAULT_OP_VAULT_IDUUID of the 1Password vault--op-vault-id
AWS_VAULT_OP_ITEM_TITLE_PREFIXPrefix to prepend to 1Password item titles--op-item-title-prefix
AWS_VAULT_OP_ITEM_TAGTag to apply to 1Password items--op-item-tag
AWS_VAULT_OP_CONNECT_HOST1Password Connect server HTTP(S) URI--op-connect-host
AWS_VAULT_OP_CONNECT_TOKEN1Password Connect server access token
AWS_VAULT_OP_SERVICE_ACCOUNT_TOKEN1Password service account token
AWS_VAULT_OP_DESKTOP_ACCOUNT_ID1Password Desktop App account name or account UUID--op-desktop-account-id
AWS_VAULT_PROTON_PASS_SHARE_IDShare ID of the Proton Pass vault to use--proton-pass-share-id
AWS_VAULT_PROTON_PASS_ITEM_TITLE_PREFIXPrefix to prepend to Proton Pass item titles--proton-pass-item-title-prefix
AWS_VAULT_PROTON_PASS_API_BASEProton API base URL--proton-pass-api-base
AWS_VAULT_PROTON_PASS_TIMEOUTTimeout for Proton Pass API operations--proton-pass-timeout
AWS_VAULT_PROFILE_ENVSet AWS_PROFILE instead of injecting AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to allow profile-based SDK authprofile-env (for exec)
AWS_CONFIG_FILEThe location of the AWS config file
AWS_VAULT_STDOUTPrint login URL to stdout instead of opening in default browser--stdout

To override the AWS config file (used in the exec, login and rotate subcommands):

VariableDescription
AWS_REGIONThe AWS region
AWS_DEFAULT_REGIONThe AWS region, applied only if AWS_REGION isn’t set
AWS_STS_REGIONAL_ENDPOINTSSTS endpoint resolution logic, must be “regional” or “legacy”
AWS_ENDPOINT_URLThe AWS endpoint URL to use
AWS_MFA_SERIALThe identification number of the MFA device to use
AWS_ROLE_ARNSpecifies the ARN of an IAM role in the active profile
AWS_ROLE_SESSION_NAMESpecifies the name to attach to the role session in the active profile

To override session durations (used in exec and login):

VariableDescriptionDefault
AWS_SESSION_TOKEN_TTLExpiration time for the GetSessionToken credentials1h
AWS_CHAINED_SESSION_TOKEN_TTLExpiration time for the GetSessionToken credentials when chaining profiles8h
AWS_ASSUME_ROLE_TTLExpiration time for the AssumeRole credentials1h
AWS_FEDERATION_TOKEN_TTLExpiration time for the GetFederationToken credentials1h
AWS_MIN_TTLThe minimum expiration time allowed for a credential5m

Note that the session durations above expect a unit after the number (e.g. 12h or 43200s).

To override or set session tagging (used in exec):

VariableDescription
AWS_SESSION_TAGSComma separated key-value list of tags passed with the AssumeRole call, overrides session_tags profile config variable
AWS_TRANSITIVE_TAGSComma separated list of transitive tags passed with the AssumeRole call, overrides transitive_session_tags profile config variable

To override or set the source identity (used in exec and login):

VariableDescription
AWS_SOURCE_IDENTITYSpecifies the source identity for assumed role sessions
Last updated on