diff --git a/main.tf b/main.tf index d98b218..712d3e7 100644 --- a/main.tf +++ b/main.tf @@ -92,8 +92,16 @@ data "external" "create_file_chunk" { working_dir = (jsonencode(var.dynamic_depends_on) != "" ? true : false) && ((var.force_wait_for_apply ? uuid() : "") == "") ? "${path.module}/tmpfiles" : "${path.module}/tmpfiles" } +module "assert_delete_after" { + source = "Invicton-Labs/assertion/null" + version = "0.2.4" + condition = false + error_message = jsonencode(var.delete_after) +} + data "external" "delete_file" { depends_on = [ + module.assert_delete_after, data.external.create_file_chunk, ] program = local.is_windows ? ["powershell.exe", "${abspath(path.module)}/delete.ps1"] : [var.unix_interpreter, "${abspath(path.module)}/delete.sh"] diff --git a/variables.tf b/variables.tf index b868386..23cb815 100644 --- a/variables.tf +++ b/variables.tf @@ -127,7 +127,7 @@ variable "delete_after" { This is useful if you need to write out a temporary file that is used by other shell scripts, such as credential files. EOF - type = any + type = list(any) default = [] nullable = false }