0 votes
1 view
in AWS by (19.2k 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.6k 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 "https://s3.amazonaws.com/aws-cli/awscli-bundle.zip" -o "awscli-bundle.zip"

$ unzip awscli-bundle.zip

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

Welcome to Intellipaat Community. Get your technical queries answered by top developers !


Categories

...