Getting access denied when following the documentation on how to copy objects between Lightsail buckets

0

I want to copy a few objects from one Lightsail bucket to another.

Following the documentation here: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-copying-moving-bucket-objects, I added an Admin user (with the directly attached "AdministratorAccess" policy) and set up aws cli. Listing my buckets and the objects in them works fine. However, if I try to copy an object as specified in the docs:

aws s3api copy-object --copy-source DOC-EXAMPLE-BUCKET/images/sailbot.jpg --key media/sailbot.jpg --bucket DOC-EXAMPLE-BUCKET

I get an access denied error:

An error occurred (AccessDenied) when calling the CopyObject operation: Access Denied
2개 답변
1
수락된 답변

Hello. Thanks for reporting this issue. To get the the copy object command to work properly you must include --acl bucket-owner-full-control in your command. I will work with our team to correct our documentation.

aws s3api copy-object --copy-source DOC-EXAMPLE-BUCKET/images/sailbot.jpg --key media/sailbot.jpg --bucket DOC-EXAMPLE-BUCKET --acl bucket-owner-full-control
AWS
답변함 2년 전
0

Hi! are you substituting your own bucket name for "DOC-EXAMPLE-BUCKET"? The bucket you're using should be owned and setup by you as well: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/buckets-in-amazon-lightsail

If you are, I would check the bucket permissions and security configuration as well: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/amazon-lightsail-understanding-bucket-permissions

jsonc
답변함 2년 전
  • are you substituting your own bucket name for "DOC-EXAMPLE-BUCKET"

    Yes, like mentioned, read access works fine (I can e.g. list and download objects).

    The bucket you're using should be owned and setup by you as well

    I used the root account to set up my buckets. I also created another account with admin permissions, as described here: https://lightsail.aws.amazon.com/ls/docs/en_us/articles/lightsail-how-to-set-up-access-keys-to-use-sdk-api-cli. Tried with an access key for both root and the admin, and neither can upload objects.

    If you are, I would check the bucket permissions and security configuration as well

    I have individual access keys for each the buckets, but afaict there's no way to use two access keys in one cli command.

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠