ElastiCache / Client / remove_tags_from_resource

remove_tags_from_resource#

ElastiCache.Client.remove_tags_from_resource(**kwargs)#

Removes the tags identified by the TagKeys list from the 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.

See also: AWS API Documentation

Request Syntax

response = client.remove_tags_from_resource(
    ResourceName='string',
    TagKeys=[
        'string',
    ]
)
Parameters:
  • ResourceName (string) –

    [REQUIRED]

    The Amazon Resource Name (ARN) of the resource from which you want the tags removed, 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 Amazon Service Namespaces.

  • TagKeys (list) –

    [REQUIRED]

    A list of TagKeys identifying the tags you want removed from the named resource.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{
    'TagList': [
        {
            'Key': 'string',
            'Value': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    Represents the output from the AddTagsToResource, ListTagsForResource, and RemoveTagsFromResource operations.

    • TagList (list) –

      A list of tags as key-value pairs.

      • (dict) –

        A tag that can be added to an ElastiCache cluster or replication group. Tags are composed of a Key/Value pair. 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. A tag with a null Value is permitted.

        • Key (string) –

          The key for the tag. May not be null.

        • Value (string) –

          The tag’s value. May be null.

Exceptions

  • ElastiCache.Client.exceptions.CacheClusterNotFoundFault

  • ElastiCache.Client.exceptions.CacheParameterGroupNotFoundFault

  • ElastiCache.Client.exceptions.CacheSecurityGroupNotFoundFault

  • ElastiCache.Client.exceptions.CacheSubnetGroupNotFoundFault

  • ElastiCache.Client.exceptions.InvalidReplicationGroupStateFault

  • ElastiCache.Client.exceptions.ReplicationGroupNotFoundFault

  • ElastiCache.Client.exceptions.ReservedCacheNodeNotFoundFault

  • ElastiCache.Client.exceptions.SnapshotNotFoundFault

  • ElastiCache.Client.exceptions.UserNotFoundFault

  • ElastiCache.Client.exceptions.UserGroupNotFoundFault

  • ElastiCache.Client.exceptions.ServerlessCacheNotFoundFault

  • ElastiCache.Client.exceptions.InvalidServerlessCacheStateFault

  • ElastiCache.Client.exceptions.ServerlessCacheSnapshotNotFoundFault

  • ElastiCache.Client.exceptions.InvalidServerlessCacheSnapshotStateFault

  • ElastiCache.Client.exceptions.InvalidARNFault

  • ElastiCache.Client.exceptions.TagNotFoundFault

Examples

Removes tags identified by a list of tag keys from the list of tags on the specified resource.

response = client.remove_tags_from_resource(
    ResourceName='arn:aws:elasticache:us-east-1:1234567890:cluster:my-mem-cluster',
    TagKeys=[
        'A',
        'C',
        'E',
    ],
)

print(response)

Expected Output:

{
    'TagList': [
        {
            'Key': 'B',
            'Value': 'Banana',
        },
        {
            'Key': 'D',
            'Value': 'Dog',
        },
        {
            'Key': 'F',
            'Value': 'Fox',
        },
        {
            'Key': 'I',
            'Value': '',
        },
        {
            'Key': 'K',
            'Value': 'Kite',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}