DEV Community

Discussion on: Simple EC2 Stopinator in Lambda

Collapse
 
rosswilliams profile image
rosswilliams

I’d scope down the IAM role in Type 1. Adding a condition to only allow termination of instances with certain tags makes this a lot safer.

Collapse
 
aws_john profile image
John Rotenstein

Yes, that's an interesting idea. Effectively it's limiting the Lambda function to only do what it's meant to do, so the role can't be used to stop/terminate other instances. Of course, this then needs limitations on who can edit Tags.

I'll admit I was lazy — I made one IAM Role that would work with both Stopinators, but it should be scoped-down to be safer.