Skip to content

Instantly share code, notes, and snippets.

@kunanit
Created November 20, 2019 17:26
Show Gist options
  • Save kunanit/13af373f5f045c063f805fd8cd3b1b7e to your computer and use it in GitHub Desktop.
Save kunanit/13af373f5f045c063f805fd8cd3b1b7e to your computer and use it in GitHub Desktop.
S3 bucket policy example for cross-account access
{
"Version": "2008-10-17",
"Id": "CrossAccountAccessExample",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789123:user/admin"
},
"Action": [
"s3:GetBucketLocation",
"s3:ListBucket"
],
"Resource": "arn:aws:s3:::my-bucket"
},
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789123:user/myuser"
},
"Action": [
"s3:GetObject",
"s3:PutObject",
"s3:PutObjectAcl"
],
"Resource": "arn:aws:s3:::my-bucket/*"
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment