Share your S3 bucket with another account

There are many ways to share your s3 bucket with another account or user. I am doing it by Bucket Policy.

Requirements:

Step1: In Account A open the bucket you want to share and click on permissions.

Step 2: Scroll down and click on EDIT Bucket Policy

Paste the below code in bucket policy.

{
"Version": "2008-10-17",
"Id": "CrossAccountAccessPolicy",
"Statement": [
{
"Sid": "BucketAccess",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::AccountB-ID:root"
},
"Action": [
"s3:ListBucket",
"s3:GetObject",
"s3:PutObject"
],
"Resource": [
"arn:aws:s3:::cyberbuddybucket",
"arn:aws:s3:::cyberbuddybucket/*"
]}
]}

Change the bucket name and Update the account id in bucket policy.

Step3 : Click on Apply/Save Changes to save the bucket policy.

Step4 : Access the bucket with bucket url.

  1.  Login in Account B.
  2. After that use S3 bucket URL to access.
    https://s3.console.aws.amazon.com/s3/buckets/cyberbuddybucket?region=ap-south-1&tab=objects
  3. Change the bucket name and region.

By using above tutorial we have shared s3 bucket between account with particular permissions.

Please Drop Comment if you faced any issue at any point, I will try to help asap
100% LikesVS
0% Dislikes