Skip to content

Commit 6f4feab

Browse files
fix: Ensure both ECS service definitions use the same settings/configurations (#277)
* fix: ensure ECS service tags are propagated This fixes the issue specifically with the `ignore_task_definition` service type. * fix: Sync both serice definitions --------- Co-authored-by: Bryant Biggs <[email protected]>
1 parent 00cc6b6 commit 6f4feab

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/antonbabenko/pre-commit-terraform
3-
rev: v1.96.1
3+
rev: v1.99.0
44
hooks:
55
- id: terraform_fmt
66
- id: terraform_wrapper_module_for_each

modules/service/main.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ resource "aws_ecs_service" "ignore_task_definition" {
285285

286286
dynamic "network_configuration" {
287287
# Set by task set if deployment controller is external
288-
for_each = var.network_mode == "awsvpc" ? [{ for k, v in local.network_configuration : k => v if !local.is_external_deployment }] : []
288+
for_each = var.network_mode == "awsvpc" && !local.is_external_deployment ? [local.network_configuration] : []
289289

290290
content {
291291
assign_public_ip = network_configuration.value.assign_public_ip
@@ -381,7 +381,7 @@ resource "aws_ecs_service" "ignore_task_definition" {
381381
wait_for_steady_state = var.wait_for_steady_state
382382

383383
propagate_tags = var.propagate_tags
384-
tags = var.tags
384+
tags = merge(var.tags, var.service_tags)
385385

386386
timeouts {
387387
create = try(var.timeouts.create, null)

0 commit comments

Comments
 (0)