While trying out the new module_variable_optional_attrs experiment, I ran into this issue with nested optional attributes. The exact same thing works if I explicitly set the optional_attr to null, and remove the experiment.
Terraform Version
Terraform Configuration Files
Please see the minimal github repo here
There are two examples in the repo. working-without-optional and broken-with-optional. They are identical except the broken example attempts to remove the explicit optional_attr = null using the optional type.
Debug Output
See the debug output in the repo here
Crash Output
See the crash.log in the repo here
Expected Behavior
The two examples should behave exactly the same way. The optional_attr should be implicitly set to null in the broken-with-optional example, and pass tf plan.
Actual Behavior
Terraform panics and crashes.
Steps to Reproduce
git clone https://github.com/bsch150/terraform-14.2-optional-issue.git
cd broken-with-optional
terraform init
terraform plan
While trying out the new
module_variable_optional_attrsexperiment, I ran into this issue with nested optional attributes. The exact same thing works if I explicitly set the optional_attr to null, and remove the experiment.Terraform Version
Terraform Configuration Files
Please see the minimal github repo here
There are two examples in the repo.
working-without-optionalandbroken-with-optional. They are identical except the broken example attempts to remove the explicitoptional_attr = nullusing theoptionaltype.Debug Output
See the debug output in the repo here
Crash Output
See the crash.log in the repo here
Expected Behavior
The two examples should behave exactly the same way. The optional_attr should be implicitly set to null in the broken-with-optional example, and pass
tf plan.Actual Behavior
Terraform panics and crashes.
Steps to Reproduce