There are many ways to share your s3 bucket with another account or user. I am doing it by Bucket Policy.
Requirements:
- Account ID of account you want to share your bucket with.
Account No can be found in AWS account.
https://portal.aws.amazon.com/gp/aws/manageYourAccount
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.
- Login in Account B.
- After that use S3 bucket URL to access.
https://s3.console.aws.amazon.com/s3/buckets/cyberbuddybucket?region=ap-south-1&tab=objects 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