Skip to content

Commit 413aace

Browse files
author
Olivier Cervello
committed
Set outputs to null if no resource created + Restore variable type for scheduler_job
1 parent c09890f commit 413aace

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

outputs.tf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@
1515
*/
1616

1717
output "name" {
18-
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0.name : var.scheduler_job.name
18+
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0.name : null
1919
description = "The name of the job created"
2020
}
2121

2222
output "scheduler_job" {
23-
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0 : var.scheduler_job
23+
value = length(google_cloud_scheduler_job.job) > 0 ? google_cloud_scheduler_job.job.0 : null
2424
description = "The Cloud Scheduler job instance"
2525
}
2626

variables.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ variable "time_zone" {
151151
}
152152

153153
variable "scheduler_job" {
154-
type = any
154+
type = object({ name = string })
155155
description = "An existing Cloud Scheduler job instance"
156156
default = null
157157
}

0 commit comments

Comments
 (0)