Complete the code to create a private endpoint resource in Azure.
resource "azurerm_private_endpoint" "example" { name = "example-private-endpoint" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name subnet_id = [1] }
The subnet_id property must reference the subnet resource ID where the private endpoint will be placed.
Complete the code to specify the private service connection for the private endpoint.
private_service_connection {
name = "example-psc"
private_connection_resource_id = [1]
is_manual_connection = false
subresource_names = ["blob"]
}The private_connection_resource_id must point to the resource you want to connect privately, such as a storage account.
Fix the error in the private endpoint configuration by completing the missing property.
resource "azurerm_private_endpoint" "example" { name = "example-private-endpoint" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name subnet_id = azurerm_subnet.example.id [1] { name = "example-psc" private_connection_resource_id = azurerm_storage_account.example.id is_manual_connection = false subresource_names = ["blob"] } }
service_endpointThe block defining the connection to the private resource must be named private_service_connection.
Fill both blanks to create a private DNS zone link for the private endpoint.
resource "azurerm_private_dns_zone_virtual_network_link" "example" { name = "example-link" resource_group_name = azurerm_resource_group.example.name private_dns_zone_name = [1] virtual_network_id = [2] registration_enabled = false }
The private_dns_zone_name must be the correct private DNS zone for the service, and virtual_network_id must be the virtual network's ID.
Fill all three blanks to define a private endpoint with tags and manual approval.
resource "azurerm_private_endpoint" "example" { name = "example-private-endpoint" location = azurerm_resource_group.example.location resource_group_name = azurerm_resource_group.example.name subnet_id = [1] tags = { environment = [2] } private_service_connection { name = "example-psc" private_connection_resource_id = [3] is_manual_connection = true subresource_names = ["sqlServer"] } }
The subnet_id must be the subnet's ID, the tag value is a string for environment, and the private_connection_resource_id is the SQL server's ID.