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.

Lists all tags currently on a named resource.

A tag is a key-value pair where the key and value are case-sensitive. You can use tags to categorize and track all your ElastiCache resources, with the exception of global replication group. When you add or remove tags on replication groups, those actions will be replicated to all nodes in the replication group. For more information, see Resource-level permissions.

If the cluster is not in the available state, ListTagsForResource returns an error.

Note:

For .NET Core this operation is only available in asynchronous form. Please refer to ListTagsForResourceAsync.

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

Syntax

C#
public abstract ListTagsForResourceResponse ListTagsForResource(
         ListTagsForResourceRequest request
)

Parameters

request
Type: Amazon.ElastiCache.Model.ListTagsForResourceRequest

Container for the necessary parameters to execute the ListTagsForResource service method.

Return Value


The response from the ListTagsForResource service method, as returned by ElastiCache.

Exceptions

ExceptionCondition
CacheClusterNotFoundException The requested cluster ID does not refer to an existing cluster.
CacheParameterGroupNotFoundException The requested cache parameter group name does not refer to an existing cache parameter group.
CacheSecurityGroupNotFoundException The requested cache security group name does not refer to an existing cache security group.
CacheSubnetGroupNotFoundException The requested cache subnet group name does not refer to an existing cache subnet group.
InvalidARNException The requested Amazon Resource Name (ARN) does not refer to an existing resource.
InvalidReplicationGroupStateException The requested replication group is not in the available state.
InvalidServerlessCacheSnapshotStateException The state of the serverless cache snapshot was not received. Available for Redis only.
InvalidServerlessCacheStateException The account for these credentials is not currently active.
ReplicationGroupNotFoundException The specified replication group does not exist.
ReservedCacheNodeNotFoundException The requested reserved cache node was not found.
ServerlessCacheNotFoundException The serverless cache was not found or does not exist.
ServerlessCacheSnapshotNotFoundException This serverless cache snapshot could not be found or does not exist. Available for Redis only.
SnapshotNotFoundException The requested snapshot name does not refer to an existing snapshot.
UserGroupNotFoundException The user group was not found or does not exist
UserNotFoundException The user does not exist or could not be found.

Examples

Lists all cost allocation tags currently on the named resource. A cost allocation tag is a key-value pair where the key is case-sensitive and the value is optional. You can use cost allocation tags to categorize and track your AWS costs.

ListTagsForResource


var client = new AmazonElastiCacheClient();
var response = client.ListTagsForResource(new ListTagsForResourceRequest 
{
    ResourceName = "arn:aws:elasticache:us-west-2:<my-account-id>:cluster:mycluster"
});

List<Tag> tagList = response.TagList;

            

Version Information

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

See Also