ServiceDiscovery / Client / untag_resource

untag_resource#

ServiceDiscovery.Client.untag_resource(**kwargs)#

Removes one or more tags from the specified resource.

See also: AWS API Documentation

Request Syntax

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

    [REQUIRED]

    The Amazon Resource Name (ARN) of the resource that you want to retrieve tags for.

  • TagKeys (list) –

    [REQUIRED]

    The tag keys to remove from the specified resource.

    • (string) –

Return type:

dict

Returns:

Response Syntax

{}

Response Structure

  • (dict) –

Exceptions

  • ServiceDiscovery.Client.exceptions.ResourceNotFoundException

  • ServiceDiscovery.Client.exceptions.InvalidInput

Examples

This example removes the “Department” and “Project” tags from a resource.

response = client.untag_resource(
    ResourceARN='arn:aws:servicediscovery:us-east-1:123456789012:namespace/ns-ylexjili4cdxy3xm',
    TagKeys=[
        'Project',
        'Department',
    ],
)

print(response)

Expected Output:

{
    'ResponseMetadata': {
        '...': '...',
    },
}