add_tags_to_resource ( $resource_name, $tags, $opt )

Adds metadata tags to a DB Instance. These tags can also be used with cost allocation reporting to track cost associated with a DB Instance.

For an overview on tagging DB Instances, see DB Instance Tags.

Access

public

Parameters

Parameter

Type

Required

Description

$resource_name

string

Required

The DB Instance the tags will be added to.

$tags

array

Required

The tags to be assigned to the DB Instance.

  • x - array - Optional - This represents a simple array index.
    • Key - string - Optional - A key is the required name of the tag. The string value can be from 1 to 128 Unicode characters in length and cannot be prefixed with “aws:”. The string may only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regex: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”).
    • Value - string - Optional - A value is the optional value of the tag. The string value can be from 1 to 256 Unicode characters in length and cannot be prefixed with “aws:”. The string may only contain only the set of Unicode letters, digits, white-space, ‘_’, ‘.’, ‘/’, ‘=’, ‘+’, ‘-’ (Java regex: “^([\p{L}\p{Z}\p{N}_.:/=+\-]*)$”).

$opt

array

Optional

An associative array of parameters that can have the following keys:

  • curlopts - array - Optional - A set of values to pass directly into curl_setopt(), where the key is a pre-defined CURLOPT_* constant.
  • returnCurlHandle - boolean - Optional - A private toggle specifying that the cURL handle be returned rather than actually completing the request. This toggle is useful for manually managed batch requests.

Returns

Type

Description

CFResponse

A CFResponse object containing a parsed HTTP response.

Source

Method defined in services/rds.class.php | Toggle source view (12 lines) | View on GitHub

public function add_tags_to_resource($resource_name, $tags, $opt = null)
{
    if (!$opt) $opt = array();
    $opt['ResourceName'] = $resource_name;
    
    // Required list + map
    $opt = array_merge($opt, CFComplexType::map(array(
        'Tags' => (is_array($tags) ? $tags : array($tags))
    ), 'member'));

    return $this->authenticate('AddTagsToResource', $opt);
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback