Auto start an EC2 instance 5 minutes after it auto shuts due to an alarm

0

An alarm has been set on our EC2 instance to auto shut if "idle" for a certain time period (based on CPU utilization). Is there a way to auto start the instance, say 5 minutes after it auto shuts due to the alarm?

4 Antworten
0

It would probably be a better idea to just exclude the instance from the alarm to begin with. You can also shut off the alarm. Unless the idle CPU is an indication of a system problem in that case you may want to handle that a different way. Ex: Auto scaling group with health check.

Evan
beantwortet vor einem Jahr
0

You can build a solution using DynamoDB and lambda.Log all the instanceid's,state and shutdowntime and trigger the lambda to take action as needed. Note : Also consider shutting down the services running inside the EC2 gracefully to avoid data inconsistency and corruption.

beantwortet vor einem Jahr
0

Thank you @rePost-User-6379467 and @Evan for your replies

UserAB
beantwortet vor einem Jahr
0

Assuming this is really what you need, you can set an EventBridge rule that will catch the instance terminated events. This event can create an EventBridge schedule for 5 minutes from now that will start the instance.

profile pictureAWS
EXPERTE
Uri
beantwortet vor einem Jahr

Du bist nicht angemeldet. Anmelden um eine Antwort zu veröffentlichen.

Eine gute Antwort beantwortet die Frage klar, gibt konstruktives Feedback und fördert die berufliche Weiterentwicklung des Fragenstellers.

Richtlinien für die Beantwortung von Fragen