Allow single hfw policy association in folder and organization modules

This commit is contained in:
Julio Castillo
2023-08-28 14:39:48 +02:00
parent ce96ac31e7
commit 04721a35ef
6 changed files with 60 additions and 53 deletions

View File

@@ -1,5 +1,5 @@
/**
* Copyright 2022 Google LLC
* Copyright 2023 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,9 +27,10 @@ resource "google_essential_contacts_contact" "contact" {
notification_category_subscriptions = each.value
}
resource "google_compute_firewall_policy_association" "default" {
for_each = var.firewall_policy_associations
for_each = toset(var.firewall_policy == null ? [] : [""])
attachment_target = var.organization_id
name = each.key
firewall_policy = each.value
name = var.firewall_policy.name
firewall_policy = var.firewall_policy.policy
}