Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Updating tags for AWS Cloud Map resources

Focus mode
Updating tags for AWS Cloud Map resources - AWS Cloud Map

Use the following AWS CLI commands or AWS Cloud Map API operations to add, update, list, and delete the tags for your resources.

Tagging support for AWS Cloud Map resources
Task API action AWS CLI AWS Tools for Windows PowerShell

Add or overwrite one or more tags.

TagResource

tag-resource

Add-SDResourceTag

Delete one or more tags.

UntagResource

untag-resource

Remove-SDResourceTag

List tags for a resource

ListTagsForResource

list-tags-for-resource

Get-SDResourceTag

The following examples show how to tag or untag resources using the AWS CLI.

Example 1: Tag an existing resource

The following command tags an existing resource.

aws servicediscovery tag-resource --resource-arn resource_ARN --tags team=devs
Example 2: Untag an existing resource

The following command deletes a tag from an existing resource.

aws servicediscovery untag-resource --resource-arn resource_ARN --tag-keys tag_key
Example 3: List tags for a resource

The following command lists the tags associated with an existing resource.

aws servicediscovery list-tags-for-resource --resource-arn resource_ARN

Some resource-creating actions enable you to specify tags when you create the resource. The following actions support tagging on creation.

Task API action AWS CLI AWS Tools for Windows PowerShell
Create an HTTP namespace CreateHttpNamespace create-http-namespace New-SDHttpNamespace
Create a private namespace based on DNS CreatePrivateDnsNamespace create-private-dns-namespace New-SDPrivateDnsNamespace
Create a public namespace based on DNS CreatePublicDnsNamespace create-public-dns-namespace New-SDPublicDnsNamespace
Create a service CreateService create-service New-SDService
PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.