@@ -136,8 +136,12 @@ resource "azurerm_private_endpoint" "pep1" {
136
136
location = var. location
137
137
resource_group_name = var. resource_group_name
138
138
subnet_id = join (" " , var. subnet_id )
139
+ private_dns_zone_group {
140
+ name = format (" %s-%s-acr" , var. container_registry_config . name , " dns-zone-group" )
141
+ private_dns_zone_ids = var. existing_private_dns_zone == null ? [azurerm_private_dns_zone . dnszone1 [0 ]. id ] : var. existing_private_dns_zone_id
142
+ }
139
143
private_service_connection {
140
- name = " containerregistryprivatelink "
144
+ name = format ( " %s-%s-acr " , var . container_registry_config . name , " private-link " )
141
145
is_manual_connection = false
142
146
private_connection_resource_id = azurerm_container_registry. main [0 ]. id
143
147
subresource_names = [" registry" ]
@@ -241,43 +245,6 @@ resource "azurerm_private_dns_zone_virtual_network_link" "addon_vent_link" {
241
245
tags = module. labels . tags
242
246
}
243
247
244
- # #-----------------------------------------------------------------------------
245
- # # Below resource will create a-record in private dns zone when private dns zone is in same subscription.
246
- # #-----------------------------------------------------------------------------
247
- resource "azurerm_private_dns_a_record" "arecord-same_sub" {
248
- count = var. enable && var. enable_private_endpoint && var. diff_sub == false ? 1 : 0
249
- name = join (" " , azurerm_container_registry. main . * . name )
250
- zone_name = local. private_dns_zone_name
251
- resource_group_name = local. valid_rg_name
252
- ttl = 3600
253
- records = [data . azurerm_private_endpoint_connection . private-ip . 0 . private_service_connection . 0 . private_ip_address ]
254
- tags = module. labels . tags
255
- lifecycle {
256
- ignore_changes = [
257
- tags ,
258
- ]
259
- }
260
- }
261
-
262
- # #-----------------------------------------------------------------------------
263
- # # Below resource will create a-record in private dns zone when private dns zone is in different subscription.
264
- # #-----------------------------------------------------------------------------
265
- resource "azurerm_private_dns_a_record" "arecord_diff-sub" {
266
- count = var. enable && var. enable_private_endpoint && var. diff_sub == true ? 1 : 0
267
- provider = azurerm. peer
268
- name = join (" " , azurerm_container_registry. main . * . name )
269
- zone_name = local. private_dns_zone_name
270
- resource_group_name = local. valid_rg_name
271
- ttl = 3600
272
- records = [data . azurerm_private_endpoint_connection . private-ip . 0 . private_service_connection . 0 . private_ip_address ]
273
- tags = module. labels . tags
274
- lifecycle {
275
- ignore_changes = [
276
- tags ,
277
- ]
278
- }
279
- }
280
-
281
248
# #-----------------------------------------------------------------------------
282
249
# # Below resource will create diagnostic setting for ACR.
283
250
# #-----------------------------------------------------------------------------
0 commit comments