Open sdecker opened 3 months ago
Hi @sdecker , do you mean that we should export private_endpoints
for the replica if the parent App Configuration has private endpoint enabled? I have checked the Azure REST API, seems we cannot retrieve the private_ip
from App Configuration or Replica API.
Could you share how we can get the private ip connected to the replica?
Thanks.
Hi @teowa, unless there is another way to get Terraform to know the PE resources are changing and not require 2 deploys every time a replica is added or removed. It's a tricky issue given the behind-the-scenes design of the replicas and how PEs are updated with them. I see there is a Private EndPoint Connections under the App Configuration API that gives the ID of the endpoint associated.
Another thought is a new resource similar to https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/cdn_frontdoor_custom_domain_association is needed for this use case? That resource forces Terraform to validate changes between two resources routes and custom domains. Perhaps something similar here for replicas and PEs?
Is there an existing issue for this?
Community Note
Description
Scenario: provision an azurerm_app_configuration including 2 replicas with a azurerm_private_endpoint without private DNS zone integration (We cannot use private DNS zones because of a double hub and spoke design) Private Link and DNS integration in hub and spoke network architectures
Now add a 3rd replica to the app configuration. The only change Terraform detects is to azurerm_app_configuration resource because the Private Endpoint is updated behind the scenes. The replica attribute of azurerm_app_configuration only contains ID and enpoint (string public URL). So it is not possible to add the required 3rd private DNS record because custom_dns_configs attribute of azurerm_private_endpoint has not updated.
Make zero changes but TF a second time. The azurerm_private_endpoint resources now detects the new IP and new private DNS record is created.
So the azurerm_app_configuration resources needs to return the private IPs for the replicas.
New or Affected Resource(s)/Data Source(s)
azurerm_app_configuration
Potential Terraform Configuration
References
No response