0

I have configured PuTTY for accessing my instances as described in the instruction. I have set the hostname as it's displayed in my instance dashboard - everything works great. But when I restart my instance, it's public IP address (as well as public DNS) is different (AFAIU they are being rearranged each time the instance restarts). So I have to reconfigure my connection in PuTTY. Is there any way to get some constant configuration that will work regardless changing IP address?

P.S.: I know that Elastic IP's are the solution, but I'm interested in some other options.

2 Answers 2

1

Package your app inside Docker container and re-start docker container inside host machine if needed. There is Docker support in Elastic Beanstalk service, so you don't have to worry about installing and configuring Docker. So typical flow for working directly with service is

  1. Spin up new Beanstalk instance (which is actually EC2 with pre-installed software)
  2. Deploy hello-world image to it, or use your own.
  3. Connect using SSH into EC2 instance.
  4. sudo su
  5. docker ps
  6. And so on...

However, there is some non-obvious feature using Beanstalk as by default your app will be exposed to external world on 80 port using pre-installed nginx and you have to reconfigure nginx a bit if you don't want to expose 80 port. But actually you will achieve a full power of deploy automation available with Beanstalk.

1
  • Good point, Docker with Elastic Beanstalk may do the trick, thanks. Sep 25, 2015 at 9:24
0

I see no reason why not to use Elastic IP - it is free and easy to setup.

Another option would be using dynamic DNS but you will need to be able to execute a some sort of a script upon instance startup (internally or externally). We used setup like this in the past for our internal addresses but eventually migrated to VPC. DNSMadeEasy supports this feature, there are plenty of scripts available and it is easy to write your own.

2
  • Actually, you have to pay for time when your instances are down when using Elastic IPs (you can check pricing policy). And my instances might be down for a while. That's why I'm looking for another options. Sep 24, 2015 at 20:16
  • It's $0.005 per hour the instance isn't running, or $3.75/month, worst case, for an idle Elastic IP. Sep 24, 2015 at 22:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.