Every time I want to config something with AWS I get the following error :
"The config profile (myname) could not be found"
like : aws configure
I'm using Python 3.4 and I want to use AWS CLI Keyring to encrypt my credentials..
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 .
You can configure additional profiles by using aws configure with the --profile option, or by manually adding entries to the config and credentials files. For more information on the config and credentials files, see Configuration and credential file settings.
The config file is located at ~/. aws/config on Linux or macOS, or at C:\Users\ USERNAME \. aws\config on Windows. This file contains the configuration settings for the default profile and any named profiles.
To get your access keys (consisting of an access key ID and secret access key), go to the IAM console at https://console.aws.amazon.com/iam/ . Choose Users from the navigation bar and then choose your AWS user name (not the check box). Choose the Security credentials tab, and then choose Create access key.
I think there is something missing from the AWS documentation in http://docs.aws.amazon.com/lambda/latest/dg/setup-awscli.html, it did not mention that you should edit the file ~/.aws/config
to add your username profile. There are two ways to do this:
edit ~/.aws/config
or
aws configure --profile "your username"
I ran into this problem when I moved to a new machine, carrying with me my AWS_DEFAULT_PROFILE environment variable, but not my ~/.aws directory. I couldn't get any awscli commands to work until I unset that variable or properly configured the named profile. But even the aws configure
command was broken, making things a bit tricky. Assuming you have a Unix-like shell handy:
env | grep AWS_
AWS_DEFAULT_PROFILE
or AWS_PROFILE
listed here, this answer is not applicable to you.unset AWS_DEFAULT_PROFILE
and/or unset AWS_PROFILE
aws --profile foo configure
exec $SHELL
aws iam get-user
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With