Skip to content

Commit

Permalink
Set outputs to null if no resource created + Restore variable type fo…
Browse files Browse the repository at this point in the history
…r scheduler_job
  • Loading branch information
Olivier Cervello committed Dec 20, 2019
1 parent c09890f commit 413aace
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@
*/

output "name" {
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0.name : var.scheduler_job.name
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0.name : null
description = "The name of the job created"
}

output "scheduler_job" {
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0 : var.scheduler_job
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0 : null
description = "The Cloud Scheduler job instance"
}

Expand Down
2 changes: 1 addition & 1 deletion variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ variable "time_zone" {
}

variable "scheduler_job" {
type = any
type = object({ name = string })
description = "An existing Cloud Scheduler job instance"
default = null
}

0 comments on commit 413aace

Please sign in to comment.