Skip to content

Commit

Permalink
chore: add dns zone for redis
Browse files Browse the repository at this point in the history
  • Loading branch information
larwaa committed Jul 14, 2023
1 parent 8bc7302 commit 1c2a447
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions infrastructure/modules/redis/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ resource "azurerm_private_endpoint" "this" {
location = var.resource_group.location
subnet_id = azurerm_subnet.this.id

private_dns_zone_group {
name = "redis-${var.suffix}.com"
private_dns_zone_ids = [azurerm_private_dns_zone.this.id]
}

private_service_connection {
name = "redis-pe-connection-${var.suffix}"
private_connection_resource_id = azurerm_redis_cache.this.id
Expand All @@ -35,3 +40,15 @@ resource "azurerm_private_endpoint" "this" {
}

}

resource "azurerm_private_dns_zone" "this" {
name = "${var.suffix}.privatelink.redis.cache.windows.net"
resource_group_name = var.resource_group.name
}

resource "azurerm_private_dns_zone_virtual_network_link" "this" {
name = "redis-${var.suffix}.com"
resource_group_name = var.resource_group.name
private_dns_zone_name = azurerm_private_dns_zone.this.name
virtual_network_id = var.network.virtual_network_id
}

0 comments on commit 1c2a447

Please sign in to comment.