Azure / terraform-azurerm-network

Terraform Azure RM Module for Network
MIT License
131 stars 1.24k forks source link

Replace deprecated azurerm_subnet argument enforce_private_link_endpoint_network_policies #145

Open mattboston opened 8 months ago

mattboston commented 8 months ago

Is there an existing issue for this?

Greenfield/Brownfield provisioning

brownfield

Terraform Version

1.7.0

Module Version

5.2.0

AzureRM Provider Version

3.92.0

Affected Resource(s)/Data Source(s)

enforce_private_link_endpoint_network_policies

Terraform Configuration Files

module "network" {
  source              = "Azure/network/azurerm"
  version             = "5.2.0"
  resource_group_name = azurerm_resource_group.rg.name
  vnet_name           = "vnet-${var.subscription}-${var.environment}-${var.region}"
  address_spaces      = "10.10.0.0/16"
  subnet_prefixes     = [
    "10.10.10.0/24",
    "10.10.11.0/24"
    ]
  subnet_names        = [
    "snet-${var.subscription}-${var.environment}-${var.region}-main",
    "snet-${var.subscription}-${var.environment}-${var.region}-services"
    ]

  use_for_each = true

  depends_on = [azurerm_resource_group.rg]
}

tfvars variables values

subscription = "connectivity"
environment = "prod"
region = "eastus2"

Debug Output/Panic Output

╷
│ Warning: Argument is deprecated
│
│   with module.network.azurerm_subnet.subnet_for_each["snet-techopssandbox-sandbox-eastus2-main"],
│   on .terraform/modules/network/main.tf line 57, in resource "azurerm_subnet" "subnet_for_each":
│   57:   enforce_private_link_endpoint_network_policies = lookup(var.subnet_enforce_private_link_endpoint_network_policies, each.value, false)
│
│ `enforce_private_link_endpoint_network_policies` will be removed in favour of the property
│ `private_endpoint_network_policies_enabled` in version 4.0 of the AzureRM Provider
│
│ (and 3 more similar warnings elsewhere)

Expected Behaviour

Should not receive warning. Eventually, this will cause an error when it is deprecated. Need to replace enforce_private_link_endpoint_network_policies with private_endpoint_network_policies_enabled

Actual Behaviour

No response

Steps to Reproduce

  1. terraform apply

Important Factoids

No

References

No response