Menu
Amazon ElastiCache
API Reference (API Version 2015-02-02)

AddTagsToResource

Adds up to 50 cost allocation tags to the named resource. A cost allocation tag is a key-value pair where the key and value are case-sensitive. You can use cost allocation tags to categorize and track your AWS costs.

When you apply tags to your ElastiCache resources, AWS generates a cost allocation report as a comma-separated value (CSV) file with your usage and costs aggregated by your tags. You can apply tags that represent business categories (such as cost centers, application names, or owners) to organize your costs across multiple services. For more information, see Using Cost Allocation Tags in Amazon ElastiCache in the ElastiCache User Guide.

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

ResourceName

The Amazon Resource Name (ARN) of the resource to which the tags are to be added, for example arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster or arn:aws:elasticache:us-west-2:0123456789:snapshot:mySnapshot.

For more information about ARNs, see Amazon Resource Names (ARNs) and AWS Service Namespaces.

Type: String

Required: Yes

Tags.Tag.N

A list of cost allocation tags to be added to this resource. A tag is a key-value pair. A tag key must be accompanied by a tag value.

Type: array of Tag objects

Required: Yes

Response Elements

The following element is returned by the service.

TagList.Tag.N

A list of cost allocation tags as key-value pairs.

Type: array of Tag objects

Errors

For information about the errors that are common to all actions, see Common Errors.

CacheClusterNotFound

The requested cache cluster ID does not refer to an existing cache cluster.

HTTP Status Code: 404

InvalidARN

The requested Amazon Resource Name (ARN) does not refer to an existing resource.

HTTP Status Code: 400

SnapshotNotFoundFault

The requested snapshot name does not refer to an existing snapshot.

HTTP Status Code: 404

TagQuotaPerResourceExceeded

The request cannot be processed because it would cause the resource to have more than the allowed number of tags. The maximum number of tags permitted on a resource is 50.

HTTP Status Code: 400

Example

Sample Request

Copy
https://elasticache.us-east-1.amazonaws.com/ ?Action=AddTagsToResource &ResourceName=arn:aws:elasticache:us-west-2:0123456789:cluster:myCluster &SignatureVersion=4 &SignatureMethod=HmacSHA256 &Tags.member.1.Key=Service &Tags.member.1.Value=elasticache &Tags.member.2.Key=Region &Tags.member.2.Value=us-west-2 &Version=2015-02-02 &Timestamp=20150202T192317Z &X-Amz-Credential=<credential>

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: