Skip to content

Commit

Permalink
feat: Add lifecycle create_before_destroy to avoid timeout with secur…
Browse files Browse the repository at this point in the history
…ity group (#16)

Co-authored-by: dchien234 <dangchien.1910@gmail.com>
  • Loading branch information
dchien234 and dchien234 authored Sep 13, 2023
1 parent 7ef19df commit cab07ba
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ resource "aws_security_group" "this" {
vpc_id = var.security_group_vpc_id

tags = var.tags

lifecycle {
create_before_destroy = true
}
}

resource "aws_security_group_rule" "this" {
Expand All @@ -159,6 +163,10 @@ resource "aws_security_group_rule" "this" {
prefix_list_ids = try(each.value.prefix_list_ids, null)
self = try(each.value.self, null)
source_security_group_id = try(each.value.source_security_group_id, null)

lifecycle {
create_before_destroy = true
}
}

################################################################################
Expand Down

0 comments on commit cab07ba

Please sign in to comment.