Associates an elastic IP address with an instance. If the IP address is currently assigned to another instance, the IP address is assigned to the new instance. This is an idempotent operation. If you enter it more than once, Amazon EC2 does not return an error.
ec2-associate-address
ip_address
-i instance_id
| Name | Description | Required |
|---|---|---|
|
|
IP address that you are assigning to the instance. Type: String Default: None Example: 67.202.55.255 |
Yes |
|
|
The instance to associate with the IP address. Type: String Default: None Example: i-43a4412a |
Yes |
The command returns a table that contains the following information:
Output type identifier ("ADDRESS")
Elastic IP address that you are assigning to the instance
Instance to which the IP address is assigned
Amazon EC2 displays errors on stderr.
This example associates an IP address with an instance.
PROMPT>ec2-associate-address 67.202.55.255 -i i-43a4412aADDRESS 67.202.55.255 i-43a4412a