hashicorp / terraform-provider-azurerm

Terraform provider for Azure Resource Manager
https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs
Mozilla Public License 2.0
4.61k stars 4.65k forks source link

Private Link Service should support add/delete/update NAT IP configuration without recreating the entire PLS #11225

Open thllxb opened 3 years ago

thllxb commented 3 years ago

Community Note

Terraform (and AzureRM Provider) Version

2.54.0

Affected Resource(s)

Terraform Configuration Files

resource "azurerm_private_link_service" "example" {
  name                = "example-privatelink"
  resource_group_name = azurerm_resource_group.example.name
  location            = azurerm_resource_group.example.location

  auto_approval_subscription_ids              = ["00000000-0000-0000-0000-000000000000"]
  visibility_subscription_ids                 = ["00000000-0000-0000-0000-000000000000"]
  load_balancer_frontend_ip_configuration_ids = [azurerm_lb.example.frontend_ip_configuration.0.id]

  nat_ip_configuration {
    name                       = "primary"
    private_ip_address         = "10.5.1.17"
    private_ip_address_version = "IPv4"
    subnet_id                  = azurerm_subnet.example.id
    primary                    = true
  }

  nat_ip_configuration {
    name                       = "secondary"
    private_ip_address         = "10.5.1.18"
    private_ip_address_version = "IPv4"
    subnet_id                  = azurerm_subnet.example.id
    primary                    = false
  }
}

Debug Output

Panic Output

Expected Behaviour

Terraform should perform the add/update/delete of NAT IP configuration only

Actual Behaviour

Terraform deletes and recreates the entire Private link with the new NAT IP configuration

Steps to Reproduce

  1. add/update/delete any Private Link Service nat_ip_configuration
  2. terraform apply

References

  1. Add/update/delete NAT IP configuration is currently already supportted https://docs.microsoft.com/en-gb/rest/api/virtualnetwork/privatelinkservices/createorupdate#privatelinkserviceipconfiguration
shubDhond commented 3 months ago

This issue has not been fixed in provider version 3.x as previously indicated in this older issue: https://github.com/hashicorp/terraform-provider-azurerm/issues/15248