google / exposure-notifications-verification-server

Verification component for COVID-19 Exposure Notifications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error with Terraform output's db_backup_command

nickhattwick opened this issue · comments

TL;DR

The value for the Terraform output for "db_backup_command" attempts to run a backup-database-worker job that isn't created The only reference to "backup-database-worker" in the code is from this output and this is most likely meant to trigger the "backup-worker" job defined in terraform/service_backup.tf.

Expected behavior
Expected the command from Terraform's output to work without issue and start a Cloud Scheduler job.

Observed behavior
Instead ran the command
"gcloud scheduler jobs run backup-database-worker --project ${var.project}"
and got the output
ERROR: (gcloud.scheduler.jobs.run) NOT_FOUND: Job not found.

In the console, no jobs are defined under Cloud Scheduler named backup-database-worker and there aren't any other references in the repository.

Proposed Fix
Change the output in terraform/database.tf from

output "db_backup_command" {
  value = "gcloud scheduler jobs run backup-database-worker --project ${var.project}"
}

to

output "db_backup_command" {
  value = "gcloud scheduler jobs run backup-worker --project ${var.project}"
}

or

output "db_backup_command" {
  value = "gcloud scheduler jobs run ${google_cloud_scheduler_job.backup-worker.name} --project ${var.project}"
}