Aws-cli: An error occurred (KMS.NotFoundException) when calling the PutObject operation: Invalid keyId aws/s3

Created on 18 Sep 2019  路  1Comment  路  Source: aws/aws-cli

I'm trying to run this command from an EC2 instance that is assuming a cross account IAM role.

aws s3 cp config s3://my_bucket_blah/hi.txt --region eu-west-1 
upload failed: ./config to s3://my_bucket_blah/hi.txt An error occurred (KMS.NotFoundException) when calling the PutObject operation: Invalid keyId aws/s3

The cross account IAM role has "kms:*" permissions on the remote account.

obviously the aws/s3 key which is reporting as invalid exists on the remote account where the S3 bucket is hosted

I'm completely stuck with this.

Most helpful comment

Fixed the issue by adding --sse=aws:kms to the command above to make it work.

aws s3 cp config s3://my_bucket_blah/hi.txt --sse=aws:kms

The error message is not very helpful.

>All comments

Fixed the issue by adding --sse=aws:kms to the command above to make it work.

aws s3 cp config s3://my_bucket_blah/hi.txt --sse=aws:kms

The error message is not very helpful.

Was this page helpful?
0 / 5 - 0 ratings