Skip to content

Commit cb7fef1

Browse files
authored
test: add delay between hub and spoke in example (#789)
* test: add delay between hub and spoke in example
1 parent 5a37f81 commit cb7fef1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

examples/hub-spoke-delegated-resolver/main.tf

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,20 @@ module "resource_group" {
1010
existing_resource_group_name = var.resource_group
1111
}
1212

13+
#############################################################################
14+
# Delay between hub and spoke creation/destruction
15+
#
16+
# You can adjust these delay timings if needed.
17+
# This block will put a slight delay between the Hub and Spoke VPC operations.
18+
# This will help if there are resources (such as DNS resolver) that need some
19+
# extra time to fully complete before the other VPC operations continue.
20+
#############################################################################
21+
resource "time_sleep" "delay_between_hub_spoke" {
22+
depends_on = [module.hub_vpc]
23+
create_duration = "30s"
24+
destroy_duration = "60s"
25+
}
26+
1327
#############################################################################
1428
# Provision VPC
1529
#############################################################################
@@ -55,6 +69,7 @@ data "ibm_iam_account_settings" "iam_account_settings" {}
5569

5670
module "spoke_vpc" {
5771
source = "../../"
72+
depends_on = [time_sleep.delay_between_hub_spoke]
5873
resource_group_id = module.resource_group.resource_group_id
5974
region = var.region
6075
name = "spoke"

examples/hub-spoke-delegated-resolver/version.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,9 @@ terraform {
77
source = "IBM-Cloud/ibm"
88
version = ">= 1.59.0"
99
}
10+
time = {
11+
source = "hashicorp/time"
12+
version = ">= 0.9.1, < 1.0.0"
13+
}
1014
}
1115
}

0 commit comments

Comments
 (0)