Last active
May 2, 2021 07:36
-
-
Save geekzter/a2d7b3836d1eefbf1bee4a36e7f11658 to your computer and use it in GitHub Desktop.
Azure Container Registry Private Endpoint
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
resource azurerm_private_dns_zone acr { | |
name = "privatelink.azurecr.io" | |
resource_group_name = var.resource_group_name | |
} | |
resource azurerm_private_dns_zone_virtual_network_link acr { | |
name = "${var.resource_group_name}-registry-dns-link" | |
resource_group_name = var.resource_group_name | |
private_dns_zone_name = azurerm_private_dns_zone.acr.name | |
virtual_network_id = var.virtual_network_id | |
} | |
resource azurerm_private_endpoint acr_endpoint { | |
name = "${var.resource_group_name}-registry-endpoint" | |
location = var.location | |
resource_group_name = var.resource_group_name | |
subnet_id = var.subnet_id | |
private_dns_zone_group { | |
name = azurerm_private_dns_zone.acr.name | |
private_dns_zone_ids = [azurerm_private_dns_zone.acr.id] | |
} | |
private_service_connection { | |
is_manual_connection = false | |
name = "${var.resource_group_name}-registry-endpoint-connection" | |
private_connection_resource_id = var.container_registry_id | |
subresource_names = ["registry"] | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment