AssociateAddress
In this article:
AssociateAddress#
Description#
The request to associate an external Elastic IP address with an existing instance or network interface.
Request Parameters#
Required parameters#
AllocationId — Identifier of an allocated external Elastic IP address.
Type: String
Required: Yes, if PublicIp is not supplied
instanceId — The ID of the instance.
Type: String
Required: Yes, if NetworkInterfaceId is not supplied
NetworkInterfaceId — The ID of the network interface.
Type: String
Required: Yes, if InstanceId is not supplied
PublicIp — External Elastic IP address.
Type: String
Required: Yes, if AllocationId is not supplied
Optional parameters#
AllowReassociation — Automatic reassociation. When set to
False
, the operation will fail if the external Elastic IP address is already associated with another interface.Type: Boolean
Required: No
Default value:
True
Response Elements#
associationId — The ID of the association between the Elastic IP address and a network interface.
Type: String
requestId — The request ID.
Type: String
return —
True
is returned if the request succeeds, and an error otherwise.Type: Boolean
Examples#
c2-ec2 AssociateAddress AllocationId eipalloc-00000000 InstanceId i-00000000
c2-ec2 AssociateAddress AllocationId eipalloc-00000000 NetworkInterfaceId eni-00000000
c2-ec2 AssociateAddress AllocationId eipalloc-00000000 NetworkInterfaceId eni-00000000 AllowReassociation False
c2-ec2 AssociateAddress PublicIp 1.2.3.4 InstanceId i-00000000