diff --git a/examples/tf_cloudbuild_builder_simple_github/main.tf b/examples/tf_cloudbuild_builder_simple_github/main.tf index 50d27397..efc37c78 100644 --- a/examples/tf_cloudbuild_builder_simple_github/main.tf +++ b/examples/tf_cloudbuild_builder_simple_github/main.tf @@ -54,17 +54,6 @@ module "cloudbuilder" { # allow logs bucket to be destroyed cb_logs_bucket_force_destroy = true - - depends_on = [time_sleep.wait_propagation] -} - -resource "time_sleep" "wait_propagation" { - create_duration = "30s" - - depends_on = [ - google_cloudbuildv2_repository.repository_connection, - google_cloudbuildv2_connection.vcs_connection, - ] } // Create a secret containing the personal access token and grant permissions to the Service Agent. diff --git a/examples/tf_cloudbuild_builder_simple_gitlab/main.tf b/examples/tf_cloudbuild_builder_simple_gitlab/main.tf index a9e9e756..58206005 100644 --- a/examples/tf_cloudbuild_builder_simple_gitlab/main.tf +++ b/examples/tf_cloudbuild_builder_simple_gitlab/main.tf @@ -54,24 +54,9 @@ module "cloudbuilder" { # allow logs bucket to be destroyed cb_logs_bucket_force_destroy = true - depends_on = [ - module.enabled_google_apis, - time_sleep.wait_propagation, - ] + depends_on = [module.enabled_google_apis] } - -resource "time_sleep" "wait_propagation" { - create_duration = "30s" - - depends_on = [ - google_cloudbuildv2_repository.repository_connection, - google_cloudbuildv2_connection.vcs_connection, - ] -} - - - // Create a secret containing the personal access token and grant permissions to the Service Agent. resource "google_secret_manager_secret" "gitlab_api_secret" { project = var.project_id diff --git a/examples/tf_cloudbuild_workspace_simple_github/main.tf b/examples/tf_cloudbuild_workspace_simple_github/main.tf index b0f14a43..1155997f 100644 --- a/examples/tf_cloudbuild_workspace_simple_github/main.tf +++ b/examples/tf_cloudbuild_workspace_simple_github/main.tf @@ -58,20 +58,7 @@ module "tf_workspace" { } cloudbuild_env_vars = ["TF_VAR_project_id=${var.project_id}"] - depends_on = [ - module.enabled_google_apis, - time_sleep.wait_propagation, - ] -} - - -resource "time_sleep" "wait_propagation" { - create_duration = "30s" - - depends_on = [ - google_cloudbuildv2_repository.repository_connection, - google_cloudbuildv2_connection.vcs_connection, - ] + depends_on = [module.enabled_google_apis] } // Create a secret containing the personal access token and grant permissions to the Service Agent. diff --git a/examples/tf_cloudbuild_workspace_simple_gitlab/main.tf b/examples/tf_cloudbuild_workspace_simple_gitlab/main.tf index 9c8c7e59..8d8e0947 100644 --- a/examples/tf_cloudbuild_workspace_simple_gitlab/main.tf +++ b/examples/tf_cloudbuild_workspace_simple_gitlab/main.tf @@ -57,20 +57,7 @@ module "tf_workspace" { } cloudbuild_env_vars = ["TF_VAR_project_id=${var.project_id}"] - depends_on = [ - module.enabled_google_apis, - time_sleep.wait_propagation, - ] -} - - -resource "time_sleep" "wait_propagation" { - create_duration = "30s" - - depends_on = [ - google_cloudbuildv2_repository.repository_connection, - google_cloudbuildv2_connection.vcs_connection, - ] + depends_on = [module.enabled_google_apis] } // Create a secret containing the personal access token and grant permissions to the Service Agent. diff --git a/modules/im_cloudbuild_workspace/cb.tf b/modules/im_cloudbuild_workspace/cb.tf index da92ab10..03663bab 100644 --- a/modules/im_cloudbuild_workspace/cb.tf +++ b/modules/im_cloudbuild_workspace/cb.tf @@ -123,22 +123,5 @@ resource "google_cloudbuild_trigger" "triggers" { included_files = var.cloudbuild_included_files ignored_files = var.cloudbuild_ignored_files - depends_on = [ - google_project_iam_member.im_sa_roles, - time_sleep.iam_propagation, - ] -} - -resource "time_sleep" "iam_propagation" { - create_duration = "30s" - - depends_on = [ - google_project_iam_member.im_sa_roles, - google_project_iam_member.cb_config_admin_role, - google_project_iam_member.cb_config_agent_role, - google_project_iam_member.cb_logWriter_role, - google_project_iam_member.cb_serviceAccountUser_role, - google_project_iam_member.cb_storage_objects_viewer, - google_project_iam_member.cb_service_agent_role, - ] + depends_on = [google_project_iam_member.im_sa_roles] } diff --git a/modules/im_cloudbuild_workspace/sa.tf b/modules/im_cloudbuild_workspace/sa.tf index 9971af9c..13bcf4d7 100644 --- a/modules/im_cloudbuild_workspace/sa.tf +++ b/modules/im_cloudbuild_workspace/sa.tf @@ -55,12 +55,6 @@ resource "google_project_iam_member" "cb_logWriter_role" { member = "serviceAccount:${local.cloudbuild_sa_email}" } -resource "google_project_iam_member" "cb_service_agent_role" { - project = var.project_id - role = "roles/cloudbuild.serviceAgent" - member = "serviceAccount:service-${data.google_project.project.number}@gcp-sa-cloudbuild.iam.gserviceaccount.com" -} - # Allows the Cloud Build service account to act as the Infra Manger service account resource "google_project_iam_member" "cb_serviceAccountUser_role" { count = local.create_cloudbuild_sa ? 1 : 0 @@ -76,13 +70,6 @@ resource "google_project_iam_member" "cb_storage_objects_viewer" { member = "serviceAccount:${local.cloudbuild_sa_email}" } -resource "google_project_iam_member" "cb_connection_admin" { - count = local.create_cloudbuild_sa ? 1 : 0 - project = var.project_id - role = "roles/cloudbuild.connectionAdmin" - member = "serviceAccount:${local.cloudbuild_sa_email}" -} - resource "google_service_account" "im_sa" { count = local.create_infra_manager_sa ? 1 : 0 project = var.project_id diff --git a/modules/im_cloudbuild_workspace/versions.tf b/modules/im_cloudbuild_workspace/versions.tf index 1262b129..5e70d8c1 100644 --- a/modules/im_cloudbuild_workspace/versions.tf +++ b/modules/im_cloudbuild_workspace/versions.tf @@ -32,11 +32,6 @@ terraform { source = "hashicorp/random" version = ">= 3.6.0" } - - time = { - source = "hashicorp/time" - version = ">= 0.12.0" - } } provider_meta "google" {