I ran into the following error today while attempting to create a Lambda function using the CLI:
An error occurred (UnrecognizedClientException) when calling the CreateFunction operation: The security token included in the request is invalid.
The first thing to check is that your aws config is setup correctly. For me this is under c:userschris-pc.aws.
If that looks fine, double check that the associated user has the correct rights by viewing the IAM page in the server console: https://console.aws.amazon.com/iam/home
Finally, ensure that the user has programmatic access and that the keys match those in your config.
I ran into the following error while trying to copy files from one bucket to another using the AWS CLI:
An error occurred (AccessDenied) when calling the CopyObject operation: Access Denied
Thankfully this one is pretty self-explanatory. My user was missing the permissions required to view the bucket.
To see your user: aws configure list
To add permissions: view the IAM Management Console
I ran into the following error while attempting to copy files to a bucket via the AWS CLI:
The solution turned out to be pretty straight-forward. The region on the cli-config was set incorrectly. For example, mine was set to “Sydney” instead of “ap-southeast-2”. Type “aws configure list” to check what yours is set to.
Thanks to the following stackoverflow post for the info: https://stackoverflow.com/a/40411174/522859