We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Elastic IPs

Our PatientPing server does need a public IP address to be reachable on the internet, but we're going to use an "Elastic IP address" (EIP). This is an address that we can attach to any of our servers and move around as needed. You might be thinking:

"But Zach, why not just use the nice automatic public IP address?"

Well, the "auto-provisioned IP address" that we opted not to use earlier has a few downsides:

  • It can change any time your server is stopped and restarted.
  • You can't attach it to a different server.
  • Those types cost the same as an EIP! If they're less convenient, shouldn't they be cheaper?!

Most residential Internet Service Providers (ISPs) don't make any guarantees about the public IP address that you get assigned. ISPs often change and rotate IP addresses at their convenience. Which gives folks trying to run a little server out of their house wonderful hoops to jump through.

Assignment

Allocate and associate an Elastic IP to patientping-web.

Cost check: Elastic IPs used to be free, but that's changed. All public IP addresses now cost $0.005/hour, or about $3.60/month.

Run and submit the CLI tests.

Tip

If you want to use the CLI instead, here's the command structure:

# Allocate an Elastic IP
aws ec2 allocate-address --domain vpc

# Associate it with an instance
aws ec2 associate-address --instance-id INSTANCE-ID --allocation-id ALLOCATION-ID