0
votes

Whenever I try to describe my keys to confirm that I could access my AWS accounts from the AWS cli - I see this error:

usage: aws [options] [ ...] [parameters] To see help text, you can run:

aws help
aws <command> help
aws <command> <subcommand> help

Sometimes I see this error:

Unable to locate credentials. You can configure credentials by running "aws configure".

Can someone figure out this issue?

1
I normally use aws sts get-caller-identity to check if AWS CLI is configured and with which account/credentials.lexicore

1 Answers

1
votes

You need to configure the aws cli to use credentials. There are a couple ways to do this.

aws configure command

https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html#cli-quick-configuration

$ aws configure
AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE
AWS Secret Access Key [None]: wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
Default region name [None]: us-west-2
Default output format [None]: json

Environment Variables

https://docs.aws.amazon.com/cli/latest/userguide/cli-configure-envvars.html

$ export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
$ export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
$ export AWS_DEFAULT_REGION=us-west-2