I'm trying to transfer an S3 bucket to another since a developer is leaving our team. I created another AWS account with S3. I'm following these steps: https://aws.amazon.com/premiumsupport/knowledge-center/account-transfer-s3/
The Bucket policy in for source AWS account works fine, but when I try the destination policy:
{
"Version": "2012-10-17",
"Statement": {
"Effect": "Allow",
"Action": "s3:*",
"Resource": [
"arn:aws:s3:::sourcebucket",
"arn:aws:s3:::sourcebucket/*",
"arn:aws:s3:::destinationbucket",
"arn:aws:s3:::destinationbucket/*"
]
}
}
And update only the sourcebucket and dest bucket items above with my account details, I get the error: Statement is missing required element - Statement "NO_ID-0" is missing "Principal" element
If you're denied permissions, then use another IAM identity that has bucket access, and edit the bucket policy. Or, delete and recreate the bucket policy if no one has access to it. If you're trying to add a public read policy, then disable the bucket's S3 Block Public Access.
You receive the "Error: Invalid principal in policy" message when the value of a Principal in your bucket policy is not valid. To resolve this error, confirm the following: Your bucket policy uses supported values for a Principal element. The Principal value is formatted correctly.
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to create a bucket policy for or whose bucket policy you want to edit. Choose Permissions. Under Bucket policy, choose Edit.
The destination policy in the article you cited is not a bucket policy. It's an IAM user or group policy.
Note the comment:
#User or group policy in the destination AWS account
This policy attaches to an IAM user or group in the IAM (as opposed to S3) console.
The source policy actually is a bucket policy, which is why it works as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With