Account A to access an S3 bucket in Account B

0

Dear Team,

Please help me done this task.

How can you allow users in Account A to access an S3 bucket in Account B?

Thanks, MahendraKumar V IT | Cloud Engineer

1 Answer
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):

  1. Create/Select S3 bucket
- Go to S3 console
- Select or create the bucket you want to share
  1. 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):

  1. 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"
            ]
        }
    ]
}
  1. Attach Policy to Users/Roles
- Go to IAM console
- Select user/role
- Attach the created policy
  1. 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
profile picture
EXPERT
answered 2 months ago
profile picture
EXPERT
reviewed 2 months ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions