Skip to content

Commit a6ddc36

Browse files
committed
add lifecycle for target group
1 parent 040f05d commit a6ddc36

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# Change Log
22

3+
## [v1.3.1] - 2025-04-09
4+
### Added
5+
6+
- lifecycle create_before_destroy for aws_lb_target_group
7+
- aws_ecs_service dependon aws_lb_target_group
8+
39
## [v1.3.0] - 2023-10-20
410

511
### Added

main.tf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ resource "aws_lb_target_group" "this" {
144144
}
145145

146146
tags = merge(local.tags, { "Name" = format("%s-tg", substr(local.container_target_group_object.name, 0, min(29, length(local.container_target_group_object.name)))) })
147+
148+
lifecycle {
149+
create_before_destroy = true
150+
}
151+
147152
}
148153
/* ------------------------------ Listener Rule ----------------------------- */
149154
resource "aws_lb_listener_rule" "this" {
@@ -385,6 +390,10 @@ resource "aws_ecs_service" "this" {
385390
]
386391
}
387392

393+
depends_on = [
394+
aws_lb_target_group.this[0]
395+
]
396+
388397
tags = merge(local.tags, { Name = format("%s", local.name) })
389398
}
390399

0 commit comments

Comments
 (0)