Logging EC2 power state before maintenance window, then return to that state

0

Hello All, I need to patch EC2 instances that are currently powered down and return them to this state after patching. I'm trying to figure out if there is an easy way to track the power state of an EC2 instance before starting it for a maintenance window. I know maintenance windows automation tasks can power on and power off EC2 instances, but how would it keep track of an instances state so I can return it to that state after the maintenance window is over? After googleing for days, I've read a few people suggesting you can trigger a lambda function to run first and tag your instances with a state tag, once your maint window is over, you run another lamba that captures all instances with the tag state of say "powerOffWhenDone" and you then power them off and remove the tag. Can anybody suggest any other methods their currently using? I cant find much in regards to this topic.

已提问 2 年前278 查看次数
2 回答
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

Kal
已回答 1 年前
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.

Kal
已回答 1 年前

您未登录。 登录 发布回答。

一个好的回答可以清楚地解答问题和提供建设性反馈,并能促进提问者的职业发展。

回答问题的准则