-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for list of private_ip_address attributes on azurerm_private_endpoint resource #6571
Comments
Can this be expanded to include the data source |
There also needs to be a way to get what FQDN is associated with each ip address in the private endpoint. With Terraform I want to create a Private DNS Zone with a DNS entries for each of the ip addresses associated with the private endpoint. To do that, I need to know what DNS entry maps with each address. Example: if I create the ACR called myregistry and a private endpoint to it with both in EastUS2, I would have a private IP address for myregistry.eastus2.data.privatelink.azurecr.io and myregistry.privatelink.azurecr.io. |
I saw this option was merged in 2.1.0 but even in 2.9 it doesn't work, how come?
|
This MR was made to support that #5838 |
Yeah I saw in #5838 there should definetly be a
resource "azurerm_private_endpoint" "this" {
name = "${lower(var.solution_name)}-endpoint"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
subnet_id = azurerm_subnet.private_link_endpoint.id
private_service_connection {
name = "${lower(var.solution_name)}-privateserviceconnection"
private_connection_resource_id = azurerm_mssql_server.this.id
is_manual_connection = false
subresource_names = ["sqlServer"]
}
}
resource "azurerm_private_dns_zone" "private_link" {
name = "privatelink.database.windows.net"
resource_group_name = azurerm_resource_group.this.name
}
resource "azurerm_private_dns_a_record" "private_link" {
name = azurerm_mssql_server.this.name
zone_name = azurerm_private_dns_zone.private_link.name
resource_group_name = azurerm_resource_group.this.name
ttl = 300
records = [azurerm_private_endpoint.this.private_ip_address]
} |
I ended up just making a manual DNS record in the private zone for the IP address, after terraform completed the run. Don't have a way to reference it for now. |
I got around it by doing this resource "azurerm_private_endpoint" "this" {
name = "${lower(var.solution_name)}-endpoint"
location = azurerm_resource_group.this.location
resource_group_name = azurerm_resource_group.this.name
subnet_id = azurerm_subnet.private_link_endpoint.id
private_service_connection {
name = "${lower(var.solution_name)}-privateserviceconnection"
private_connection_resource_id = azurerm_mssql_server.this.id
is_manual_connection = false
subresource_names = ["sqlServer"]
}
}
resource "azurerm_private_dns_zone" "private_link" {
name = "privatelink.database.windows.net"
resource_group_name = azurerm_resource_group.this.name
}
data "azurerm_private_endpoint_connection" "private_link" {
name = "${lower(var.solution_name)}-endpoint"
resource_group_name = azurerm_resource_group.this.name
depends_on = [azurerm_private_endpoint.this]
}
# https://github.com/terraform-providers/terraform-provider-azurerm/issues/6571
resource "azurerm_private_dns_a_record" "private_link" {
depends_on = [data.azurerm_private_endpoint_connection.private_link]
name = azurerm_mssql_server.this.name
zone_name = azurerm_private_dns_zone.private_link.name
resource_group_name = azurerm_resource_group.this.name
ttl = 300
records = [data.azurerm_private_endpoint_connection.private_link.private_service_connection.0.private_ip_address]
} The only downside is it wants to update the DNS record each time an apply is run
But I can live with that in the short term |
found a solution, check this out (it works, I am using it now):
So this is what you need (postgresql is a name in my case, but might work with all other link types, I plan to try for storage too, still don't have a link to storage account buckets, I suspect my traffic to storage is not going through optimal route, maybe even goes through external network 🙀 ) |
* Fixed requiresImport test case * Progress exposing dns zone groups * Work thus far redesign * Progress thus far * Progress * Change data structure * Close mostly working now * Remove old resources * Code complete needs docs and tests * Add docs and example * Added Tests and updated docs * Fix Lint Errors * Update azurerm/internal/services/network/parse/private_endpoint.go Co-authored-by: Tom Harvey <[email protected]> * Update azurerm/internal/services/network/private_endpoint_resource.go Co-authored-by: Tom Harvey <[email protected]> * Update azurerm/internal/services/network/private_endpoint_resource.go Co-authored-by: Tom Harvey <[email protected]> * Changes per PR * Fix lint error * Requested changes per PR comment Co-authored-by: Tom Harvey <[email protected]>
This has been released in version 2.15.0 of the provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. As an example: provider "azurerm" {
version = "~> 2.15.0"
}
# ... other configuration ... |
Hi @WodansSon, since it looks like it's now supported/fixed with |
Hi @WodansSon and @tombuildsstuff, not sure how the referenced PR fixes the initial ask of this issue with the example of ACR?
But there is no |
@mathieu-benoit here is an example from the PR.
The DNS configs can be referenced from the A private_dns_zone_configs block exports:
|
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 👉 [email protected]. Thanks! |
Community Note
Description
The private endpoint for Azure Container Registry exposes two IP addresses, both of which are required for using ACR. The
azurerm_private_endpoint
should expose both, but right now, it only exposes the one, viaprivate_ip_address
.New or Affected Resource(s)
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: