0

I created an EC2 instance using Elastic Beanstalk and allocated Elastic IP to it.

All was working fine.

Below are the respective steps we took that resulted in the problem we are facing currently.

  1. We then decided to release the "Elastic-IP" as we no longer required it.

While the EC2 instance was running we "Released & Dissociated" the Elastic-IP address.

Our application stopped working.

  1. We then decided to create a new Elastic IP and associate it to the Running EC2 instance.

The application still did not work.

  1. We then decided to restart the EC2 instance.

When i clicked on stop the EC2 instance it strangely went to terminated state and a second new instance of EC2 spawned up automatically which went to Running state.

So, now we have two instances; one is Running state while other in terminated state.

I have two questions:

  1. Can you please explaining this behavior and why I was not able to simply stop and start a new EC2 instance with the newly created Elastic IP ? What we did wrong and what was the correct approach to doing this ?

  2. How can I go back to the same old state where i had my old Elastic IP and a single running EC2 instance which was created using Elastic Beanstalk running and the application functional.

Ashar
  • 2,942
  • 10
  • 58
  • 122

1 Answers1

0

Beanstalk thinks your instance crashed because the app was not removed. Go to Elastic Beanstalk menu in the console and remove your app from there before you terminate an instance else beanstalk will spawn new ones.

AliWieckowicz
  • 549
  • 1
  • 4
  • 17
  • But i never terminated the EC2 instance... I simply stopped it and wanted to start it thereafter. Also, what is the correct step-by-step procedure to assign a new elastic ip to Elastic Beanstalk's EC2 instance ? – Ashar May 13 '19 at 17:02
  • What do you mean the correct way? Are using using a load balancer? VPC? If use a cloud formation template to create your vpc with public subnets and an internet gateway you can do MapPublicIpOnLaunch: true. – AliWieckowicz May 13 '19 at 18:41
  • https://github.com/awsdocs/elastic-beanstalk-samples/blob/master/cfn-templates/vpc-public.yaml – AliWieckowicz May 13 '19 at 18:51
  • can you answer my question where I want to know & understand why did my Elastic Beanstalk EC2 instance went to terminated state instead of stopped state when I stopped it ? As of now as I see, it does not allow me to start that terminated instance. Any ideas ?? – Ashar May 14 '19 at 14:01