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.
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.
Most helpful comment
Fixed the issue by adding
--sse=aws:kms
to the command above to make it work.The error message is not very helpful.