Skip to content

Ability to change the config (e.g. ~/.aws) location for all of aws cli #9416

@isleshocky77

Description

@isleshocky77

Describe the feature

Currently you can use environment variables to change the location of some files (e.g. AWS_CONFIG_FILE) however, this still does not allow you to change the location of some files that go inside the config directory (e.g. ~/.aws/cli/alias)

it would be nice to just be able to configured where the config (e.g. ~/.aws/) directory is including all of the sub-directories and files below it.

Use Case

I might have different accounts for aws and different protocols and use-cases which I don't want to share between the two. Currently, I can have an environment variable change what config file, credential file, session tokens, etc are to be used when switching my current working directory.

However, there are lots of things which I can not change (e.g. ~/.aws/cli/alias) as well it would be cleaner and easier to change the whole config directory (e.g. ~/.aws/) versus just individual files under it (e.g. ~/.aws/config)

Proposed Solution

You should be able to specify an environment variable (e.g. AWS_CLI_CONFIG_DIR [default: ~/.aws/]) which would replace all of the uses of the current things like

os.path.join('~', '.aws', 'cli', 'alias')

Other Information

No response

Acknowledgements

  • I may be able to implement this feature request
  • This feature might incur a breaking change

CLI version used

aws-cli/2.17.32 Python/3.11.9 Linux/6.11.0-21-generic exe/x86_64.ubuntu.24

Environment details (OS name and version, etc.)

Ubuntu 24.04.2 LTS

Metadata

Metadata

Assignees

Labels

closed-for-stalenessconfigurefeature-requestA feature should be added or improved.p3This is a minor priority issueresponse-requestedWaiting on additional info and feedback. Will move to "closing-soon" in 7 days.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions