quinta-feira, 2 de fevereiro de 2017

Amazon EC2: Definir IP estático

Fonte: https://pragmaticintegrator.wordpress.com/2012/12/13/assign-a-fixed-ip-to-aws-ec2-instance/


Assign a fixed IP to AWS EC2 instance

As described in my previous post the IP (and DNS) of your running EC2 AMI will change after a reboot of that instance. Of course this makes it very hard to make your applications on that machine available for the outside world, like in this case our WordPress blog. That is where Elastic IP comes to the rescue. With this feature you can assign a static IP to your instance. 
Assign one to your application as follows:
  • Click on the Elastic IPs link in the AWS Console
  • Screen Shot 2012-12-11 at 12.57.17
  • Allocate a new address
  • Screen Shot 2012-12-11 at 12.46.40
  • Associate the address with a running instance
  • Right click to associate the IP with an instance:
    Screen Shot 2012-12-11 at 12.48.44
    Pick the instance to assign this IP to:
    Screen Shot 2012-12-11 at 12.48.22
  • Note the IP being assigned to your instance
  • Screen Shot 2012-12-11 at 12.49.50
If you go to the IP address you were assigned then you see the home page of your server:
Screen Shot 2012-12-11 at 12.50.16
And the nicest thing is that if you stop and start your instance you will receive a new public DNS but your instance is still assigned to the elastic IP address:
Screen Shot 2012-12-11 at 12.54.25
One Important Note: As long as an Elastic IP address is associated with a running instance, there is no charge for it. However an address that is not associated with a running instance costs $0.01/hour. This prevents users from ‘reserving’ addresses while they are not being used.

Nenhum comentário:

Postar um comentário