{"id":6846,"date":"2025-02-25T11:36:02","date_gmt":"2025-02-25T11:36:02","guid":{"rendered":"https:\/\/www.ktchost.com\/blog\/?p=6846"},"modified":"2025-02-26T11:37:55","modified_gmt":"2025-02-26T11:37:55","slug":"what-is-an-elastic-ip-address-in-aws","status":"publish","type":"post","link":"https:\/\/www.ktchost.com\/blog\/what-is-an-elastic-ip-address-in-aws\/","title":{"rendered":"What is an Elastic IP address in AWS?"},"content":{"rendered":"\n<p>An <strong>Elastic IP (EIP)<\/strong> address in AWS is a <strong>static, public IPv4 address<\/strong> that you can allocate and assign to an EC2 instance. Unlike a regular public IP that changes when an instance is stopped and restarted, an <strong>Elastic IP remains constant<\/strong>, allowing you to maintain a fixed address for your applications.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Why Use an Elastic IP?<\/strong><\/h2>\n\n\n\n<p>By default, AWS assigns a <strong>dynamic public IP<\/strong> to an EC2 instance when it is launched. However, this IP changes every time you <strong>stop and start<\/strong> the instance.<\/p>\n\n\n\n<p>\ud83d\udd39 <strong>Problem:<\/strong> If for example your Application blog is hosted on an EC2 instance with a dynamic public IP, every time you restart the instance, the IP changes, causing disruptions.<\/p>\n\n\n\n<p>\ud83d\udd39 <strong>Solution:<\/strong> An <strong>Elastic IP<\/strong> ensures that your Application site always has the same public IP, avoiding frequent DNS updates or reconfigurations.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Key Features of Elastic IPs<\/strong><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Static &amp; Persistent<\/strong> \u2013 Unlike normal public IPs, an Elastic IP doesn\u2019t change when the instance is stopped or restarted.<\/li>\n\n\n\n<li><strong>Reassignable<\/strong> \u2013 You can detach an Elastic IP from one instance and attach it to another without changing the IP.<\/li>\n\n\n\n<li><strong>Charges Apply If Unused<\/strong> \u2013 AWS provides <strong>one free Elastic IP per account<\/strong> as long as it\u2019s associated with a running instance. However, <strong>unused Elastic IPs incur charges<\/strong>.<\/li>\n<\/ol>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Allocate and Associate an Elastic IP<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 1: Allocate an Elastic IP<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Open the <strong>AWS Management Console<\/strong>.<\/li>\n\n\n\n<li>Navigate to <strong>EC2 Dashboard<\/strong> \u2192 <strong>Elastic IPs<\/strong> (under Network &amp; Security).<\/li>\n\n\n\n<li>Click on <strong>Allocate Elastic IP Address<\/strong>.<\/li>\n\n\n\n<li>Choose <strong>Amazon\u2019s pool of IPv4 addresses<\/strong> and click <strong>Allocate<\/strong>.<\/li>\n\n\n\n<li>You will now have an <strong>Elastic IP<\/strong> allocated to your account.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Step 2: Associate the Elastic IP with an EC2 Instance<\/strong><\/h3>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Select the newly allocated Elastic IP.<\/li>\n\n\n\n<li>Click <strong>Actions<\/strong> \u2192 <strong>Associate Elastic IP Address<\/strong>.<\/li>\n\n\n\n<li>Choose your <strong>EC2 instance<\/strong> from the list.<\/li>\n\n\n\n<li>Click <strong>Associate<\/strong>.<\/li>\n<\/ol>\n\n\n\n<p>Now, your EC2 instance has a <strong>fixed, static public IP<\/strong> that will not change even if the instance is stopped and restarted.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Example Scenario: Hosting a Application with Elastic IP<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Without Elastic IP<\/strong><\/h3>\n\n\n\n<p>\ud83d\udd38 You launch an <strong>EC2 instance<\/strong> to host your Application.<br>\ud83d\udd38 AWS assigns a <strong>dynamic public IP<\/strong> (e.g., <code>54.200.120.50<\/code>).<br>\ud83d\udd38 You map your domain (<code>your-application.com<\/code>) to this IP.<br>\ud83d\udd38 Later, you <strong>restart<\/strong> the instance, and AWS assigns a new public IP (e.g., <code>3.85.220.40<\/code>).<br>\ud83d\udd38 Now, your website is inaccessible until you update the DNS settings with the new IP.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>With Elastic IP<\/strong><\/h3>\n\n\n\n<p>\u2705 You allocate an <strong>Elastic IP<\/strong> (e.g., <code>18.220.50.80<\/code>) and associate it with your EC2 instance.<br>\u2705 You map your domain (<code>your-application.com<\/code>) to this Elastic IP.<br>\u2705 Even if you <strong>restart the instance<\/strong>, the Elastic IP <strong>remains unchanged<\/strong>.<br>\u2705 Your Application remains accessible <strong>without any DNS changes<\/strong>.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>How to Release an Elastic IP (If No Longer Needed)<\/strong><\/h2>\n\n\n\n<p>If you no longer need an Elastic IP, follow these steps to <strong>avoid unnecessary charges<\/strong>:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Disassociate the Elastic IP<\/strong> from the instance.\n<ul class=\"wp-block-list\">\n<li>Go to <strong>EC2 Dashboard<\/strong> \u2192 <strong>Elastic IPs<\/strong>.<\/li>\n\n\n\n<li>Select the Elastic IP and click <strong>Actions \u2192 Disassociate<\/strong>.<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Release the Elastic IP<\/strong> back to AWS.\n<ul class=\"wp-block-list\">\n<li>Select the Elastic IP and click <strong>Actions \u2192 Release IP Address<\/strong>.<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n\n\n\n<p>Once released, the IP is returned to AWS, and you will no longer be charged for it.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Elastic IP Best Practices<\/strong><\/h2>\n\n\n\n<p>\u2705 <strong>Use Elastic IPs only when necessary<\/strong> \u2013 If your EC2 instance is always running, using a DNS service like Route 53 with a domain name might be better than assigning an Elastic IP.<\/p>\n\n\n\n<p>\u2705 <strong>Avoid Unused Elastic IPs<\/strong> \u2013 AWS charges for unused Elastic IPs to discourage hoarding. Release any unneeded EIPs.<\/p>\n\n\n\n<p>\u2705 <strong>Consider Elastic Load Balancing (ELB) instead<\/strong> \u2013 If hosting a highly available Application site, an <strong>Elastic Load Balancer (ELB)<\/strong> distributes traffic across multiple instances without the need for a static IP.<\/p>\n\n\n\n<p>\u2705 <strong>Monitor Elastic IPs with AWS CloudWatch<\/strong> \u2013 Track IP changes, association, and costs using AWS CloudWatch for better management.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Final Thoughts<\/strong><\/h2>\n\n\n\n<p>Elastic IPs provide a <strong>reliable, static public IP<\/strong> for your EC2 instances, ensuring that services like <strong>Application, APIs, and web applications<\/strong> remain accessible without frequent DNS updates. However, they should be <strong>used efficiently<\/strong> to avoid unnecessary costs.<\/p>\n\n\n\n<p>Would you like help setting up an Elastic IP for your Application? \ud83d\ude80<\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"mh-excerpt\"><p>An Elastic IP (EIP) address in AWS is a static, public IPv4 address that you can allocate and assign to an EC2 instance. Unlike a <a class=\"mh-excerpt-more\" href=\"https:\/\/www.ktchost.com\/blog\/what-is-an-elastic-ip-address-in-aws\/\" title=\"What is an Elastic IP address in AWS?\">[&#8230;]<\/a><\/p>\n<\/div>","protected":false},"author":1,"featured_media":6847,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[745,746],"tags":[],"class_list":["post-6846","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ec2","category-netowrking"],"_links":{"self":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/6846"}],"collection":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/comments?post=6846"}],"version-history":[{"count":1,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/6846\/revisions"}],"predecessor-version":[{"id":6848,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/posts\/6846\/revisions\/6848"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media\/6847"}],"wp:attachment":[{"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/media?parent=6846"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/categories?post=6846"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ktchost.com\/blog\/wp-json\/wp\/v2\/tags?post=6846"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}