RobbiewOnline
RobbiewOnline

Reputation: 1370

How to deal with AWS EC2 instance retirement when using Elastic Beanstalk

I have received an email from AWS that states

We have important news about your account (AWS Account ID: XXXXX). EC2 has detected degradation of the underlying hardware hosting your Amazon EC2 instance (instance-ID: i-XXXX) in the eu-west-1 region. Due to this degradation, your instance could already be unreachable. After 2017-05-25 10:00 UTC your instance, which has an EBS volume as the root device, will be stopped.

I'm actually using Elastic Beanstalk with a load balancer with an elastic IP address on what is currently the only instance running (manually associated). In addition I have a reverse DNS for email purposes.

The email continues to say the following...

You may still be able to access the instance. We recommend that you replace the instance by creating an AMI of your instance and launch a new instance from the AMI. For more information please see Amazon Machine Images (http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) in the EC2 User Guide. In case of difficulties stopping your EBS-backed instance, please see the Instance FAQ (http://aws.amazon.com/instance-help/#ebs-stuck-stopping).

So how do I get Elastic Beanstalk to re-provision to new hardware?

Some options seem to be...

rebuild environment

save configuration -> terminate -> load configuration

clone environment -> manually change DNS -> Terminate old environment

'Terminate'environment -> 'Restore terminated environment'?

I'm not sure which variant would restore the environment, in particular it would be ideal if I don't loose the hostname / reverse DNS stuff that was done for email (SNS?) configuration.

It would be nice if I kept all of this (I don't care about the EC2 instance or data - the data is held in MongoDb external to all of this) ...

Thoughts would be appreciated! - It's a shame their email / documentation only discusses EC2 and not beanstalk configurations.

Upvotes: 4

Views: 2431

Answers (1)

Mark B
Mark B

Reputation: 200722

Just terminate the instance and let Elastic Beanstalk automatically spin up a new one. Any changes you are making to your EC2 instances in your beanstalk environment should be done through .ebextensions configuration files (you aren't making changes directly over ssh, right?) so you don't need to worry about "saving" your EC2 setup via creating an AMI.

As for all the items you listed that you need to save, those are all part of the EB environment configuration, not part of the EC2 instance that is being retired.

A load balanced Elastic Beanstalk environment is configured to terminate and create new EC2 instances as needed. There's no need to completely rebuild/replace your entire EB environment just because you need to replace one of the EC2 instances.

Upvotes: 5

Related Questions