Skip to content

Commit ca71368

Browse files
committed
fix errors
1 parent e712e0d commit ca71368

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

ecs.tf

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ resource "aws_ecs_service" "service" {
2424
}
2525

2626
dynamic "load_balancer" {
27-
for_each = var.load_balancer
27+
for_each = length(var.load_balancer) > 0 ? [var.load_balancer] : []
2828
content {
2929
target_group_arn = load_balancer.value.target_group_arn
3030
container_name = load_balancer.value.container_name
@@ -33,7 +33,7 @@ resource "aws_ecs_service" "service" {
3333
}
3434

3535
dynamic "service_connect_configuration" {
36-
for_each = try([var.service_connect_config], [])
36+
for_each = length(var.service_connect_config) > 0 ? [var.service_connect_config] : []
3737
content {
3838
enabled = service_connect_configuration.value.enabled
3939
namespace = service_connect_configuration.value.namespace
@@ -68,6 +68,5 @@ resource "aws_ecs_service" "service" {
6868

6969
lifecycle {
7070
ignore_changes = [desired_count]
71-
prevent_destroy = true
7271
}
73-
}
72+
}

variables.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,6 @@ variable "load_balancer" {
8888

8989
variable "service_connect_config" {
9090
description = "Service connect configuration"
91-
type = list(any)
92-
default = []
91+
type = map(any)
92+
default = {}
9393
}

0 commit comments

Comments
 (0)