Why am I receiving errors when running AWS CLI commands?
Last updated: 2020-09-04
I'm receiving errors when running AWS Command Line Interface (AWS CLI) commands on my resource. How do I troubleshoot this?
Resolution
- Verify that you have the latest version of the AWS CLI installed. The AWS CLI is updated frequently. You can't access new released features when running an older CLI version. For information on how to update your version of the AWS CLI, see the General: Ensure you're running a recent version of the AWS CLI section in Troubleshooting AWS CLI errors.
- Make sure that the AWS Identity and Access Management (IAM) role or IAM user has the correct permissions to run the relevant commands. For instructions on how to do this, see Why am I receiving the error message "You are not authorized to perform this operation" when I try to launch an EC2 instance?
- Make sure that the time on your host machine is correct.
For Linux, see Setting the time for your Linux instance.
For Windows, see Setting the time for a Windows instance. - Make sure that you're using the correct AWS Security Token Service (AWS STS) token format. For more information, see Why did I receive the IAM error, "AWS was not able to validate the provided access credentials" in some AWS Regions?
- Make sure that you're using the correct credentials to make the API call. If there are multiple sets of credentials on the instance, credential precedence might affect which credentials the instance uses to make the API call. Verify the set of credentials that you're using by running the aws sts get-caller-identity command. For more information, see Why is my Amazon EC2 instance using IAM user credentials instead of role credentials?
- Make sure that the AWS CLI program file has run permission on Linux or macOS. For more information, see the I get access denied errors section in Troubleshooting AWS CLI errors.
Related information
Did this article help?
Do you need billing or technical support?