diff --git a/.github/workflows/terraform_prod.yaml b/.github/workflows/terraform_prod.yaml index 029c45e..5bb870b 100644 --- a/.github/workflows/terraform_prod.yaml +++ b/.github/workflows/terraform_prod.yaml @@ -24,7 +24,7 @@ env: jobs: terraform: - name: "Terraform Infrastructure Change Management" + name: "Development - Terraform Infrastructure" runs-on: ubuntu-latest defaults: run: diff --git a/.github/workflows/terraform_test.yaml b/.github/workflows/terraform_test.yaml index c37a6e9..90bad8f 100644 --- a/.github/workflows/terraform_test.yaml +++ b/.github/workflows/terraform_test.yaml @@ -24,7 +24,7 @@ env: jobs: terraform: - name: "Terraform Infrastructure Change Management" + name: "Development - Terraform Infrastructure" runs-on: ubuntu-latest defaults: run: diff --git a/infra/envs/prod/modules.tf b/infra/envs/prod/modules.tf index f6b0c60..733a1f3 100644 --- a/infra/envs/prod/modules.tf +++ b/infra/envs/prod/modules.tf @@ -5,11 +5,10 @@ module "cvalexmav_web" { enable_website = true + domain_acm = "cv.alexmav.co.uk" + # Tags service_group = "CV_Website" environment = "Production" - providers = { - aws.virginia = aws.virginia - } } \ No newline at end of file diff --git a/infra/envs/test/modules.tf b/infra/envs/test/modules.tf index 5dbbd90..ca9fa52 100644 --- a/infra/envs/test/modules.tf +++ b/infra/envs/test/modules.tf @@ -5,11 +5,10 @@ module "testalexmav_web" { enable_website = true + domain_acm = "cv.alexmav.co.uk" + # Tags service_group = "Test_Website" environment = "Development" - providers = { - aws.virginia = aws.virginia - } } \ No newline at end of file diff --git a/infra/modules/web/cloudfront.tf b/infra/modules/web/cloudfront.tf index 493f5f5..cc91e7a 100644 --- a/infra/modules/web/cloudfront.tf +++ b/infra/modules/web/cloudfront.tf @@ -1,7 +1,5 @@ data "aws_acm_certificate" "this" { - domain = "alexmav.co.uk" - - provider = aws.virginia + domain = var.domain_acm } resource "aws_cloudfront_origin_access_identity" "this" { @@ -82,7 +80,7 @@ resource "aws_cloudfront_distribution" "this" { min_ttl = 0 default_ttl = 3600 - max_ttl = 86400 + max_ttl = 7200 compress = true viewer_protocol_policy = "redirect-to-https" } diff --git a/infra/modules/web/variables.tf b/infra/modules/web/variables.tf index f1b4b03..3e0331c 100644 --- a/infra/modules/web/variables.tf +++ b/infra/modules/web/variables.tf @@ -30,3 +30,9 @@ variable "enable_website" { description = "Define the resource_group tag" type = bool } + +// Domain +variable "domain_acm" { + description = "Provide the domain name to fetch ACM" + type = string +} \ No newline at end of file