Skip to content
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

[IT-1729] A lambda to stop or terminate all EC2 instances in an account #1

Merged
merged 5 commits into from
Apr 17, 2024

Conversation

ConsoleCatzirl
Copy link
Member

A lambda to stop or terminate all EC2 instances in an account.

@ConsoleCatzirl
Copy link
Member Author

The error uploading to coveralls appears to be coverallsapp/coverage-reporter#119

@coveralls
Copy link

coveralls commented Apr 10, 2024

Coverage Status

coverage: 98.113% (-1.9%) from 100.0%
when pulling dcdf435 on jesusaurus:it-1729
into 1409b12 on Sage-Bionetworks-IT:master.

Comment on lines +22 to +24
AllowedValues:
- "STOP"
- "TERMINATE"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think cloudformation can check for case sensitivity therefore i think stop and terminate are also a valid inputs. If that's true then the python code needs to handle case insensitivity?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

am i missing something? I don't see any updates to handle case insensitivity.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change I made was calling .lower() inside set_instance_state so that casing is ignored at the time of processing.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ohh i see it now. i thought it would be done in lambda_handler right after reading in EC2_ACTION so that it's consistent throughout the app.

@ConsoleCatzirl ConsoleCatzirl requested a review from zaro0508 April 12, 2024 18:24
remove double-processing of EC2_ACTION env var and only rely on
processing the value in set_instance_state.
@ConsoleCatzirl ConsoleCatzirl merged commit 5861c0c into Sage-Bionetworks-IT:master Apr 17, 2024
4 checks passed
@ConsoleCatzirl ConsoleCatzirl deleted the it-1729 branch April 17, 2024 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants