-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Make Terminate force=True
work with Stop Protection
#7598
Make Terminate force=True
work with Stop Protection
#7598
Conversation
@ijrsvt - could you please complete the EasyCLA when you get a chance? There's a link in the comment from the cla bot. |
FYI - those lint failures aren't due to anything you added. Looks like they're subtly wrong bits of code that pycodestyle started flagging in its latest version. Opened #7600 to track that. |
@ajkerrigan CLA signed! |
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.
This looks good to me, thanks for the thorough investigation with new & old botocore versions too 👍 .
One lingering question before merging this (@thisisshi @kapilt @darrendao may have thoughts): this effectively doubles the modify attribute calls for any policy that uses |
ideally we parse the failure to identify the instance and remove from the set, as it does feel like it would only be a fraction of the set in common case. |
@kapilt Is there any existing logic for that in cloud-custodian? I'm unsure of the stability of AWS error message strings. |
@kapilt I also noticed that the call to terminate instances[1] does not actually batch. I could add a function like[2] to only call disable termination protection on the instances in the batch that fails with [1] cloud-custodian/c7n/resources/ec2.py Line 1544 in d91b6c4
[2]
|
I'm okay with the merge as is, since it matches extant behavior of the implementation, but it would be nice as a separate pr to convert this to doing the disable on exception to minimize api calls. |
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, thanks
Closes #7597