Saurabh
Saurabh

Reputation: 6920

Changing AWS configuration directory

AWS stores the default configuration files in ~/.aws/.

I'm trying to have all hidden directories inside ~/.config/, and would like to change the default location to ~/.config/aws/

How would I do this from the AWS CLI?

Upvotes: 2

Views: 6550

Answers (2)

Rohith Joseph
Rohith Joseph

Reputation: 841

You can specify a non-default location for the config file by setting the AWS_CONFIG_FILE environment variable to another local path.

Steps I used:
1. Create a folder with the name of your choice. I used .awscheck (mkdir .awscheck)
2. Create a file named credentials within the folder.
3. Configure the variable. (export AWS_CONFIG_FILE=~/.awscheck/credentials)
4. Run aws configure and add your values.

Similarly, if you want to store configurations, you can create a config file and add the configurations like profiles and regions in the config file.

Upvotes: 1

Marcin
Marcin

Reputation: 238081

Custom locations for config and credentials files can be specified using two environment variables:

  • AWS_CONFIG_FILE: Specifies the location of the file that the AWS CLI uses to store configuration profiles. The default path is ~/.aws/config.
  • AWS_SHARED_CREDENTIALS_FILE: Specifies the location of the file that the AWS CLI uses to store access keys. The default path is ~/.aws/credentials.

Upvotes: 7

Related Questions