From 8a064aea730638a999d10f712b99a942eecc81ac Mon Sep 17 00:00:00 2001 From: hezijie Date: Tue, 12 Nov 2024 14:22:53 +0800 Subject: [PATCH] depends on azurerm_virtual_network_dns_servers resource --- README.md | 3 --- main.tf | 12 ++++-------- versions.tf | 4 ---- 3 files changed, 4 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index e2e513a..1f08a7a 100644 --- a/README.md +++ b/README.md @@ -192,14 +192,12 @@ Originally created by [Eugene Chuvyrov](http://github.com/echuvyrov) |------|---------| | [terraform](#requirement\_terraform) | >= 1.2 | | [azurerm](#requirement\_azurerm) | >= 3.11, < 4.0 | -| [time](#requirement\_time) | >= 0.12.1, < 1.0 | ## Providers | Name | Version | |------|---------| | [azurerm](#provider\_azurerm) | >= 3.11, < 4.0 | -| [time](#provider\_time) | >= 0.12.1, < 1.0 | ## Modules @@ -215,7 +213,6 @@ No modules. | [azurerm_subnet_route_table_association.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/subnet_route_table_association) | resource | | [azurerm_virtual_network.vnet](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network) | resource | | [azurerm_virtual_network_dns_servers.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/virtual_network_dns_servers) | resource | -| [time_sleep.wait_1_sec](https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep) | resource | ## Inputs diff --git a/main.tf b/main.tf index aee6bd7..758bf49 100644 --- a/main.tf +++ b/main.tf @@ -64,6 +64,8 @@ resource "azurerm_subnet" "subnet_count" { } } } + + depends_on = [azurerm_virtual_network_dns_servers.this] } resource "azurerm_subnet" "subnet_for_each" { @@ -89,6 +91,8 @@ resource "azurerm_subnet" "subnet_for_each" { } } } + + depends_on = [azurerm_virtual_network_dns_servers.this] } locals { @@ -99,18 +103,11 @@ locals { } } -resource "time_sleep" "wait" { - create_duration = "10s" - destroy_duration = "10s" - depends_on = [azurerm_subnet.subnet_for_each, azurerm_subnet.subnet_count] -} - resource "azurerm_subnet_network_security_group_association" "vnet" { for_each = var.nsg_ids network_security_group_id = each.value subnet_id = local.azurerm_subnets_name_id_map[each.key] - depends_on = [time_sleep.wait] } resource "azurerm_subnet_route_table_association" "vnet" { @@ -118,5 +115,4 @@ resource "azurerm_subnet_route_table_association" "vnet" { route_table_id = each.value subnet_id = local.azurerm_subnets_name_id_map[each.key] - depends_on = [time_sleep.wait] } diff --git a/versions.tf b/versions.tf index 73481f3..588b5f4 100644 --- a/versions.tf +++ b/versions.tf @@ -6,9 +6,5 @@ terraform { source = "hashicorp/azurerm" version = ">= 3.11, < 4.0" } - time = { - source = "hashicorp/time" - version = ">= 0.12.1, < 1.0" - } } }