1

I'd like to use UploadPartCopy to copy a large object from one region to another region (different accounts, no access points)

AWS cli returns following error:

~ aws s3api upload-part-copy \
    --bucket my-objects \
    --key "my-bucket/temp1.png" \
    --copy-source "arn:aws:s3:us-east-1:123451980301:my-objects/my-bucket/temp.png" \
    --part-number 1 \
    --upload-id ".OjnTTL4zciiCx5U56ED89sgfWNfowZZYCn9iSxhYIThSI8Pqa.Fp1tg6KaiR4fbejyzCIvrzcTbUiMnIT3DGfoVQmQaZuMVDeA8q_OWomKDNmRNKtcH.cm0LRUtHjuJ"


An error occurred (InvalidArgument) when calling the UploadPartCopy operation: Invalid resource in copy source ARN

Prior to this command, I used create-multipart-upload to get the upload id.

Is it possible to fix this issue?

Deqing
  • 14,098
  • 15
  • 84
  • 131
  • Read Marcin's answer below, but also take note that `arn:aws:s3:us-east-1:123451980301:my-objects/my-bucket/temp.png` is not a valid s3 object arn. Both account and region are omitted in S3 arn. `arn:aws:s3:::my-objects/my-bucket/temp.png`. – erik258 Sep 20 '22 at 00:11

1 Answers1

1

--copy-source should be in the format of:

my-bucket/temp.png

as explained in the docs:

For objects not accessed through an access point, specify the name of the source bucket and key of the source object, separated by a slash (/). For example, to copy the object reports/january.pdf from the bucket awsexamplebucket , use awsexamplebucket/reports/january.pdf

ARN is used for access points, not regular s3 objects.

Marcin
  • 215,873
  • 14
  • 235
  • 294