2 Respuestas
- Más nuevo
- Más votos
- Más comentarios
0
Hello. Just come across your post. I'm looking for the same solution. Did you eventually go for the lambda method that records the instance state as a tag? Thanks
respondido hace un año
0
Thanks for the reply. Yes the pshell method sounds like an easier option. I'm more comfortable with powershell than Lambda, so will try that. Thanks again for your help.
respondido hace un año
Contenido relevante
- OFICIAL DE AWSActualizada hace 3 años
- OFICIAL DE AWSActualizada hace 3 meses
- OFICIAL DE AWSActualizada hace un año
Hey Kal, I couldn't find anything much on the internet besides suggesting lambda BUT I stumbled upon Systems Manager > Automation .. Which allows you to write "documents", these documents can execute a script or call AWS APIs and all other sorts of neat stuff. https://docs.aws.amazon.com/systems-manager/latest/userguide/systems-manager-automation.html
So what I ended up doing was creating an automation doc that executes a powershell script that finds all powered off EC2 instances, tags them then powers them on. You can then put this automation doc in a maintenance window that runs say monthly. After the instances are patched, you can trigger another doc that shutsdown instances and removes the tags. This method was pretty simple, i dont have much experience with lambda so this approach was much easier to build. I also did stumble upon this doc, which explains how to make a parent-child automation doc which i think will be my ultimate end goal so i can scrap the powershell.
https://docs.aws.amazon.com/systems-manager/latest/userguide/automation-authoring-runbooks-parent-child-example.html