Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion .gcb/builds/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ terraform {
source = "hashicorp/google"
version = "~> 6.0.0"
}
time = {
source = "hashicorp/time"
version = "~> 0.11.0"
}
}
}

Expand All @@ -33,12 +37,19 @@ module "services" {
project = var.project
}

# Wait for services to be fully active before creating resources.
# Service enablement can take time to propagate.
resource "time_sleep" "wait_for_services" {
create_duration = "60s"
depends_on = [module.services]
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently we want to use triggers to have this sleep take affect when the services change. depends_on alone doesn't do that, it just controls the order of operations.

https://registry.terraform.io/providers/hashicorp/time/latest/docs/resources/sleep#triggers-usage

}

# Create the resources we will need to run integration tests on.
module "resources" {
source = "./resources"
project = var.project
region = var.region
depends_on = [module.services]
depends_on = [time_sleep.wait_for_services]
}

# Create the service account needed for GCB and grant it the necessary
Expand Down
Loading