I am trying to copy files from 2 different bucket which are in two different aws account using same access key. So it provide an error saying 403 forbidden.So what i want to do is, I want to check whether the access key that i am using to copy the file has permission to those bucket before i copy the file using boto3. Is there are anyway to do this?
If you are copying objects between Amazon S3 buckets that belong to different AWS accounts, then you will need to use a single set of credentials that have:
GetObject
permission on the source bucket PutObject
permission on the destination bucketAlso, the CopyObject
command should be sent to the destination bucket
to avoid problems with object ownership.
Therefore, I would recommend:
dest-IAM-user
)GetObject
access by dest-IAM-user
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.