-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
azurerm_shared_image_version
- target_region.x.storage_account_type
is now defaulted and multiple target_region
s can be added/removed
#6940
azurerm_shared_image_version
- target_region.x.storage_account_type
is now defaulted and multiple target_region
s can be added/removed
#6940
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @neil-yechenwei, this fixes part of your linked issue but we are still missing a piece. We'll want to remove the ForceNew: true
and add a CustomizeDiff
that checks to see if the old/new key being passed in aren't empty and aren't the same. If they aren't the same then we have to ForceNew
the resource.
@mbfrahry , "ValidateFunc" would check if the input value is empty. So I think we don't need to add additional logic to validate, right? And "ForceNew: true" would check if old value and new value are different. If it's different, it would recreate the resource. So may I know why I have to remove "ForceNew: true" and add "CustomizeDiff" to do the same thing? |
Hey @neil-yechenwei, no problem with the extra explanation. The reason I call out using a separate |
Hi @mbfrahry , I collated the rules.
Based on above rules, then I tried to remove forcenew attribute and use
|
Ok, I've just spent quite a bit of time playing with this and you're right that you won't get the correct behavior with I will note that your implementation will always ForceNew the resource if the number of CustomizeDiff won't work in a Set where a specific attribute needs to be So we have two options: We can just remove the |
@mbfrahry , thanks for your suggestion. I think using CustomizeDiff in a Set should be a common requirement in terraform. So I prefer your first option since I assume it should be supported/implemented in the future. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
azurerm_shared_image_version
- target_region.x.storage_account_type
is now defaulted and multiple target_region
s can be added/removed
…e` is now defaulted and multiple `target_region`s can be added/removed (hashicorp#6940)
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 feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error 🤖 🙉 , please reach out to my human friends 👉 [email protected]. Thanks! |
fixes #5569
Existing test case already covers this scenario. So no more test case needs to be added.