-
Notifications
You must be signed in to change notification settings - Fork 114
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
random_password Showing Unexpected Plan 3.3.2 to 3.4.2 #306
Comments
Same behavior observed this morning for |
imported from forcing a destroy-create on next terraform apply (#306)
Same problem with random_string |
… from 3.3.2 Reference: #306 This fixes the `override_special` attribute issues by removing `Computed: true` and the empty string default value plan modifier (this attribute's value should always come from the practitioner) and resolves the underlying issue of always reading `plan.OverrideSpecial.Value` into the state, which will never be correct for null configurations. For any environment that happened to upgrade to 3.4.2 and save the empty string into state, the replacement plan modifier will allow in-place modification from empty string (`""`) to `null`. Previously after removing `Computed: true` and default value plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` Previously before adjusting requires replace plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got :i$(*K3_Vinv and FSw{$8sB#Uc3 === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got VrNYb]{#Z2Xu and XZD#_<BjDhkH ```
Any solution/suggestion on the same? I'm also facing the same issue after upgrading the terraform azurerm version (v3.0.0). |
…erences upgrading from 3.3.2 (#312) Reference: #306 This fixes the `override_special` attribute issues by removing `Computed: true` and the empty string default value plan modifier (this attribute's value should always come from the practitioner) and resolves the underlying issue of always reading `plan.OverrideSpecial.Value` into the state, which will never be correct for null configurations. For any environment that happened to upgrade to 3.4.2 and save the empty string into state, the replacement plan modifier will allow in-place modification from empty string (`""`) to `null`. Previously after removing `Computed: true` and default value plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Error running apply: exit status 1 Error: Provider produced inconsistent result after apply When applying changes to random_password.test, provider "provider[\"registry.terraform.io/hashicorp/random\"]" produced an unexpected new value: .override_special: was null, but now cty.StringVal(""). This is a bug in the provider, which should be reported in the provider's own issue tracker. ``` Previously before adjusting requires replace plan modifier: ``` === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_3_2 resource_password_test.go:221: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got :i$(*K3_Vinv and FSw{$8sB#Uc3 === CONT TestAccResourcePassword_OverrideSpecial_FromVersion3_4_2 resource_password_test.go:255: Step 2/2 error: Check failed: Check 3/3 error: attribute values are different, got VrNYb]{#Z2Xu and XZD#_<BjDhkH ```
@SaravananGuru pinning to
|
@bflad and @lucascantor thank you for the update. Even if it updates the ID to null technically its internal terraform value does not reset the value of the random password result. so, I have safely ignored and applied the plan. It working fine as expected. |
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. |
Terraform CLI and Provider Versions
Terraform v1.2.7
on darwin_arm64
Terraform Configuration
Expected Behavior
No plan difference.
Actual Behavior
Steps to Reproduce
terraform apply
How much impact is this issue causing?
Medium
Logs
No response
Additional Information
May be related to small change in #305 where
override_special
was having issues with framework migration testing and the fix seemed to be adding a default value plan modifier oftypes.String{Value: ""}
. Here's the state difference after the odd plan output:Potentially removing
Computed
and removing the default value plan modifier can fix this.Code of Conduct
The text was updated successfully, but these errors were encountered: