Error: Provider produced invalid plan - planned value cty.ListValEmpty(cty.String)
does not match config value cty.UnknownVal(cty.List(cty.String))
#160
Labels
bug
Something isn't working
Module version
Relevant provider source code
Terraform Configuration Files
Debug Output
https://gist.github.com/oscarhermoso/53849e90d66a97258ca2cb72906fe848
Expected Behavior
Terraform should plan succeed, with
binarylane_server_firewall_rules.example["tf-example-k8s-agent-2"].firewall_rules[0].destination_addresses
and similar planned as unknown valuesi.e.
GIVEN a resource schema with a list of objects attribute
AND one of the object properties is a list of strings
WHEN the list of strings property is planned with unknown length with unknown values
THEN the plan output should also have unknown length with unknown values
Actual Behavior
Steps to Reproduce
cd examples/k3s
terraform init
binarylane_server_firewall_rules.example
:BINARYLANE_API_TOKEN=anything TF_ACC=1 tf apply
Additional Context
Failing in https://github.com/oscarhermoso/terraform-provider-binarylane/blob/main/internal/provider/server_firewall_rules_resource.go
After adding logging in a ModifyPlan method, I can see that the raw Config has type
"destination_addresses":tftypes.List[tftypes.String]<unknown>
, whereas the raw Plan has type"destination_addresses":tftypes.List[tftypes.String]
.Logging
Considering the
terraform-provider-binarylane
priovider does not contain any code convertreq.Raw.Config
toreq.Raw.Plan
- my understanding is that either this is a bug with Terraform, or I need to add some code in aModifyPlan
method or similar to handle unknown values.Either way, would appreciate any assistance with investigating the issue. Thanks in advance.
References
cty.ListValEmpty(cty.String)
does not match config valuecty.UnknownVal(cty.List(cty.String))
terraform#35689The text was updated successfully, but these errors were encountered: