Home > Software design >  How to set AWS_PROFILE in .bashrc? The config profile (/home/miki/.aws/config) could not be found
How to set AWS_PROFILE in .bashrc? The config profile (/home/miki/.aws/config) could not be found

Time:03-22

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/session.py", 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?

CodePudding user response:

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.

  • Related