Skip to content

Commit

Permalink
Prevent terraform from detecting changes on an empty add_node_pool_ne…
Browse files Browse the repository at this point in the history
…twork_tags list (#17)
  • Loading branch information
joreetz-otto authored Jun 28, 2024
1 parent d0a28c1 commit c266ee6
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tf/service_cluster/container.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,14 @@ resource "google_container_cluster" "main" {
ip_allocation_policy {
}

node_pool_auto_config {
network_tags {
tags = var.add_node_pool_network_tags
dynamic "node_pool_auto_config" {
# terraform would detect false changes if the add_node_pool_network_tags is empty
# this will prevent this behavior
for_each = length(var.add_node_pool_network_tags) == 0 ? [] : [1]
content {
network_tags {
tags = var.add_node_pool_network_tags
}
}
}

Expand Down

0 comments on commit c266ee6

Please sign in to comment.