Anton Khodak
Anton Khodak

Reputation: 3696

Why was my ec2-instance terminated by elastic-beanstalk?

I have an EC2-instance inside Elastic Beanstalk environment, which was terminated for reasons unknown. The only information I possess is state transition reason

Client.UserInitiatedShutdown: User initiated shutdown. 

I use this environment alone and I am sure that I haven't initiated shutdown by myself, so this must be EB.

In events there is only one record: instance 'i-6252b1a3' has been removed from your environment. There is no mention of terminating this instance in EB logs too. How can I else get information why this instance was terminated?

Upvotes: 5

Views: 8441

Answers (2)

Maddy Anand
Maddy Anand

Reputation: 156

It happens when you reached your Elastic Block Store (EBS) volume limit, especially when its the free-tier server. The error can be misleading as it says:

user initiated shutdown

See "What To Do If An Instance Immediately Terminates" for more information about diagnosing instance termination.

AWS CloudTrail helps but if its not set up to monitor the instance shutdown it will not give you any details.

If monitoring has not been set up in your EC2 dashboard, no alarms set up to recover during a monitoring failure then there is no way of recovering a terminated server.

If you have created a snapshot you can restore it or if the server has already been terminated you may create a new instance from the backup.

This way you dont have to change your server app but the mobile and other apps that use the webservice/api.

Upvotes: 9

DanH
DanH

Reputation: 492

Try looking into your AWS CloudTrail Logs

AWS CloudTrail is a web service that records AWS API calls for your account and delivers log files to you. The recorded information includes the identity of the API caller, the time of the API call, the source IP address of the API caller, the request parameters, and the response elements returned by the AWS service.

https://aws.amazon.com/cloudtrail/

You willbe able to find out who is making the call to terminate your instance.

Upvotes: 0

Related Questions