aws ssm add-tags-to-resource
Adds or overwrites one or more tags for the specified resource. AWS CLI reference
3 examples 3 options Its page in the AWS CLI reference
Examples
Example 1: To add tags to a maintenance window
The following add-tags-to-resource example adds a tag to the specified maintenance window.
aws ssm add-tags-to-resource --resource-type "MaintenanceWindow" --resource-id "mw-03eb9db428EXAMPLE" --tags "Key=Stack,Value=Production"Identify--resource-typeSpecifies the type of resource you are tagging.--resource-idThe resource ID you want to tag.--tagsOne or more tags.This command produces no output.
Example 2: To add tags to a parameter
The following add-tags-to-resource example adds two tags to to the specified parameter.
aws ssm add-tags-to-resource --resource-type "Parameter" --resource-id "My-Parameter" --tags '[{"Key":"Region","Value":"East"},{"Key":"Environment", "Value":"Production"}]'Identify--resource-typeSpecifies the type of resource you are tagging.--resource-idThe resource ID you want to tag.--tagsOne or more tags.This command produces no output.
Example 3: To add tags to an SSM document
The following add-tags-to-resource example adds a tag to to the specified document.
aws ssm add-tags-to-resource --resource-type "Document" --resource-id "My-Document" --tags "Key=Quarter,Value=Q322"Identify--resource-typeSpecifies the type of resource you are tagging.--resource-idThe resource ID you want to tag.--tagsOne or more tags.This command produces no output.
For more information, see Managing tags with Tag Editor in the AWS Systems Manager User Guide.
Options
--resource-idThe resource ID you want to tag.--resource-typeSpecifies the type of resource you are tagging.--tagsOne or more tags.