Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent terraform from detecting changes on an empty add_node_pool_network_tags list #17

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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" {
AndreasBergmeier6176 marked this conversation as resolved.
Show resolved Hide resolved
# 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
Loading