Closed AliMBajwa closed 3 years ago
Hi there and thank you for reporting this. From the looks of it you're trying to add the same record twice:
resource "azurerm_private_endpoint" "synapse_workspace" {
name = var.synapse_workspace_pe_name
<snip>
private_dns_zone_group {
name = "synapse-studio"
private_dns_zone_ids = [azurerm_private_dns_zone.synapse_workspace.id]
}
}
This block will take care of creating the records.
This block, however, will try to do the same:
resource "azurerm_private_dns_a_record" "synapse_workspace" {
name = var.synapse_workspace_name
zone_name = azurerm_private_dns_zone.synapse_workspace.name
resource_group_name = var.resource_group_name
ttl = 10
records = [azurerm_private_endpoint.synapse_workspace.private_service_connection.0.private_ip_address]
}
Hence I think if you leave one of the 2 - you'll get the desired result.
@favoretti
Thanks for your response - I've removed the explicit 'a' records and I can confirm it worked.
I'm going to lock this issue because it has been closed for 30 days โณ. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error ๐ค ๐ , please reach out to my human friends ๐ hashibot-feedback@hashicorp.com. Thanks!
Community Note
Terraform (and AzureRM Provider) Version
Terraform v0.14.8 *provider registry.terraform.io/hashicorp/azurerm v2.55.0
Affected Resource(s)
azurerm_private_endpoint
Terraform Configuration Files
Panic Output
Error: Provider produced inconsistent final plan
When expanding the plan for module.private_link.azurerm_private_endpoint.synapse_serverless_sql to include new values learned so far during apply, provider "registry.terraform.io/hashicorp/azurerm" produced an invalid new value for .private_dns_zone_group[0].private_dns_zone_ids: new element 0 has appeared.
This is a bug in the provider, which should be reported in the provider's own issue tracker.
Expected Behaviour
The private Endpoint, DNS Zone and DNS A record should be created. A NIC (which isn't specified in the terraform code) should also be created with the private endpoint.
Actual Behaviour
When I plan and apply the configuration - I try to change the value and re plan and apply. A plan is successfully generated, however - the apply step will fail with the panic error above.
Steps to Reproduce
terraform plan
andterraform apply
- this will fail with an error telling you to import the resource if you want to manage it.and
terraform apply```Important Factoids
The terraform is being run via Azure Devops (no marketplace extensions used to init/plan/apply).
References
5529 (https://github.com/terraform-providers/terraform-provider-azurerm/issues/5529)