Elastic IP addresses are static Public IP addresses that are allocated to AWS Accounts.You can associate it to an EC2 instance or network interface. You need to manually allocate an Elastic IP address to your account. They are not automatically assigned. By default, you can allocate up to 5 Elastic IP addresses. To allocate more, you need to submit a request to AWS.
An Elastic IP Address can easily be disassociated from an EC2 instance or network interface and re-associated with another instance or interface. However, if you were to release it from your account, it would go back to the pool of public IP addresses in AWS that can be assigned to other AWS accounts. There is no guarantee that if you were to allocate a new IP address to your account you would get the same one you had previously. BE CAREFUL and do not just release IP addresses because you are not using them. Disassociating from EC2 instances and network interfaces is fine to do as the Elastic IP addresses still remain in your account.
What makes Elastic IP addresses useful in high availability design is that these IP addresses can be associated to or disassociated from EC2 instances or network interfaces. If an EC2 instance is down for whatever reason, the Elastic IP address can be either re-associated with another instance manually via the AWS Management Console or be re-associated programmatically. There is no need to change the DNS host name to re-point to another IP address and wait for DNS changes to propagate through the internet.
You can only associate one Elastic IP address to one EC2 instance or network interface. An Elastic IP address cannot be associated with multiple EC2 instances or network interfaces at one time, and you
cannot have EC2 instances or network interfaces with multiple Elastic IP Addresses.
Elastic IP Addresses vs Dynamically Assigned Public IP Addresses
When launching EC2 instances, there is an option to assign a Public IP address to this instance. This Public IP address is dynamically assigned and associated to THIS EC2 instance only. When it is stopped or terminated, the Public IP address is released. When the instance is started up again, assuming it was only stopped and not terminated, it will get a new dynamically assigned Public IP address. This Public IP address cannot be transferred to another instance. There is probably a use case for this, but I can't think of it at the moment.
If you assign an Elastic IP Address to an instance that already has a dynamic public IP address assigned on launch, this public IP address will be released from this instance. You can then only access this instance via the Elastic IP Address.
It seems to me Elastic IP Addresses are the way to go.
Elastic IP Addresses for EC2 Classic vs Elastic IP Addresses for EC2 VPC
The EC2 Classic is the original release of Amazon EC2. These instances run in a single flat network that is shared with other clients.
The EC2 VPC instance was introduced in 2009 when the Amazon Virtual Private Cloud (VPC) service was released.
If you account supports EC2 Classic, there will be a pool of Elastic IP addresses for use with the EC2 Classic instances and another pool of Elastic IP addresses for use with the EC2 VPC instances. You can't associate Elastic IP addresses from one type of EC2 instance to another. However, you can migrate the Elastic IP addresses for the EC2 Classic instances to the pool for the EC2 VPC instances so that they can be used with the EC2 VPC instances.
Most people won't need to worry about this as the default AWS Account that are created in recent years only support EC2 VPCs. When a new AWS Account is created, there is already a default VPC created for your account. When you launch a new EC2 instance, the default VPC gets selected by default. If you have created additional VPCs in your account, you can select them instead before launching the instance. In this way, EC2 instances are always going to be EC2 VPC instances.
Elastic IP Addresses are Region Specific
Elastic IP Addresses cannot be assigned to instances in other Regions in your account. They are Region specific.
An Elastic IP Address can easily be disassociated from an EC2 instance or network interface and re-associated with another instance or interface. However, if you were to release it from your account, it would go back to the pool of public IP addresses in AWS that can be assigned to other AWS accounts. There is no guarantee that if you were to allocate a new IP address to your account you would get the same one you had previously. BE CAREFUL and do not just release IP addresses because you are not using them. Disassociating from EC2 instances and network interfaces is fine to do as the Elastic IP addresses still remain in your account.
What makes Elastic IP addresses useful in high availability design is that these IP addresses can be associated to or disassociated from EC2 instances or network interfaces. If an EC2 instance is down for whatever reason, the Elastic IP address can be either re-associated with another instance manually via the AWS Management Console or be re-associated programmatically. There is no need to change the DNS host name to re-point to another IP address and wait for DNS changes to propagate through the internet.
You can only associate one Elastic IP address to one EC2 instance or network interface. An Elastic IP address cannot be associated with multiple EC2 instances or network interfaces at one time, and you
cannot have EC2 instances or network interfaces with multiple Elastic IP Addresses.
Elastic IP Addresses vs Dynamically Assigned Public IP Addresses
When launching EC2 instances, there is an option to assign a Public IP address to this instance. This Public IP address is dynamically assigned and associated to THIS EC2 instance only. When it is stopped or terminated, the Public IP address is released. When the instance is started up again, assuming it was only stopped and not terminated, it will get a new dynamically assigned Public IP address. This Public IP address cannot be transferred to another instance. There is probably a use case for this, but I can't think of it at the moment.
If you assign an Elastic IP Address to an instance that already has a dynamic public IP address assigned on launch, this public IP address will be released from this instance. You can then only access this instance via the Elastic IP Address.
It seems to me Elastic IP Addresses are the way to go.
Elastic IP Addresses for EC2 Classic vs Elastic IP Addresses for EC2 VPC
The EC2 Classic is the original release of Amazon EC2. These instances run in a single flat network that is shared with other clients.
The EC2 VPC instance was introduced in 2009 when the Amazon Virtual Private Cloud (VPC) service was released.
If you account supports EC2 Classic, there will be a pool of Elastic IP addresses for use with the EC2 Classic instances and another pool of Elastic IP addresses for use with the EC2 VPC instances. You can't associate Elastic IP addresses from one type of EC2 instance to another. However, you can migrate the Elastic IP addresses for the EC2 Classic instances to the pool for the EC2 VPC instances so that they can be used with the EC2 VPC instances.
Most people won't need to worry about this as the default AWS Account that are created in recent years only support EC2 VPCs. When a new AWS Account is created, there is already a default VPC created for your account. When you launch a new EC2 instance, the default VPC gets selected by default. If you have created additional VPCs in your account, you can select them instead before launching the instance. In this way, EC2 instances are always going to be EC2 VPC instances.
Elastic IP Addresses are Region Specific
Elastic IP Addresses cannot be assigned to instances in other Regions in your account. They are Region specific.
Comments
Post a Comment