AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

Container for the parameters to the AddTagsToResource operation. 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.

Inheritance Hierarchy


Namespace: Amazon.ElastiCache.Model
Assembly: AWSSDK.ElastiCache.dll
Version: 3.x.y.z


public class AddTagsToResourceRequest : AmazonElastiCacheRequest

The AddTagsToResourceRequest type exposes the following members


Public Method AddTagsToResourceRequest()


Public Property ResourceName System.String

Gets and sets the property 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. ElastiCache resources are cluster and snapshot.

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

Public Property Tags System.Collections.Generic.List<Amazon.ElastiCache.Model.Tag>

Gets and sets the property Tags.

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.


Adds up to 10 tags, key/value pairs, to a cluster or snapshot resource.


var response = client.AddTagsToResource(new AddTagsToResourceRequest 
    ResourceName = "arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster",
    Tags = new List {
        new Tag {
            Key = "APIVersion",
            Value = "20150202"
        new Tag {
            Key = "Service",
            Value = "ElastiCache"

List tagList = response.TagList;


Version Information

.NET Standard:
Supported in: 1.3

.NET Framework:
Supported in: 4.5, 4.0, 3.5

Portable Class Library:
Supported in: Windows Store Apps
Supported in: Windows Phone 8.1
Supported in: Xamarin Android
Supported in: Xamarin iOS (Unified)
Supported in: Xamarin.Forms