Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions,
see Getting Started with Amazon Web Services in China
(PDF).
The following code examples show how to use ListTagsForResource
.
- CLI
-
- Amazon CLI
-
To list the tags applied to a patch baseline
The following list-tags-for-resource
example lists the tags for a patch baseline.
aws ssm list-tags-for-resource \
--resource-type "PatchBaseline"
\
--resource-id "pb-0123456789abcdef0"
Output:
{
"TagList": [
{
"Key": "Environment",
"Value": "Production"
},
{
"Key": "Region",
"Value": "EMEA"
}
]
}
For more information, see Tagging Amazon Resources in the Amazon General Reference.
- PowerShell
-
- Tools for PowerShell
-
Example 1: This example lists the tags for a maintenance window.
Get-SSMResourceTag -ResourceId "mw-03eb9db42890fb82d" -ResourceType "MaintenanceWindow"
Output:
Key Value
--- -----
Stack Production
For a complete list of Amazon SDK developer guides and code examples, see
Using Systems Manager with an Amazon SDK.
This topic also includes information about getting started and details about previous SDK versions.