From 13ee1834fd50723e496b9991e188b4337b81b7ed Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Mon, 13 Nov 2023 17:42:08 +0800 Subject: [PATCH] Fix 101-managed-instance --- quickstart/101-managed-instance/main.tf | 6 +++++- quickstart/101-managed-instance/providers.tf | 8 ++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/quickstart/101-managed-instance/main.tf b/quickstart/101-managed-instance/main.tf index aa3c0286a..fa873d3e7 100644 --- a/quickstart/101-managed-instance/main.tf +++ b/quickstart/101-managed-instance/main.tf @@ -61,6 +61,8 @@ resource "azurerm_route_table" "example" { resource "azurerm_subnet_route_table_association" "example" { subnet_id = azurerm_subnet.example.id route_table_id = azurerm_route_table.example.id + + depends_on = [azurerm_subnet_network_security_group_association.example] } # Create managed instance @@ -75,6 +77,8 @@ resource "azurerm_mssql_managed_instance" "main" { sku_name = var.sku_name vcores = var.vcores storage_size_in_gb = var.storage_size_in_gb + + depends_on = [azurerm_subnet_route_table_association.example] } resource "random_password" "password" { @@ -89,4 +93,4 @@ resource "random_password" "password" { resource "random_pet" "prefix" { prefix = var.prefix length = 1 -} \ No newline at end of file +} diff --git a/quickstart/101-managed-instance/providers.tf b/quickstart/101-managed-instance/providers.tf index dc42605e0..fc1945054 100644 --- a/quickstart/101-managed-instance/providers.tf +++ b/quickstart/101-managed-instance/providers.tf @@ -14,5 +14,9 @@ terraform { } provider "azurerm" { - features {} -} \ No newline at end of file + features { + resource_group { + prevent_deletion_if_contains_resources = false + } + } +}