From c2eecfe8576c4d3a5224edbc3048d5076a78cf04 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 23 Jan 2022 09:53:22 -0700 Subject: [PATCH 1/5] create aws zone so we can get freenom using the nameservers --- terraform/route53.tf | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 terraform/route53.tf diff --git a/terraform/route53.tf b/terraform/route53.tf new file mode 100644 index 0000000000..c64410ad5d --- /dev/null +++ b/terraform/route53.tf @@ -0,0 +1,27 @@ +resource "aws_route53_zone" "main" { + name = var.domain-name +} + +# resource "aws_route53_record" "root-a" { +# zone_id = aws_route53_zone.main.zone_id +# name = var.domain-name +# type = "A" + +# alias { +# name = aws_cloudfront_distribution.root_s3_distribution.domainvar.domain-name +# zone_id = aws_cloudfront_distribution.root_s3_distribution.hosted_zone_id +# evaluate_target_health = false +# } +# } + +# resource "aws_route53_record" "www-a" { +# zone_id = aws_route53_zone.main.zone_id +# name = "www.${var.domain-name}" +# type = "A" + +# alias { +# name = aws_cloudfront_distribution.www_s3_distribution.domainvar.domain-name +# zone_id = aws_cloudfront_distribution.www_s3_distribution.hosted_zone_id +# evaluate_target_health = false +# } +# } From 1845a0fa29bae9c41e21353d4a6991b609f5d345 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 23 Jan 2022 10:04:25 -0700 Subject: [PATCH 2/5] add comment --- terraform/route53.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/terraform/route53.tf b/terraform/route53.tf index c64410ad5d..58099d9562 100644 --- a/terraform/route53.tf +++ b/terraform/route53.tf @@ -2,6 +2,7 @@ resource "aws_route53_zone" "main" { name = var.domain-name } +# comment out so we can get the zone and configure name records in freenom before getting the rest of this stuff setup # resource "aws_route53_record" "root-a" { # zone_id = aws_route53_zone.main.zone_id # name = var.domain-name From af81e5ec134c954343893884031943da964325f0 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 23 Jan 2022 10:12:25 -0700 Subject: [PATCH 3/5] add reference to #24 --- readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/readme.md b/readme.md index 2011f91eb3..4555d25437 100644 --- a/readme.md +++ b/readme.md @@ -30,6 +30,7 @@ The [terraform code](https://github.com/MarkIannucci/terraform-aws-atlantis/tree # Things I'd do differently if I had more time * I'd write the script that commits the files to the data branch to only commit data to the data branch if it were running from the main branch. If it were running from any other branch, it'd commit the files to the data-branchname branch. The current config could easily split brain. Additionally the approach to branch switching that I'm using currently makes continued progress on github actions quite clunky. See [commit fbe6548c](https://github.com/marknooch/foodtrucks/commit/fbe6548c587d931dd31a8b67ce2c1e04dbbb2215) for an example of the clunk. +* Figure out how to configure Atlantis + github to require an apply if necessary for a PR to be completed. #24 * Implement mapbox pubic token creation/rotation with a github action -- current implementation embeds the public access token in source and is [secret sprawly](https://www.hashicorp.com/resources/what-is-secret-sprawl-why-is-it-harmful). ~~The token has an access policy allowing it to only be accessed from domains I control.~~ once we implement #18. * Some of the content could be easily hosted on github which would have reduced the github actions complexity and AWS cost. From 7c2253ee99df056fb4f1e4644d2adb61e0e7c9e0 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 23 Jan 2022 10:22:06 -0700 Subject: [PATCH 4/5] prefix the bucket to make stuff look better in AWS --- terraform/s3.tf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/terraform/s3.tf b/terraform/s3.tf index de4da7332c..e88191db1f 100644 --- a/terraform/s3.tf +++ b/terraform/s3.tf @@ -1,6 +1,7 @@ # create bucket for static website resource "aws_s3_bucket" "s3-home" { - acl = "public-read" + bucket_prefix = "foodtrucks" + acl = "public-read" website { index_document = "index.html" From 67955e61ab011eaf8667eae9c15a20f4dc428e62 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 23 Jan 2022 10:32:12 -0700 Subject: [PATCH 5/5] the domainname is findafoodtrucknow.ga --- terraform/variables.tf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/terraform/variables.tf b/terraform/variables.tf index 90e9659323..67a88f4190 100644 --- a/terraform/variables.tf +++ b/terraform/variables.tf @@ -5,7 +5,7 @@ variable "region" { variable "domain-name" { description = "domain name which redirects to CloudFront" - default = "findafoodtruck.ga" + default = "findafoodtrucknow.ga" } variable "tags" {