Skip to content

Commit

Permalink
Merge pull request #14 from amavrogiannis/feat/reformat-terraform
Browse files Browse the repository at this point in the history
reformatting terraform
  • Loading branch information
amavrogiannis authored Mar 29, 2024
2 parents 0df6eea + 726d7f4 commit 1e8141c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 12 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/terraform_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:

jobs:
terraform:
name: "Terraform Infrastructure Change Management"
name: "Development - Terraform Infrastructure"
runs-on: ubuntu-latest
defaults:
run:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/terraform_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:

jobs:
terraform:
name: "Terraform Infrastructure Change Management"
name: "Development - Terraform Infrastructure"
runs-on: ubuntu-latest
defaults:
run:
Expand Down
5 changes: 2 additions & 3 deletions infra/envs/prod/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
5 changes: 2 additions & 3 deletions infra/envs/test/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
6 changes: 2 additions & 4 deletions infra/modules/web/cloudfront.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down Expand Up @@ -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"
}
Expand Down
6 changes: 6 additions & 0 deletions infra/modules/web/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 1e8141c

Please sign in to comment.