-
Notifications
You must be signed in to change notification settings - Fork 9.5k
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
helper/schema: Do not collapse TypeSet hash values when configuration block contains only Computed attributes #22719
Conversation
… block contains only Computed attributes Reference: hashicorp/terraform-provider-aws#7198 When a resource schema contains the following: ```go "config_block_attribute": { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "attribute1": { Type: schema.TypeBool, Computed: true, }, "attribute2": { Type: schema.TypeString, Computed: true, }, }, }, }, ``` The TypeSet hash values were previously all collapsed to the zero-value, which meant that multiple set entries were lost. Here we check that all of the attributes are not just `Computed: true`. If they are all `Computed: true` attributes, ignore the check for user-defined attributes to compute the hash value.
Hi @bflad! What's your sense of the urgency of this? My preference would be to wait until the SDK split is complete and then reopen this in the separate SDK repository, just to minimize migration friction this might otherwise cause. |
Hey @apparentlymart 👋 I believe low urgency in at least in the AWS Provider as the amount/places where this is currently affecting things is not high/critical in nature. I’m okay duplicating this pull request over although there is a plan to automatically migrate commits as well. 👍 Either which way works well though in this case. Thanks! |
Thanks for the PR @bflad I agree with the sentiment here - unless it's really burning I'd prefer to keep this open at least until we publish the SDK 1.0.0 and make this part of |
… block contains only Computed attributes Reference: hashicorp/terraform-provider-aws#7198 Reference: hashicorp/terraform-provider-aws#10045 Reference: hashicorp/terraform-provider-aws#10339 Reference: hashicorp/terraform#22719 When a resource schema contains the following: ```go "config_block_attribute": { Type: schema.TypeSet, Computed: true, Elem: &schema.Resource{ Schema: map[string]*schema.Schema{ "attribute1": { Type: schema.TypeBool, Computed: true, }, "attribute2": { Type: schema.TypeString, Computed: true, }, }, }, }, ``` The TypeSet hash values were previously all collapsed to the zero-value, which meant that multiple set entries were lost. Here we check that all of the attributes are not just `Computed: true`. If they are all `Computed: true` attributes, ignore the check for user-defined attributes to compute the hash value.
Closing in preference of hashicorp/terraform-plugin-sdk#197 |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
Reference: hashicorp/terraform-provider-aws#7198
When a resource schema contains the following:
The TypeSet hash values were previously all collapsed to the zero-value, which meant that multiple set entries were lost. Here we check that all of the attributes are not just
Computed: true
. If they are allComputed: true
attributes, ignore the check for user-defined attributes to compute the hash value.