Skip to content

Instantly share code, notes, and snippets.

@HunterLarco
Created February 4, 2021 18:06
Show Gist options
  • Save HunterLarco/c1ca168d239a63fad1c09a918f7beea7 to your computer and use it in GitHub Desktop.
Save HunterLarco/c1ca168d239a63fad1c09a918f7beea7 to your computer and use it in GitHub Desktop.
resource "aws_s3_bucket" "frontend" {
bucket = "painted.nyc"
acl = "public-read"
website {
index_document = "index.html"
error_document = "index.html"
}
}
resource "aws_s3_bucket_policy" "frontend" {
bucket = aws_s3_bucket.frontend.id
policy = <<EOF
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "PublicAccess",
"Action": [
"s3:GetObject"
],
"Effect": "Allow",
"Resource": "arn:aws:s3:::painted.nyc/*",
"Principal": "*"
}
]
}
EOF
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment