Skip to content

Commit

Permalink
revert extra changes
Browse files Browse the repository at this point in the history
  • Loading branch information
daniel-cit committed Oct 25, 2024
1 parent ff9e58b commit 3472e78
Show file tree
Hide file tree
Showing 7 changed files with 4 additions and 91 deletions.
11 changes: 0 additions & 11 deletions examples/tf_cloudbuild_builder_simple_github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
17 changes: 1 addition & 16 deletions examples/tf_cloudbuild_builder_simple_gitlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
15 changes: 1 addition & 14 deletions examples/tf_cloudbuild_workspace_simple_github/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
15 changes: 1 addition & 14 deletions examples/tf_cloudbuild_workspace_simple_gitlab/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
19 changes: 1 addition & 18 deletions modules/im_cloudbuild_workspace/cb.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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]
}
13 changes: 0 additions & 13 deletions modules/im_cloudbuild_workspace/sa.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
5 changes: 0 additions & 5 deletions modules/im_cloudbuild_workspace/versions.tf
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ terraform {
source = "hashicorp/random"
version = ">= 3.6.0"
}

time = {
source = "hashicorp/time"
version = ">= 0.12.0"
}
}

provider_meta "google" {
Expand Down

0 comments on commit 3472e78

Please sign in to comment.