Explore Courses Blog Tutorials Interview Questions
0 votes
in AWS by (19.1k points)
edited by

Is there a command/subcommand that can be passed to the aws utility that can 1) verify that the credentials in the ~/.aws/credentials file are valid, and 2) give some indication which user the credentials belong to? I'm looking for something generic that doesn't make any assumptions about the user having permissions to IAM or any specific service.

The use case for this is a deploy-time sanity check to make sure that the credentials are good. Ideally, there would be some way to check the return value and abort the deploy if there are invalid credentials.

1 Answer

0 votes
by (44.4k points)

You can simply use the --upgrade option:

$ pip3 install --upgrade awscli 

If this doesn’t work, you will have to reinstall it (Linux or Mac OS X)

$ curl "" -o ""

$ unzip

$ sudo ./awscli-bundle/install -i /usr/local/aws -b /usr/local/bin/aws

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories