Skip to content

Commit

Permalink
remove hack
Browse files Browse the repository at this point in the history
  • Loading branch information
joecorall authored Jan 10, 2025
1 parent edb20f2 commit 171626a
Showing 1 changed file with 10 additions and 14 deletions.
24 changes: 10 additions & 14 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ terraform {
source = "hashicorp/google"
version = "= 6.15.0"
}
google-beta = {
source = "hashicorp/google-beta"
version = "= 6.15.0"
}
}
}

Expand Down Expand Up @@ -152,9 +156,12 @@ resource "google_cloud_run_v2_service_iam_member" "member" {
}

resource "google_cloud_run_v2_job" "vault-init" {
name = "vault-init"
location = var.region
launch_stage = "BETA"
provider = google-beta

name = "vault-init"
location = var.region
deletion_protection = false
start_execution_token = "start-once-created"

template {
template {
Expand Down Expand Up @@ -196,14 +203,3 @@ resource "google_cloud_run_v2_job" "vault-init" {
}
}

# currently no way to tell terraform to immediately run the job upon creation
# so we have to do this hack
resource "null_resource" "init" {
triggers = {
job-ready = google_cloud_run_v2_job.vault-init.id
}

provisioner "local-exec" {
command = format("gcloud beta run jobs execute %s --project %s --region %s", google_cloud_run_v2_job.vault-init.name, var.project, var.region)
}
}

0 comments on commit 171626a

Please sign in to comment.