Skip to content

Commit

Permalink
alb only accepts requets from CF now
Browse files Browse the repository at this point in the history
  • Loading branch information
Sacha Laurent committed Feb 17, 2025
1 parent ef330c7 commit ea360bf
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
3 changes: 2 additions & 1 deletion devops/envs/dataart-dev-2025/cloudfront.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "cloudfront" {
source = "git::https://github.com/finddx/seq-treat-tbkb-terraform-modules.git//cloudfront?ref=cf-v1.8"
source = "git::https://github.com/finddx/seq-treat-tbkb-terraform-modules.git//cloudfront?ref=cf-v1.9"
https_certificate_arn = var.aws_region == "us-east-1" ? data.aws_acm_certificate.main-region.arn : data.aws_acm_certificate.us-east-1[0].arn
dns_name = var.cf_domain
elb_dns_name = module.alb.load_balancer_dns_name["lb"]
Expand All @@ -10,4 +10,5 @@ module "cloudfront" {
project_name = var.project_name
module_name = var.module_name
environment = var.environment
custom_header_value = resource.random_string.custom_header_value.result
}
4 changes: 4 additions & 0 deletions devops/envs/dataart-dev-2025/data.tf
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,7 @@ data "aws_acm_certificate" "us-east-1" {
data "aws_ec2_managed_prefix_list" "s3_prefix_link" {
name = "com.amazonaws.${var.aws_region}.s3"
}

resource "random_string" "custom_header_value" {
length = 16
}
9 changes: 8 additions & 1 deletion devops/envs/dataart-dev-2025/elb.tf
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
module "alb" {
source = "git::https://github.com/finddx/seq-treat-tbkb-terraform-modules.git//elb?ref=elb-v1.0"
source = "git::https://github.com/finddx/seq-treat-tbkb-terraform-modules.git//elb?ref=elb-v1.1"
load_balancers = local.load_balancers
environment = var.environment
module_name = var.module_name
Expand Down Expand Up @@ -61,6 +61,13 @@ locals {
{
type = "path_pattern"
values = ["/*"]
},
{
type = "http_header"
http_header_name = "X-custom-header"
values = [
resource.random_string.custom_header_value.result
]
}
]
}
Expand Down

0 comments on commit ea360bf

Please sign in to comment.