-
Notifications
You must be signed in to change notification settings - Fork 9.2k
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
Reapply changes to avoid destroying instance on user_data updates #18043
Reapply changes to avoid destroying instance on user_data updates #18043
Conversation
Can someone take a look? |
Checking in again :) |
Ping again. :). Anyone home? |
@anGie44 @bflad @YakDriver if you have a chance |
please take a look at this PR , waiting long time for this |
Hello.. when can we expect this ? thanks! |
@bflad @YakDriver @hashicorp-cloud Any chance to review this enhacement? |
Hello @ewbankkit, Thanks for your time. |
Pull request #21306 has significantly refactored the AWS Provider codebase. As a result, most PRs opened prior to the refactor now have merge conflicts that must be resolved before proceeding. Specifically, PR #21306 relocated the code for all AWS resources and data sources from a single We recognize that many pull requests have been open for some time without yet being addressed by our maintainers. Therefore, we want to make it clear that resolving these conflicts in no way affects the prioritization of a particular pull request. Once a pull request has been prioritized for review, the necessary changes will be made by a maintainer -- either directly or in collaboration with the pull request author. For a more complete description of this refactor, including examples of how old filepaths and function names correspond to their new counterparts: please refer to issue #20000. For a quick guide on how to amend your pull request to resolve the merge conflicts resulting from this refactor and bring it in line with our new code patterns: please refer to our Service Package Refactor Pull Request Guide. |
683de20
to
4137c27
Compare
internal/service/ec2/instance.go
Outdated
@@ -1719,12 +1680,86 @@ func resourceInstanceUpdate(d *schema.ResourceData, meta interface{}) error { | |||
} | |||
} | |||
|
|||
if shouldStopInstanceForUpdate { |
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.
unfortunately we'll need to update attributes individually as the API will return an error such as
InvalidParameterCombination: Fields for multiple attribute types specified: instanceType,userData
050fe62
to
05903dd
Compare
05903dd
to
e53957f
Compare
e53957f
to
d4fee8f
Compare
Output of acceptance tests:
|
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.
Thank you again @rogerhu , LGTM 🚀
…-instance-args docs/ec2/instance: add stop/start behavior related to changes in #18043
This functionality has been released in v4.2.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
Is there a way to opt-out of this behavior change? I (as I'm sure many) have been relying on instances being destroyed/created when the user data changes, to result in an instance with the given user data executed. This is a breaking change to me. |
This is causing tons of problems in our CI/CD pipelines where changes in user data are NOT forcing a replacement. This change should be only for people that do NOT have idempotent infrastructure and should be a FLAG. @anGie44 @rogerhu This issue has been opened and the workaround is to use an older version of this provider. #23315 |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Reapplying changes from #16011 to address #23
This change will update user_data/user_data_base64 and reboot the instance instead of destroying the instance.
The code that deals with shutting down the instance and updating the attributes is consolidated into one function.
Relates to #16011 and #7863
Closes #23
Output from acceptance testing: