# module/main.tf
variable "lists" {
type = list(string)
default = []
}
variable "sets" {
type = map(string)
default = {}
}
output "lists" {
value = var.lists
}
output "sets" {
value = var.sets
}
dolan@Dolans-MacBook-Pro repro-terragrunt-null-thing % terragrunt --version
terragrunt version v0.65.0
dolan@Dolans-MacBook-Pro repro-terragrunt-null-thing % terragrunt plan
No changes. Your infrastructure matches the configuration.
OpenTofu has compared your real infrastructure against your configuration and
found no differences, so no changes are needed.
The module is getting null for both variables.
Expected behavior
It works correctly in 0.64:
dolan@Dolans-MacBook-Pro repro-terragrunt-null-thing % terragrunt --version
terragrunt version v0.64.0
dolan@Dolans-MacBook-Pro repro-terragrunt-null-thing % terragrunt plan
Changes to Outputs:
+ lists = []
+ sets = {}
You can apply this plan to save these new output values to the OpenTofu
state, without changing any real infrastructure.
Environment details (Ubuntu 20.04, Windows 10, etc.): Darwin Dolans-MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
Additional context
It also works correctly in OpenTofu and Terraform:
# example.tfvars
lists = []
sets = {}
dolan@Dolans-MacBook-Pro module % tofu init && tofu plan -var-file ../example.tfvars
Initializing the backend...
Initializing provider plugins...
OpenTofu has made some changes to the provider dependency selections recorded
in the .terraform.lock.hcl file. Review those changes and commit them to your
version control system if they represent changes you intended to make.
OpenTofu has been successfully initialized!
You may now begin working with OpenTofu. Try running "tofu plan" to see
any changes that are required for your infrastructure. All OpenTofu commands
should now work.
If you ever set or change modules or backend configuration for OpenTofu,
rerun this command to reinitialize your working directory. If you forget, other
commands will detect it and remind you to do so if necessary.
Changes to Outputs:
+ lists = []
+ sets = {}
You can apply this plan to save these new output values to the OpenTofu state, without changing any real infrastructure.
Apologies; I believed that I had verified this behavior on the latest (0.67.0) but I must be mistaken as it's working now. Since this is a dup of #3312 and fixed in 0.66.1 I'll close it now.
Describe the bug
In terragrunt 0.65.0 and later, an empty set or empty list in the terragrunt
inputs
block is passed to the module as anull
.Steps To Reproduce
Steps to reproduce the behavior, code snippets and examples which can be used to reproduce the issue.
The module is getting
null
for both variables.Expected behavior
It works correctly in 0.64:
Nice to haves
Versions
Darwin Dolans-MacBook-Pro.local 23.5.0 Darwin Kernel Version 23.5.0: Wed May 1 20:12:58 PDT 2024; root:xnu-10063.121.3~5/RELEASE_ARM64_T6000 arm64
Additional context
It also works correctly in OpenTofu and Terraform:
And similar on Terraform.