Last active
March 21, 2021 19:51
-
-
Save refayathaque/b520a9ffa9a8b4d8f0eacdcd85aa5b64 to your computer and use it in GitHub Desktop.
Revisions
-
refayathaque revised this gist
Mar 21, 2021 . No changes.There are no files selected for viewing
-
refayathaque revised this gist
Mar 20, 2021 . 1 changed file with 3 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,8 +15,8 @@ data "aws_iam_policy_document" "bucket_website_hosting" { "s3:ListBucket", ] principals { identifiers = [aws_cloudfront_origin_access_identity.origin_access_identity.iam_arn] type = "AWS" } resources = [ "arn:aws:s3:::${var.BUCKET_NAME}", @@ -29,5 +29,5 @@ resource "null_resource" "upload_static_files" { provisioner "local-exec" { command = "aws s3 cp index.html s3://${var.BUCKET_NAME}" } depends_on = [aws_s3_bucket.website_static_files] } -
refayathaque revised this gist
Mar 20, 2021 . 1 changed file with 2 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -15,8 +15,7 @@ data "aws_iam_policy_document" "bucket_website_hosting" { "s3:ListBucket", ] principals { identifiers = [ aws_cloudfront_origin_access_identity.origin_access_identity.iam_arn ] type = "AWS" } resources = [ @@ -30,5 +29,5 @@ resource "null_resource" "upload_static_files" { provisioner "local-exec" { command = "aws s3 cp index.html s3://${var.BUCKET_NAME}" } depends_on = [ aws_s3_bucket.website_static_files ] } -
refayathaque renamed this gist
Mar 20, 2021 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
refayathaque revised this gist
Mar 20, 2021 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -30,6 +30,5 @@ resource "null_resource" "upload_static_files" { provisioner "local-exec" { command = "aws s3 cp index.html s3://${var.BUCKET_NAME}" } depends_on = [aws_s3_bucket.website_static_files] } -
refayathaque created this gist
Mar 20, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,35 @@ resource "aws_s3_bucket" "website_static_files" { bucket = var.BUCKET_NAME acl = "private" policy = data.aws_iam_policy_document.bucket_website_hosting.json website { index_document = "index.html" } force_destroy = true } data "aws_iam_policy_document" "bucket_website_hosting" { statement { actions = [ "s3:GetObject", "s3:ListBucket", ] principals { identifiers = [ aws_cloudfront_origin_access_identity.origin_access_identity.iam_arn] type = "AWS" } resources = [ "arn:aws:s3:::${var.BUCKET_NAME}", "arn:aws:s3:::${var.BUCKET_NAME}/*", ] } } resource "null_resource" "upload_static_files" { provisioner "local-exec" { command = "aws s3 cp index.html s3://${var.BUCKET_NAME}" } depends_on = [aws_s3_bucket.website_static_files] }