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).
Tagging OpsItems
The topics in this section describe how to work with tags on OpsItems.
Creating OpsItems with tags
You can add tags to custom Amazon Systems Manager OpsItems at the time you create them if you use
a command line tool.
For information, see the following topic:
Adding tags to existing OpsItems
You can add tags to OpsItems by using a command line tool.
Adding tags to an
existing OpsItem (command line)
To add tags to an existing OpsItem (command line)
-
Using your preferred command line tool, run the following command to
view the list of OpsItem that you can tag.
- Linux & macOS
-
aws ssm describe-ops-items
- Windows
-
aws ssm describe-ops-items
- PowerShell
-
Get-SSMOpsItemSummary
Note the ID of an OpsItem that you want to tag.
-
Run the following command to tag an OpsItem. Replace each
example resource placeholder
with your
own information.
- Linux & macOS
-
aws ssm add-tags-to-resource \
--resource-type "OpsItem" \
--resource-id "ops-item-id
" \
--tags "Key=tag-key
,Value=tag-value
"
- Windows
-
aws ssm add-tags-to-resource ^
--resource-type "OpsItem" ^
--resource-id "ops-item-id
" ^
--tags "Key=tag-key
,Value=tag-value
"
- PowerShell
-
$tag = New-Object Amazon.SimpleSystemsManagement.Model.Tag
$tag.Key = "tag-key
"
$tag.Value = "tag-value
"
Add-SSMResourceTag `
-ResourceType "OpsItem" `
-ResourceId "ops-item-id
" `
-Tag $tag `
-Force
If successful, the command has no output.
-
Run the following command to verify the OpsItem tags.
- Linux & macOS
-
aws ssm list-tags-for-resource \
--resource-type "OpsItem" \
--resource-id "ops-item-id
"
- Windows
-
aws ssm list-tags-for-resource ^
--resource-type "OpsItem" ^
--resource-id "ops-item-id
"
- PowerShell
-
Get-SSMResourceTag `
-ResourceType "OpsItem" `
-ResourceId "ops-item-id
"
Removing tags from Systems Manager OpsItems
You can use a command line tool to remove tags
from Systems Manager OpsItems.
Removing tags from OpsItems
(command line)
-
Using your preferred command line tool, run the following command to
list the OpsItems in your account.
- Linux & macOS
-
aws ssm describe-ops-items
- Windows
-
aws ssm describe-ops-items
- PowerShell
-
Get-SSMOpsItemSummary
Note the name of an OpsItem from which you want to remove tags.
-
Run the following command to remove tags from an OpsItem.Replace each
example resource placeholder
with your
own information.
- Linux & macOS
-
aws ssm remove-tags-from-resource \
--resource-type "OpsItem" \
--resource-id "ops-item-id
" \
--tag-key "tag-key
"
- Windows
-
aws ssm remove-tags-from-resource ^
--resource-type "OpsItem" ^
--resource-id "ops-item-id
" ^
--tag-key "tag-key
"
- PowerShell
-
Remove-SSMResourceTag `
-ResourceId "ops-item-id
" `
-ResourceType "OpsItem" `
-TagKey "tag-key
" `
-Force
If successful, the command has no output.
-
Run the following command to verify the OpsItem tags.
- Linux & macOS
-
aws ssm list-tags-for-resource \
--resource-type "OpsItem" \
--resource-id "ops-item-id
"
- Windows
-
aws ssm list-tags-for-resource ^
--resource-type "OpsItem" ^
--resource-id "ops-item-id
"
- PowerShell
-
Get-SSMResourceTag `
-ResourceType "OpsItem" `
-ResourceId "ops-item-id
"