Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Acceptance coverage is missing for the new update and lifecycle behavior.
Get a fresh assessment by requesting another Copilot review.
Pull request overview
This pull request enables in-place instance security-group updates while preserving stopped-state behavior.
Changes:
- Removes
ForceNewfrom security-group attributes. - Adds stop, update, and restart lifecycle handling.
- Updates instance documentation.
File summaries
| File | Summary | Review note |
|---|---|---|
website/docs/r/instance.html.markdown |
Documents the updated behavior. | None |
cloudstack/resource_cloudstack_instance.go |
Implements in-place security-group updates and lifecycle handling. | Moderate: add acceptance coverage for security-group updates and restart-state behavior (3 votes). |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 1
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
+859
to
+864
| // Update security groups once, even when switching between names and IDs. | ||
| if d.HasChange("security_group_ids") || d.HasChange("security_group_names") { | ||
| p := cs.VirtualMachine.NewUpdateVirtualMachineParams(d.Id()) | ||
| ids := d.Get("security_group_ids").(*schema.Set) | ||
| names := d.Get("security_group_names").(*schema.Set) | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addition makes it so
security_group_idsandsecurity_group_namesattributes passed to instances do not require recreation of the resource. Instead it will (per official support) temporarily shut down the instance, apply these changes, and restart it after.It will attempt to restart the instance regardless on if the state change was successful or not. Previously stopped instances will not be restarted.