-
Notifications
You must be signed in to change notification settings - Fork 106
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
Clean up orphaned instances and security groups (HMS-3632) #4513
Clean up orphaned instances and security groups (HMS-3632) #4513
Conversation
63f34e1
to
3103a97
Compare
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.
In general we don't put the jira ticket in the commit message itself, just the PR title.
edit: woops clicked review too soon, still reviewing.
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.
thanks, looks good overall
Could you reword this commit message though?
Usually the parent does not exist when also the secure instance is
older than 2h, but this an extra safeguard that secure instances
without a valid parent instance does not make sense to keep.
And then the jira tickets tend to just go in the PR descriptions.
I think they should be part of the commit message |
ba65a81
to
7684e9e
Compare
b1456a2
to
94492ab
Compare
Support running the maintenance locally with a valid `~/aws/credentials` file. HMS-3632
94492ab
to
fa02bac
Compare
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.
Thanks for working on this - quick drive-by comments/suggestions (purely on the tactical level :)
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.
other than @mvo5's comments lgtm :)
f4d001a
to
ca3c904
Compare
Add a safeguard to ensure secure instances without valid parent instances are terminated, as they are unnecessary to retain. Typically, the parent does not exist if the secure instance is older than 2 hours, but this check provides additional validation. HMS-3632
Security groups of instances that are terminated should be removed. HMS-3632
Launch templates of instances that are terminated should be removed. HMS-3632
Passing an empty list to `TerminateInstances` causes an error message, which is not necessary, as there is nothing to terminate.
Collect and merge errors, instead of nesting errors. In this case we want to continue execution if only one cleanup fails.
ca3c904
to
cae703a
Compare
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, ty!
This pull request includes:
Implement removal of orphaned items as described in https://issues.redhat.com/browse/HMS-3632
removal of launch templates is not yet implemented (that's why it's a draft for now)