1 Answer
- Newest
- Most votes
- Most comments
1
Here's a clear step-by-step process to allow Account A to access Account B's S3 bucket:
In Account B (Bucket Owner):
- Create/Select S3 bucket
- Go to S3 console
- Select or create the bucket you want to share
- Add Bucket Policy
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Principal": { "AWS": "arn:aws:iam::ACCOUNT-A-ID:root" }, "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::BUCKET-NAME/*", "arn:aws:s3:::BUCKET-NAME" ] } ] }
In Account A (Accessing Account):
- Create IAM Policy
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::BUCKET-NAME/*", "arn:aws:s3:::BUCKET-NAME" ] } ] }
- Attach Policy to Users/Roles
- Go to IAM console
- Select user/role
- Attach the created policy
- Verify Access
- Test access using AWS CLI or Console
- Try listing bucket contents or downloading objects
Remember to:
- Replace ACCOUNT-A-ID with Account A's AWS account ID
- Replace BUCKET-NAME with your actual bucket name
- Modify permissions (s3:GetObject, s3:ListBucket) as needed
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago