From 80ac647815948a61e86deeceab72d327afb55f7c Mon Sep 17 00:00:00 2001 From: dkistner Date: Wed, 9 Sep 2020 10:16:41 +0200 Subject: [PATCH] Prepare upgrade to Terraform azurerm v2.x.x Add association resources for routetable-to-subnet and nsg-to-subnet in parallel to internal associations on the subnet resource. --- charts/internal/azure-infra/templates/main.tf | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/internal/azure-infra/templates/main.tf b/charts/internal/azure-infra/templates/main.tf index e9c841504..feff588dc 100644 --- a/charts/internal/azure-infra/templates/main.tf +++ b/charts/internal/azure-infra/templates/main.tf @@ -63,6 +63,11 @@ resource "azurerm_route_table" "workers" { {{- end}} } +resource "azurerm_subnet_route_table_association" "workers-rt-subnet-association" { + subnet_id = azurerm_subnet.workers.id + route_table_id = azurerm_route_table.workers.id +} + resource "azurerm_network_security_group" "workers" { name = "{{ required "clusterName is required" .Values.clusterName }}-workers" location = "{{ required "azure.region is required" .Values.azure.region }}" @@ -73,6 +78,11 @@ resource "azurerm_network_security_group" "workers" { {{- end}} } +resource "azurerm_subnet_network_security_group_association" "workers-nsg-subnet-association" { + subnet_id = azurerm_subnet.workers.id + network_security_group_id = azurerm_network_security_group.workers.id +} + {{ if .Values.create.natGateway -}} #=============================================== #= NAT Gateway