The AssociateAddress operation 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.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
The instance to associate with the IP address. |
|
|
Required |
IP address that you are assigning to the instance. |
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
AmazonEC2 - Associate Address
// Instantiate the class $ec2 = new AmazonEC2(); $response = $ec2->associate_address('i-1f549375', '184.73.247.11'); // Success? var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (8 lines) | View on GitHub