DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Newsletter
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Related

  • Google Cloud KMS vs. AWS KMS: Java Encryption Guide
  • Multi-Agent Orchestration on AWS With AgentCore Runtime and A2A
  • AWS 7R Migration Strategies: A Decision Framework for Engineering Teams
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate

Trending

  • When a Coding Agent Fixes the Test Instead of the Bug
  • Introduction to Error Prone: How to Catch Bugs at Compile Time
  • Should Developers Switch From SQLite to DuckDB?
  • Member Spotlight: Shai Almong

Draft This article hasn't been published, so readers can't see it.

In moderation This article is waiting for review, so readers can't see it yet.

Deleted This article has been deleted, so readers can't see it.

  1. DZone
  2. Software Design and Architecture
  3. Cloud Architecture
  4. Assign a Fixed IP to an AWS EC2 Instance

Assign a Fixed IP to an AWS EC2 Instance

By 
Eric Genesky
·
Jan. 20, 13 · Interview
Post on X (opens in a new tab) Share on LinkedIn (opens in a new tab)
23.2K Views

Join the DZone community Save articles, join the discussion, and download Refcards and Trend Reports with a free account.

Join for free Already a member? Log in

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.

AWS

Opinions expressed by DZone contributors are their own.

Related

  • Google Cloud KMS vs. AWS KMS: Java Encryption Guide
  • Multi-Agent Orchestration on AWS With AgentCore Runtime and A2A
  • AWS 7R Migration Strategies: A Decision Framework for Engineering Teams
  • Understand the Sidecar Pattern by Deploying n8n to AWS Fargate

Partner Resources

×

Comments

Loading comments

The comments didn't load

Please try again in a moment.

Likes

Loading

The next likes didn't load. Please try again.

The likes didn't load

Please try again in a moment.

See who liked this

Log in or join DZone for free to see who liked this article.

Log in Join for free
  • RSS
  • X
  • Facebook

ABOUT US

  • About DZone
  • Support and feedback
  • Community research

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 215
  • Nashville, TN 37211
  • [email protected]

Let's be friends:

  • RSS
  • X
  • Facebook