Marcel Al Mutawa
Marcel Al Mutawa

Reputation: 113

public ip changes randomly AWS ec2-instance

Im using AWS ec2-instance to run my website with a public ip of xxx.xxx.xxx.xx All php files were stored on this instance. Now for some reason I dont know how, the public ip changed to aaa.xxx.aaa.xx and all the files disappeared and everything got deleted. I never started/stopped the ec2 instance because this changes the public ip. This happened so randomly. Now I dont have recent updates of my php files so I need to rewrite them. I would assume amazon would send me an email saying that they would change our public ip.

Upvotes: 0

Views: 242

Answers (1)

Francis Eytan Dortort
Francis Eytan Dortort

Reputation: 1447

An auto-scaling group will launch instances as required to meet the number of instances expected. This can occur when scaling up or when an existing instance becomes unresponsive.

Newly launched instances will be created using the configured image. So if your configuration changes or app source code aren't part of the image they won't be present in the new instance.

If the contents of your instance doesn't change often, you can simple create a new image from an instance running your app and configure the auto-scaling group to use it as the image for new;y launched instances.

Another approach, using Elastic Beanstalk, is to create an application version, either as a bundle or using the EB CLI command eb deploy. The Elastic Beanstalk app can also include instructions on how to configure your instances. The app and its environment configuration will then be applied to any instance launched by Elastic Beanstalk.

Upvotes: 1

Related Questions