Skip to content

Commit

Permalink
fix enforcement error
Browse files Browse the repository at this point in the history
  • Loading branch information
d4kverma committed Jan 3, 2024
1 parent 17abb3c commit e6e90d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@ resource "azurerm_virtual_network" "vnet" {
bgp_community = var.bgp_community
edge_zone = var.edge_zone

encryption {
enforcement = var.enforcement
dynamic "encryption" {
for_each = var.enforcement != null ? ["encryption"] : []
content {
enforcement = var.enforcement
}
}

dynamic "ddos_protection_plan" {
Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ variable "enable_network_watcher" {

variable "enforcement" {
type = string
default = "AllowUnencrypted"
default = null
description = "Specifies if the encrypted Virtual Network allows VM that does not support encryption. Possible values are DropUnencrypted and AllowUnencrypted."
}

Expand Down

0 comments on commit e6e90d0

Please sign in to comment.