There are more AWS SDK examples available in the AWS Doc SDK Examples
Use ListTagsForResource
with a CLI
The following code examples show how to use ListTagsForResource
.
- CLI
-
- AWS 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 AWS Resources in the AWS General Reference.
-
For API details, see ListTagsForResource
in AWS CLI Command 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 API details, see ListTagsForResource in AWS Tools for PowerShell Cmdlet Reference.
-