Location of the shared config
and credentials
files
The shared AWS 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 | Default location and name of files |
---|---|
Linux and macOS |
|
Windows |
|
A ~/
or ~
followed by the file system's default
path separator at the start of the path is resolved by checking, in order,
-
(All platforms) The
HOME
environment variable -
(Windows platforms) The
USERPROFILE
environment variable -
(Windows platforms) The
HOMEDRIVE
environment variable, prepended to theHOMEPATH
environment variable (for example,$HOMEDRIVE$HOMEPATH
) -
(Optional per SDK or tool) An SDK or tool-specific home path resolution function or variable
When possible, if a user's home directory is specified at the start of the path (for
example, ~username/
), it is resolved to the requested user name's home
directory (for example, /home/username/.aws/config
).
Change the default location of these files
Use environment variables
The following environment variables can be set to change the location or name of these files from the default to a custom value:
-
config
file environment variable:AWS_CONFIG_FILE
-
credentials
file environment variable:AWS_SHARED_CREDENTIALS_FILE
Use JVM system properties
You can set the following JVM system properties to change the location or name of these files from the default to a custom value:
-
config
file JVM system property:aws.configFile
-
credentials
file environment variable:aws.sharedCredentialsFile
For instructions on how to set JVM system properties see How to set JVM system properties.