-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Default (optional) values in nested null object cause it to be non-null #32160
Copy link
Copy link
Closed
Labels
bugconfigconfirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issue
Description
Terraform Version
Terraform v1.3.4Terraform Configuration Files
module "defaulting_module" {
source = "./modules/default-module"
request = {}
}
output "output" {
value = module.defaulting_module
}variable "request" {
type = object({
thing = optional(object({
flag = optional(bool, false)
}))
})
}
output "request" {
value = var.request
}Debug Output
Changes to Outputs:
+ output = {
+ request = {
+ thing = {
+ flag = false
}
}
}
Expected Behavior
thing should be null
Actual Behavior
thing is non-null and contains defaulted values
Steps to Reproduce
terraform plan
Additional Context
Output in TF 1.3.3 matched expected results. Changed in 1.3.4
References
No response
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugconfigconfirmeda Terraform Core team member has reproduced this issuea Terraform Core team member has reproduced this issue