File tree Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Expand file tree Collapse file tree 2 files changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ resource "aws_ecs_service" "service" {
24
24
}
25
25
26
26
dynamic "load_balancer" {
27
- for_each = var. load_balancer
27
+ for_each = length ( var. load_balancer ) > 0 ? [ var . load_balancer ] : []
28
28
content {
29
29
target_group_arn = load_balancer. value . target_group_arn
30
30
container_name = load_balancer. value . container_name
@@ -33,7 +33,7 @@ resource "aws_ecs_service" "service" {
33
33
}
34
34
35
35
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 ] : []
37
37
content {
38
38
enabled = service_connect_configuration. value . enabled
39
39
namespace = service_connect_configuration. value . namespace
@@ -68,6 +68,5 @@ resource "aws_ecs_service" "service" {
68
68
69
69
lifecycle {
70
70
ignore_changes = [desired_count ]
71
- prevent_destroy = true
72
71
}
73
- }
72
+ }
Original file line number Diff line number Diff line change @@ -88,6 +88,6 @@ variable "load_balancer" {
88
88
89
89
variable "service_connect_config" {
90
90
description = " Service connect configuration"
91
- type = list (any )
92
- default = []
91
+ type = map (any )
92
+ default = {}
93
93
}
You can’t perform that action at this time.
0 commit comments