Skip to content
This repository has been archived by the owner on Jul 26, 2024. It is now read-only.

Avoid creating unnecessary policy definitions #33

Merged
merged 2 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
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
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

resource "azurerm_policy_definition" "deny_publicip_spoke" {
count = var.policies_matrix.cant_create_ip_spoke ? 1 : 0
name = "pol-deny-publicip-creation"
policy_type = "Custom"
mode = "Indexed"
Expand All @@ -23,7 +24,7 @@ resource "azurerm_policy_assignment" "deny-publicip-spoke" {
count = var.policies_matrix.cant_create_ip_spoke ? 1 : 0
name = "deny-publicip-spoke"
scope = var.scope
policy_definition_id = azurerm_policy_definition.deny_publicip_spoke.id
policy_definition_id = azurerm_policy_definition.deny_publicip_spoke[0].id
description = "Policy Assignment for deny public IP creatin in spokes"
display_name = "TF Deny public IP in spoke"

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

resource "azurerm_policy_definition" "deny_publicips_on_nics" {
count = var.policies_matrix.no_public_ip_spoke ? 1 : 0
name = "pol-deny-publicips-on-nics"
policy_type = "Custom"
mode = "Indexed"
Expand Down Expand Up @@ -31,7 +32,7 @@ resource "azurerm_policy_assignment" "publicIP-deny-on-nics" {
count = var.policies_matrix.no_public_ip_spoke ? 1 : 0
name = "deny-publicip-on-nics"
scope = var.scope
policy_definition_id = azurerm_policy_definition.deny_publicips_on_nics.id
policy_definition_id = azurerm_policy_definition.deny_publicips_on_nics[0].id
description = "Policy Assignment for deny public IP on NICs"
display_name = "TF Deny public IP assignment on NICs"

Expand Down