Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
depends on azurerm_virtual_network_dns_servers resource
Browse files Browse the repository at this point in the history
  • Loading branch information
lonegunmanb committed Nov 12, 2024
1 parent e402ff9 commit 68641d1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 15 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,12 @@ Originally created by [Eugene Chuvyrov](http://github.com/echuvyrov)
|------|---------|
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.2 |
| <a name="requirement_azurerm"></a> [azurerm](#requirement\_azurerm) | >= 3.11, < 4.0 |
| <a name="requirement_time"></a> [time](#requirement\_time) | >= 0.12.1, < 1.0 |

## Providers

| Name | Version |
|------|---------|
| <a name="provider_azurerm"></a> [azurerm](#provider\_azurerm) | >= 3.11, < 4.0 |
| <a name="provider_time"></a> [time](#provider\_time) | >= 0.12.1, < 1.0 |

## Modules

Expand All @@ -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

Expand Down
12 changes: 4 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ resource "azurerm_subnet" "subnet_count" {
}
}
}

depends_on = [azurerm_virtual_network_dns_servers.this]
}

resource "azurerm_subnet" "subnet_for_each" {
Expand All @@ -89,6 +91,8 @@ resource "azurerm_subnet" "subnet_for_each" {
}
}
}

depends_on = [azurerm_virtual_network_dns_servers.this]
}

locals {
Expand All @@ -99,24 +103,16 @@ 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" {
for_each = var.route_tables_ids

route_table_id = each.value
subnet_id = local.azurerm_subnets_name_id_map[each.key]
depends_on = [time_sleep.wait]
}
4 changes: 0 additions & 4 deletions versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,5 @@ terraform {
source = "hashicorp/azurerm"
version = ">= 3.11, < 4.0"
}
time = {
source = "hashicorp/time"
version = ">= 0.12.1, < 1.0"
}
}
}

0 comments on commit 68641d1

Please sign in to comment.