Adds or overwrites tags for the specified resources. Each resource can have a maximum of 10 tags. Each tag consists of a key-value pair. Tag keys must be unique per resource.
Access
public
Parameters
Parameter |
Type |
Required |
Description |
---|---|---|---|
|
Required |
One or more IDs of resources to tag. This could be the ID of an AMI, an instance, an EBS volume, or snapshot, etc. Pass a string for a single value, or an indexed array for multiple values. |
|
|
Required |
The tags to add or overwrite for the specified resources. Each tag item consists of a key-value pair.
|
|
|
Optional |
An associative array of parameters that can have the following keys:
|
Returns
Type |
Description |
---|---|
A |
Examples
Create new tags for a given resource ID.
$ec2 = new AmazonEC2(); $response = $ec2->create_tags('aki-00006369', array( array('Key' => 'alpha', 'Value' => 'abc'), array('Key' => 'alpha', 'Value' => 'def'), array('Key' => 'beta', 'Value' => 'ghi'), )); var_dump($response->isOK());Result:
bool(true)
Related Methods
Source
Method defined in services/ec2.class.php | Toggle source view (16 lines) | View on GitHub