How to transfer Amazon S3 bucket to another account?

I am setting up AWS instances for clients, and I need to transfer everything at the end at the end so that billing for using AWS and S3 is also included in their accounts.

I know that there is a way to " transfer " an instance of EC2 through AMI sharing, but is there a way to transfer ownership or share S3 buckets ? (It is preferable to avoid making a copy , but pass the original bucket).

+6
source share
2 answers

S3 Buckets cannot be transferred between accounts. At least in the simple sense of the word "here is my bucket, now this is your bucket." Everyone seems to be using some form of copying. If you have permission for both your source bucket and its target bucket, you can use AWS CLI and just

aws s3 sync s3://bucket1 s3://bucket2

Have you tried adding your ALL PERMISSION user account to one of your buckets? http://docs.aws.amazon.com/IAM/latest/UserGuide/roles-creatingrole-policyexamples.html

Then log in to your account and see if they can change the policy to delete the original account? You do not know what billing will look like since the bucket was created.

+7
source

You can transfer the contents of the baskets between accounts by making the bucket public (safer ways to do this). Then, using the aws CLI from another account that you authenticated, run the s3 cp command (this does not require bandwidth):

aws s3 cp "s3: //bucket-source/file.zip" "s3: // bucket-you-dont-own / NewFolder /" - acl bucket-owner-full-control

If you do not add "-acl bucket-owner-full-control" to your s3 line, you will receive an access error message because the target account does not have file permissions:

When calling the ListObjects operation, a client error (AccessDenied) occurred: Access Denied

-1
source

Source: https://habr.com/ru/post/985775/


All Articles