From 97fdb6066ddde012d90b2594a4e10409ef5bcca0 Mon Sep 17 00:00:00 2001 From: JaredDarling <46824759+JaredDarling@users.noreply.github.com> Date: Thu, 28 Sep 2023 05:47:43 -0700 Subject: [PATCH] Updates defaults and adds better support for using CodeDeploy with ECS/Fargate (#60) Co-authored-by: Jared Darling --- README.md | 2 +- main.tf | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4c872f5..88aea10 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ Test Continuous Integration/Delivery environment on AWS ECS. ## Use this code as a Terraform module -Check valid versions on: +Check valid versions on: * Github Releases: * Terraform Module Registry: diff --git a/main.tf b/main.tf index 54d8563..10078b3 100644 --- a/main.tf +++ b/main.tf @@ -165,7 +165,7 @@ resource "aws_lb_target_group" "lb_https_tgs" { } name = "${var.name_prefix}-${each.key}-https-${each.value.target_group_port}" port = each.value.target_group_port - protocol = lookup(each.value, "target_group_protocol", "HTTPS") + protocol = lookup(each.value, "target_group_protocol", "HTTP") vpc_id = var.vpc_id deregistration_delay = var.deregistration_delay slow_start = var.slow_start @@ -182,7 +182,7 @@ resource "aws_lb_target_group" "lb_https_tgs" { enabled = var.target_group_health_check_enabled interval = var.target_group_health_check_interval path = var.target_group_health_check_path - protocol = lookup(each.value, "target_group_protocol", "HTTPS") + protocol = lookup(each.value, "target_group_protocol", "HTTP") timeout = var.target_group_health_check_timeout healthy_threshold = var.target_group_health_check_healthy_threshold unhealthy_threshold = var.target_group_health_check_unhealthy_threshold @@ -248,6 +248,12 @@ resource "aws_lb_listener" "lb_http_listeners" { } } + lifecycle { + ignore_changes = [ + default_action #Can be changed by CodeDeploy when used with Fargate + ] + } + tags = var.tags } @@ -297,6 +303,12 @@ resource "aws_lb_listener" "lb_https_listeners" { } } + lifecycle { + ignore_changes = [ + default_action #Can be changed by CodeDeploy when used with Fargate + ] + } + tags = var.tags }