-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to Unmarshal RawState to a type with OptionalAttributes #82
Comments
This is something we're working on. The problem here, basically, is that Terraform has a method of comparing types that terraform-plugin-go doesn't accurately reproduce: whether a type can be used as another type. Usually this means a concrete type filling a DynamicPseudoType, but I think (@terraform-core can correct me if I'm wrong) it also should let an Object without optional attributes be used as an Object with optional attributes. Optional attributes are really more schema information than they are information about values, I guess. So you're still going to need to set them to null in your provider code, etc. It's just that practitioners won't need to explicitly set them in their configs, unlike normal object attributes. We're resolving this by refactoring how we handle type comparisons a bit. Rather than a single overloaded
My hope is that by making these distinctions and updating tftypes to use the appropriate distinction in the appropriate place, we'll resolve this issue. Note that we're currently leaning towards you won't be able to create @bflad, feel free to shout if I missed anything. (Sorry everyone for the duplicate notifications, I commented on the wrong issue :( ) |
terraform-plugin-go version
Relevant provider source code
Terraform Configuration Files
Unrelated
Expected Behavior
The above script should not panic. Basically, I feel like should be able to use the same
tftypes.Type
to generate atftypes.Value
that I pass intoRawState.Unmarshal
when I expect the state to match.Actual Behavior
Steps to Reproduce
Run the supplied script
References
The text was updated successfully, but these errors were encountered: