Location of the shared config and credentials files - AWS SDKs and Tools

Location of the shared config and credentials files

The shared config and credentials files are plaintext files that reside by default in a folder named .aws that is placed in the "home" folder on your computer.

On Linux and macOS, this is typically shown as ~/.aws. On Windows it is %USERPROFILE%\.aws.

Operating system Location of files
Linux and macOS

~/.aws/config

~/.aws/credentials

Windows

%USERPROFILE%\.aws\config

%USERPROFILE%\.aws\credentials

As a general rule, any value that you can place in the credentials file can alternatively be placed in the config file. The other way isn't true: only a few settings can be placed in the credentials file. However, as a security best practice, we recommend that you keep any sensitive values, such as access key IDs and secret keys, in the separate credentials file. This enables you to provide separate permissions for each file, if necessary.

Non-default locations for the files

You can move the config file and the credentials file or even rename them as long as you tell the SDKs and tools how to find the information.

To do this, set the following environment variables to point to the files containing the configuration or credentials information, according to the rules of your operating system:

  • Config file – AWS_CONFIG_FILE

  • Credentials file – AWS_SHARED_CREDENTIALS_FILE

Linux/macOS

You can specify an alternate location by running the following export commands on Linux or macOS.

$ export AWS_CONFIG_FILE=/some/file/path/on/the/system/config-file-name $ export AWS_SHARED_CREDENTIALS_FILE=/some/other/file/path/on/the/system/credentials-file-name
Windows

You can specify an alternate location by running the following setx commands on Windows.

C:\> setx AWS_CONFIG_FILE c:\some\file\path\on\the\system\config-file-name C:\> setx AWS_SHARED_CREDENTIALS_FILE c:\some\other\file\path\on\the\system\credentials-file-name