Associate an Elastic IP address with your EC2 instance using AWS Console

Profile picture for user devraj

The auto-assigned public IP address associated with your Amazon Elastic Compute Cloud (Amazon EC2) instance changes every time you stop and start the instance. You can assign a static public IP address to your Windows or Linux EC2 instance that doesn't change when this happens.

An Elastic IP address is a static IPv4 address associated with your AWS account in a specific Region. You can associate an Elastic IP address with your EC2 instance at any time using:

  • The Amazon EC2 console;
  • the AWS Command Line Interface (AWS CLI); or
  • AWS Tools for Windows PowerShell.

Unlike the auto-assigned public IP address, an Elastic IP address is preserved after you stop and start your instance in a virtual private cloud (VPC). Note: There is a default limit of five Elastic IP addresses per Region. You can allocate an Elastic IP address from Amazon's pool of public IPv4 addresses, or from a custom IP address pool that you have brought to your AWS account.

To allocate an Elastic IP address

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the navigation pane, choose Elastic IPs.
  3. Choose Allocate Elastic IP address.
  4. For Scope, choose either VPC or EC2-Classic depending on the scope in which it will be used.
  5. (VPC scope only) For Public IPv4 address pool choose one of the following:
    • Amazon's pool of IP addresses: If you want an IPv4 address to be allocated from Amazon's pool of IP addresses.
    • My pool of public IPv4 addresses: If you want to allocate an IPv4 address from an IP address pool that you have brought to your AWS account. This option is disabled if you do not have any IP address pools.
    • Customer owned pool of IPv4 addresses: If you want to allocate an IPv4 address from a pool created from your on-premises network for use with an AWS Outpost. This option is disabled if you do not have an AWS Outpost.
  6. Choose Allocate

To associate an Elastic IP address with an instance

  1. Open the Amazon EC2 console at https://console.aws.amazon.com/ec2/.
  2. In the navigation pane, choose Elastic IPs.
  3. Select the Elastic IP address to associate and choose Actions, Associate Elastic IP address.
  4. For Resource type, choose Instance.
  5. For instance, choose the instance with which to associate the Elastic IP address. You can also enter text to search for a specific instance.
  6. (Optional) For Private IP address, specify a private IP address with which to associate the Elastic IP address.
  7. Choose Associate
Tags