Skip to content

Instantly share code, notes, and snippets.

@arbabnazar
Last active April 24, 2016 17:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save arbabnazar/31871b2cf30534c1c07e270a39145066 to your computer and use it in GitHub Desktop.
Save arbabnazar/31871b2cf30534c1c07e270a39145066 to your computer and use it in GitHub Desktop.
// Setup your S3 Bucket
resource "aws_s3_bucket" "cdn_bucket" {
bucket = "${var.bucket_name}"
acl = "public-read"
policy = <<POLICY
{
"Version":"2012-10-17",
"Statement":[{
"Sid":"PublicReadForGetBucketObjects",
"Effect":"Allow",
"Principal": "*",
"Action":"s3:GetObject",
"Resource":["arn:aws:s3:::${var.bucket_name}/*"
]
}
]
}
POLICY
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment