Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merging to prod #18

Merged
merged 6 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/terraform_prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: "Production - Terraform Infrastructure"
on:
push:
branches:
- main
- prod
paths:
- infra/envs/prod/**
- infra/modules/**
Expand Down
1 change: 0 additions & 1 deletion infra/envs/prod/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ terraform {
}

provider "aws" {
# alias = "main"
region = "eu-west-1"
# profile = var.PROFILE
default_tags {
Expand Down
4 changes: 4 additions & 0 deletions infra/envs/prod/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,8 @@ module "cvalexmav_web" {
service_group = "CV_Website"
environment = "Production"

providers = {
aws.virginia = aws.virginia
}

}
2 changes: 1 addition & 1 deletion infra/envs/test/backend.tf
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ terraform {
provider "aws" {
# alias = "main"
region = "eu-west-1"
# profile = var.PROFILE
# profile = "alexm"
default_tags {
tags = {
Terraform = "TRUE"
Expand Down
7 changes: 5 additions & 2 deletions infra/envs/test/modules.tf
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ module "testalexmav_web" {
bucket_name = "test.alexmav.co.uk"

enable_website = true

domain_acm = "cv.alexmav.co.uk"
domain_acm = "test.alexmav.co.uk"

# Tags
service_group = "Test_Website"
environment = "Development"

providers = {
aws.virginia = aws.virginia
}
}
8 changes: 5 additions & 3 deletions infra/modules/web/cloudfront.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
data "aws_acm_certificate" "this" {
domain = var.domain_acm

provider = aws.virginia
}

resource "aws_cloudfront_origin_access_identity" "this" {
Expand Down Expand Up @@ -80,7 +82,7 @@ resource "aws_cloudfront_distribution" "this" {

min_ttl = 0
default_ttl = 3600
max_ttl = 7200
max_ttl = 86400
compress = true
viewer_protocol_policy = "redirect-to-https"
}
Expand All @@ -97,8 +99,8 @@ resource "aws_cloudfront_distribution" "this" {

#First, create certificate, before pasting the ARN here.
viewer_certificate {
# acm_certificate_arn = data.aws_acm_certificate.this.arn
cloudfront_default_certificate = true
acm_certificate_arn = data.aws_acm_certificate.this.arn
cloudfront_default_certificate = false
minimum_protocol_version = "TLSv1.2_2021"
ssl_support_method = "sni-only"
}
Expand Down
Loading