-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
provider/aws: fix force_delete on ASGs #3485
Conversation
@@ -414,6 +407,11 @@ func getAwsAutoscalingGroup( | |||
func resourceAwsAutoscalingGroupDrain(d *schema.ResourceData, meta interface{}) error { | |||
conn := meta.(*AWSClient).autoscalingconn | |||
|
|||
if d.Get("force_delete").(bool) { | |||
log.Printf("[DEBUG] Skipping ASG drain, force_delete was set.") |
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.
nitpick, force_delete
may not have been set since it now has a default
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.
Not sure what you mean - it's true
if we get to line 411. Is it just the log wording you'd like changed?
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.
nope, ignore me I misread that
5e87f5a
to
5338427
Compare
LGTM |
The `ForceDelete` parameter was getting sent to the upstream API call, but only after we had already finished draining instances from Terraform, so it was a moot point by then. This fixes that by skipping the drain when force_delete is true, and it also simplifies the field config a bit: * set a default of false to simplify the logic * remove `ForceNew` since there's no need to replace the resource to flip this value * pull a detail comment from code into the docs
5338427
to
a811a72
Compare
provider/aws: fix force_delete on ASGs
I still seem to be getting blocked on ASG deletion: https://gist.github.com/maratoid/faa8262aed30400a69f2 Output:
|
Thanks for testing @maratoid - reproduced locally and digging in... |
Much appreciated. |
BTW, should I open a tracking issue, or is the conversation in here sufficient? |
@maratoid turned into a bit of a rabbit hole - i will open a fresh issue 👍 🐰 |
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. |
The
ForceDelete
parameter was getting sent to the upstream API call,but only after we had already finished draining instances from
Terraform, so it was a moot point by then.
This fixes that by skipping the drain when force_delete is true, and it
also simplifies the field config a bit:
ForceNew
since there's no need to replace the resource toflip this value