diff --git a/main.tf b/main.tf index 99ae455..ae945d2 100644 --- a/main.tf +++ b/main.tf @@ -54,6 +54,7 @@ module "container" { location = var.location prefix = var.prefix env = var.env + subnet = module.network.compute_subnet_id } module "monitoring" { diff --git a/modules/Container/main.tf b/modules/Container/main.tf index 17d74fe..ac8b2b0 100644 --- a/modules/Container/main.tf +++ b/modules/Container/main.tf @@ -4,6 +4,7 @@ resource "azurerm_container_group" "container_group" { resource_group_name = var.rg os_type = "Linux" ip_address_type = "Public" + subnet_ids = toset([var.subnet]) container { @@ -20,5 +21,9 @@ resource "azurerm_container_group" "container_group" { port = 80 protocol = "TCP" } + ports { + port = 3310 + protocol = "TCP" + } } } \ No newline at end of file diff --git a/modules/Container/variables.tf b/modules/Container/variables.tf index dc242d9..cae6c3e 100644 --- a/modules/Container/variables.tf +++ b/modules/Container/variables.tf @@ -17,4 +17,8 @@ variable "prefix" { variable "env" { type = string +} + +variable "subnet" { + type = string } \ No newline at end of file diff --git a/modules/Database/main.tf b/modules/Database/main.tf index bae0aca..c233147 100644 --- a/modules/Database/main.tf +++ b/modules/Database/main.tf @@ -14,6 +14,7 @@ resource "azurerm_mssql_server" "sql_server" { name = "dbs-${var.prefix}-${var.env}-001" resource_group_name = var.rg location = var.location + tags = var.tags version = "12.0" administrator_login = data.azurerm_key_vault_secret.dbuser.value administrator_login_password = data.azurerm_key_vault_secret.dbpass.value diff --git a/modules/Monitoring/outputs.tf b/modules/Monitoring/outputs.tf index e40d4ab..4c44f13 100644 --- a/modules/Monitoring/outputs.tf +++ b/modules/Monitoring/outputs.tf @@ -4,4 +4,8 @@ output "instrumentation_key" { output "app_id" { value = azurerm_application_insights.application_insights.app_id +} + +output "log_analytics_workspace_id" { + value = azurerm_log_analytics_workspace.log_analytics_workspace.id } \ No newline at end of file diff --git a/modules/Network/main.tf b/modules/Network/main.tf index 4889b73..88e50f8 100644 --- a/modules/Network/main.tf +++ b/modules/Network/main.tf @@ -34,4 +34,23 @@ resource "azurerm_subnet" "backend" { resource_group_name = var.rg virtual_network_name = azurerm_virtual_network.vnet1.name address_prefixes = ["10.100.3.0/24"] +} + +resource "azurerm_private_dns_zone" "zones" { + for_each = var.private_dns_zones + + name = each.value + resource_group_name = var.rg + tags = var.tags +} + +# Private DNS Zone links to VNET +resource "azurerm_private_dns_zone_virtual_network_link" "zone_links" { + for_each = azurerm_private_dns_zone.zones + + name = "${each.value.name}-link" + resource_group_name = var.rg + private_dns_zone_name = each.value.name + virtual_network_id = azurerm_virtual_network.vnet1.id + tags = var.tags } \ No newline at end of file diff --git a/modules/Network/variables.tf b/modules/Network/variables.tf index 145bfb3..e7e8b4e 100644 --- a/modules/Network/variables.tf +++ b/modules/Network/variables.tf @@ -18,4 +18,16 @@ variable "prefix" { variable "env" { type = string +} + +variable "private_dns_zones" { + type = map(string) + default = { + blob_zone = "privatelink.blob.core.windows.net" + file_zone = "privatelink.file.core.windows.net" + eventgrid_zone = "privatelink.eventgrid.azure.net" + functionapp_zone = "privatelink.azurewebsites.net" + container_zone = "privatelink.aci.azure.net" + sql_zone = "privatelink.database.windows.net" + } } \ No newline at end of file diff --git a/plan.out b/plan.out index 9764447..3ae8fb6 100644 Binary files a/plan.out and b/plan.out differ