AssociateAddress
Description
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.
Request Parameters
Name | Description | Required |
---|---|---|
|
Type: |
Ancestor: None
Children: publicIp
, instanceId
publicIp
IP address that you are assigning to the instance.
Type: xsd:string
Default: None
Ancestor: AssociateAddressType
Children: None
Yes
instanceId
The instance to associate with the IP address.
Type: xsd:string
Default: None
Ancestor: AssociateAddressType
Children: None
Yes
Response Elements
Name | Description |
---|---|
|
Type: AssociateAddressResponseType Ancestor: None Children: |
|
The ID of the request. Type: xsd:string Ancestor: Children: None |
|
Returns "true" if instance and IP address successfully associated; otherwise "false". Type: xsd:boolean Ancestor: Children: None |
Examples
Example Request
This example associates an IP address with an instance.
<AssociateAddress xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <instanceId>i-28a64341</instanceId> <publicIp>67.202.55.255</publicIp> </AssociateAddress>
Example Response
<AssociateAddressResponse xmlns="http://ec2.amazonaws.com/doc/2009-07-15/"> <return>true</return> </AssociateAddressResponse>