4

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) ...

  • EC2 configuration (i.e. hardware box size, VM parameters etc)
  • Security Groups
  • Load balancer
  • Elastic IP associated to EC2 (easy enough to do manually after)
  • Hostname (whatever is required for the reverse DNS)

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

RobbiewOnline
  • 1,350
  • 1
  • 16
  • 36

1 Answers1

5

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.

Mark B
  • 183,023
  • 24
  • 297
  • 295
  • Thanks @Mark B, No changes via SSH ;-), just that I currently manually assigned the elastic IP to the EC2 instance as I wasn't sure how to do that via .ebextensions, especially if I had say 4 instances through the load balancer and I wanted a fixed IP for each... why? I think it was because I wanted to do some SNS stuff and needed each node to have a static IP, probably not required any more. – RobbiewOnline May 09 '17 at 17:00
  • To be clear @MarkB do you mean go to the ec2 section and terminate that specific EC2 instance, not terminate the Elastic Beanstalk environment itself!? – RobbiewOnline May 09 '17 at 17:12
  • @DevologyLtd Yes, terminate the ec2 instance and *not* the EB environment. – Brian May 09 '17 at 18:07
  • Yes, just the EC2 instance. You just need to replace this one specific EC2 instance. – Mark B May 09 '17 at 19:52