diff --git a/terraform/.envrc b/terraform/.envrc deleted file mode 100644 index 0e48010c..00000000 --- a/terraform/.envrc +++ /dev/null @@ -1,4 +0,0 @@ -source /Users/chisel/development/github-as-chizmw/.envrc - -export TF_CLI_ARGS_init="-backend-config='encrypt=true' -backend-config='key=chizmw/botc-custom-script-json2pdf-436158765452-botc-json2pdf.tfstate' -backend-config='bucket=436158765452-terraform-state'" -export TF_CLI_ARGS_init="-backend-config='encrypt=true' -backend-config='key=chizmw/botc-custom-script-json2pdf-436158765452-botc-json2pdf.tfstate' -backend-config='bucket=436158765452-terraform-state'" diff --git a/terraform/_locals.tf b/terraform/_locals.tf index c3bf15ef..317031ff 100644 --- a/terraform/_locals.tf +++ b/terraform/_locals.tf @@ -15,7 +15,7 @@ locals { } # get the lookup value from the wkspc_site_name map based on the workspace name - site_name = lookup(local.wkspc_site_name, terraform.workspace) + #site_name = lookup(local.wkspc_site_name, terraform.workspace) } # used in "a new hope" apigateway diff --git a/terraform/r53.tf b/terraform/r53.tf index 3ace9dc4..261cd1ab 100644 --- a/terraform/r53.tf +++ b/terraform/r53.tf @@ -1,15 +1,3 @@ data "aws_route53_zone" "main" { name = var.www_domain_name } - -resource "aws_route53_record" "wkspc_www-a" { - zone_id = data.aws_route53_zone.main.zone_id - name = "${local.site_name}.${var.www_domain_name}" - type = "A" - - alias { - name = aws_cloudfront_distribution.wkspc_www_s3_distribution.domain_name - zone_id = aws_cloudfront_distribution.wkspc_www_s3_distribution.hosted_zone_id - evaluate_target_health = false - } -} diff --git a/terraform/s3-web-files.tf b/terraform/s3-web-files.tf index 34e45220..e69de29b 100644 --- a/terraform/s3-web-files.tf +++ b/terraform/s3-web-files.tf @@ -1,66 +0,0 @@ -locals { - # a local to determine if our workspace is "prod" - is_prod = terraform.workspace == "prod" - - # set the_files to and empty map in the non-prod workspace - # and to a map of files in the prod workspace - files = local.is_prod ? { - "index.html" = "text/html" - "script.js" = "application/javascript" - "custom.js" = "application/javascript" - "styles.css" = "text/css" - "images/storyteller.png" = "image/png" - "images/download.png" = "image/png" - "images/background.png" = "image/png" - "images/infobutton.png" = "image/png" - "dropzone.css" = "text/css" - - # favicon resources - "favicon/android-chrome-192x192.png" = "image/png" - "favicon/android-chrome-512x512.png" = "image/png" - "favicon/apple-touch-icon.png" = "image/png" - "favicon/favicon-16x16.png" = "image/png" - "favicon/favicon-32x32.png" = "image/png" - "favicon/favicon.ico" = "image/x-icon" - "favicon/site.webmanifest" = "application/manifest+json" - } : {} -} - -resource "aws_s3_object" "wkspc_botc_www_files" { - depends_on = [ - aws_s3_bucket_policy.wkspc_www_bucket_policy, - ] - for_each = local.files - - bucket = aws_s3_bucket.wkspc_www_bucket.id - key = each.key - source = "../www/${each.key}" - content_type = each.value - acl = "public-read" - etag = filemd5("../www/${each.key}") - - tags = { - "BelongsToDist" = aws_cloudfront_distribution.wkspc_www_s3_distribution.id - } -} - -# we need to create an s3 file/object (const.js) that contains the API Gateway -# URL so that the web page can call the API Gateway -resource "aws_s3_object" "botc_www_const_js" { - - # only create objects if we are in the prod workspace - count = local.is_prod ? length(local.files) : 0 - - depends_on = [ - aws_s3_bucket_policy.wkspc_www_bucket_policy, - aws_api_gateway_stage.api_stage, - ] - bucket = aws_s3_bucket.wkspc_www_bucket.id - key = "const.js" - content = <