From 626a971d824b299df5e8a1f1dba49e6c89972c7b Mon Sep 17 00:00:00 2001 From: neil-yechenwei Date: Fri, 17 Jan 2025 15:59:58 +0800 Subject: [PATCH] update the dependencies in tc --- ...wall_vhub_local_rulestack_resource_test.go | 28 +++++++++------ ...on_firewall_vhub_panorama_resource_test.go | 16 ++++----- ...wall_vnet_local_rulestack_resource_test.go | 34 ++++++++++++++----- ...on_firewall_vnet_panorama_resource_test.go | 22 +++++++----- 4 files changed, 66 insertions(+), 34 deletions(-) diff --git a/internal/services/paloalto/next_generation_firewall_vhub_local_rulestack_resource_test.go b/internal/services/paloalto/next_generation_firewall_vhub_local_rulestack_resource_test.go index e7193dc06915..d2aa1256e087 100644 --- a/internal/services/paloalto/next_generation_firewall_vhub_local_rulestack_resource_test.go +++ b/internal/services/paloalto/next_generation_firewall_vhub_local_rulestack_resource_test.go @@ -217,6 +217,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d-e" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack" "test" { name = "acctest-ngfwvh-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -273,6 +281,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d-e" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_hub_local_rulestack" "test" { name = "acctest-ngfwvh-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -322,14 +338,6 @@ resource "azurerm_public_ip" "test" { sku = "Standard" } -resource "azurerm_public_ip" "egress" { - name = "acctestpublicip-%[1]d-e" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - allocation_method = "Static" - sku = "Standard" -} - resource "azurerm_virtual_wan" "test" { name = "acctestvwan-%[1]d" resource_group_name = azurerm_resource_group.test.name @@ -374,8 +382,8 @@ resource "azurerm_palo_alto_local_rulestack_rule" "test" { resource "azurerm_palo_alto_virtual_network_appliance" "test" { name = "testAcc-panva-%[1]d" virtual_hub_id = azurerm_virtual_hub.test.id -} - + depends_on = [azurerm_palo_alto_local_rulestack_rule.test] +} `, data.RandomInteger, data.Locations.Primary) } diff --git a/internal/services/paloalto/next_generation_firewall_vhub_panorama_resource_test.go b/internal/services/paloalto/next_generation_firewall_vhub_panorama_resource_test.go index 23631f310df7..72092f43e445 100644 --- a/internal/services/paloalto/next_generation_firewall_vhub_panorama_resource_test.go +++ b/internal/services/paloalto/next_generation_firewall_vhub_panorama_resource_test.go @@ -163,6 +163,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_hub_panorama" "test" { name = "acctest-ngfwvh-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -227,14 +235,6 @@ resource "azurerm_public_ip" "test" { sku = "Standard" } -resource "azurerm_public_ip" "egress" { - name = "acctestpublicip-%[1]d" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - allocation_method = "Static" - sku = "Standard" -} - resource "azurerm_virtual_wan" "test" { name = "acctestvwan-%[1]d" resource_group_name = azurerm_resource_group.test.name diff --git a/internal/services/paloalto/next_generation_firewall_vnet_local_rulestack_resource_test.go b/internal/services/paloalto/next_generation_firewall_vnet_local_rulestack_resource_test.go index ef6d28634c26..09e6cbedba65 100644 --- a/internal/services/paloalto/next_generation_firewall_vnet_local_rulestack_resource_test.go +++ b/internal/services/paloalto/next_generation_firewall_vnet_local_rulestack_resource_test.go @@ -147,6 +147,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rules untrusted_subnet_id = azurerm_subnet.test2.id } } + + depends_on = [azurerm_palo_alto_local_rulestack_rule.test] } `, r.template(data), data.RandomInteger) } @@ -171,6 +173,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rules untrusted_subnet_id = azurerm_subnet.test2.id } } + + depends_on = [azurerm_palo_alto_local_rulestack_rule.test] } `, r.template(data), data.RandomInteger) } @@ -227,6 +231,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d-e" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack" "test" { name = "acctest-ngfwvn-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -275,6 +287,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rules port = 18082 } } + + depends_on = [azurerm_palo_alto_local_rulestack_rule.test] } `, r.template(data), data.RandomInteger) } @@ -287,6 +301,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d-e" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rulestack" "test" { name = "acctest-ngfwvn-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -322,6 +344,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_local_rules port = 18082 } } + + depends_on = [azurerm_palo_alto_local_rulestack_rule.test] } `, r.template(data), data.RandomInteger) } @@ -341,14 +365,6 @@ resource "azurerm_public_ip" "test" { sku = "Standard" } -resource "azurerm_public_ip" "egress" { - name = "acctestpublicip-%[1]d-e" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - allocation_method = "Static" - sku = "Standard" -} - resource "azurerm_network_security_group" "test" { name = "acceptanceTestSecurityGroup1" location = azurerm_resource_group.test.location @@ -416,6 +432,8 @@ resource "azurerm_palo_alto_local_rulestack" "test" { name = "testAcc-palrs-%[1]d" resource_group_name = azurerm_resource_group.test.name location = "%[2]s" + + depends_on = [azurerm_subnet_network_security_group_association.test1, azurerm_subnet_network_security_group_association.test2] } resource "azurerm_palo_alto_local_rulestack_rule" "test" { diff --git a/internal/services/paloalto/next_generation_firewall_vnet_panorama_resource_test.go b/internal/services/paloalto/next_generation_firewall_vnet_panorama_resource_test.go index 95b7f01394d1..ac7b20e281cd 100644 --- a/internal/services/paloalto/next_generation_firewall_vnet_panorama_resource_test.go +++ b/internal/services/paloalto/next_generation_firewall_vnet_panorama_resource_test.go @@ -134,6 +134,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama" " untrusted_subnet_id = azurerm_subnet.test2.id } } + + depends_on = [azurerm_subnet_network_security_group_association.test1, azurerm_subnet_network_security_group_association.test2] } `, r.template(data), data.RandomInteger, os.Getenv("ARM_PALO_ALTO_PANORAMA_CONFIG")) } @@ -159,6 +161,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama" " untrusted_subnet_id = azurerm_subnet.test2.id } } + + depends_on = [azurerm_subnet_network_security_group_association.test1, azurerm_subnet_network_security_group_association.test2] } `, r.template(data), data.RandomInteger, os.Getenv("ARM_PALO_ALTO_PANORAMA_CONFIG")) } @@ -171,6 +175,14 @@ provider "azurerm" { %[1]s +resource "azurerm_public_ip" "egress" { + name = "acctestpublicip-%[2]d-e" + location = azurerm_resource_group.test.location + resource_group_name = azurerm_resource_group.test.name + allocation_method = "Static" + sku = "Standard" +} + resource "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama" "test" { name = "acctest-ngfwvn-%[2]d" resource_group_name = azurerm_resource_group.test.name @@ -220,6 +232,8 @@ resource "azurerm_palo_alto_next_generation_firewall_virtual_network_panorama" " port = 18082 } } + + depends_on = [azurerm_subnet_network_security_group_association.test1, azurerm_subnet_network_security_group_association.test2] } `, r.template(data), data.RandomInteger, data.Locations.Primary, os.Getenv("ARM_PALO_ALTO_PANORAMA_CONFIG")) } @@ -239,14 +253,6 @@ resource "azurerm_public_ip" "test" { sku = "Standard" } -resource "azurerm_public_ip" "egress" { - name = "acctestpublicip-%[1]d-e" - location = azurerm_resource_group.test.location - resource_group_name = azurerm_resource_group.test.name - allocation_method = "Static" - sku = "Standard" -} - resource "azurerm_network_security_group" "test" { name = "acceptanceTestSecurityGroup1" location = azurerm_resource_group.test.location