How To Set AWS_PROFILE In .bashrc? The Config Profile (/home/miki/.aws/config) Could Not Be Found

- 1 answer

My intention is to set permanently my AWS profile. I edited my .bashrc by adding this line

export AWS_PROFILE="$HOME/.aws/config"

aws configure list shows error

  File "/usr/lib/python3/dist-packages/botocore/", line 337, in get_scoped_config
    raise ProfileNotFound(profile=profile_name)
botocore.exceptions.ProfileNotFound: The config profile (/home/miki/.aws/config) could not be found

But I can see it in .aws

~/.aws$ ll
total 16
drwxrwxr-x  2 miki miki 4096 Mar 11 09:02 ./
drwxr-xr-x 40 miki miki 4096 Mar 22 12:53 ../
-rw-------  1 miki miki  104 Mar 22 12:03 config
-rw-------  1 miki miki  349 Mar 11 10:14 credentials

How to fix this?



AWS_PROFILE is not for path such as $HOME/.aws/config. It is for named profiles.

If you want to set config and credentials file paths you should use AWS_CONFIG_FILE and AWS_SHARED_CREDENTIALS_FILE.