validate bundle, use pathexpand in cloud function modules (#2360)

This commit is contained in:
Ludovico Magnocavallo
2024-06-14 09:23:49 +02:00
committed by GitHub
parent cb5b36906c
commit ea5e6dedc9
6 changed files with 93 additions and 61 deletions

View File

@@ -48,6 +48,18 @@ variable "bundle_config" {
excludes = optional(list(string))
output_path = optional(string)
})
validation {
condition = (
var.bundle_config.path != null && (
(
try(fileexists(pathexpand(var.bundle_config.path)), null) != null &&
endswith(var.bundle_config.path, ".zip")
) ||
length(fileset(pathexpand(var.bundle_config.path), "**/*")) > 0
)
)
error_message = "Bundle path must be set to a local folder or zip file."
}
}
variable "description" {