Skip to content

Instantly share code, notes, and snippets.

@HammoTime
Last active May 24, 2018 14:01
Show Gist options
  • Save HammoTime/be05a6f27abd3fceb9f11ab5d62093fc to your computer and use it in GitHub Desktop.
Save HammoTime/be05a6f27abd3fceb9f11ab5d62093fc to your computer and use it in GitHub Desktop.
An S3 Bucket policy that allows access from an EC2 instance to an S3 bucket on another account
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "EC2AccessToS3BucketOnSeparateAccount",
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::<account number>:root"
},
"Action": [
"s3:GetObject",
"s3:ListBucketByTags",
"s3:GetBucketTagging",
"s3:GetObjectTagging",
"s3:ListBucket",
"s3:GetBucketLocation"
],
"Resource": [
"arn:aws:s3:::<bucket name>",
"arn:aws:s3:::<bucket name>/*"
]
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment