Tagging Systems Manager parameters - AWS Systems Manager

Tagging Systems Manager parameters

The topics in this section describe how to work with tags on AWS Systems Manager parameters (SSM parameters).

Creating parameters with tags

You can add tags to SSM parameters at the time you create them.

For information, see the following topics:

Adding tags to existing parameters

You can add tags to custom SSM parameters that you own by using the Systems Manager console or the command line.

Adding tags to an existing parameter (console)

  1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/.

  2. In the navigation pane, choose Parameter Store.

    -or-

    If the AWS Systems Manager home page opens first, choose the menu icon ( 
    The menu icon
  ) to open the navigation pane, and then choose Parameter Store.

  3. Choose the name of a parameter you have already created, and then choose the Tags tab.

  4. In the first box, enter a key for the tag, such as Environment.

  5. In the second box, enter a value for the tag, such as Test.

  6. Choose Save.

Adding tags to an existing parameter (AWS CLI)

  1. Using your preferred command line tool, run the following command to view the list of parameters that you can tag.

    aws ssm describe-parameters

    Note the name of a parameter that you want to tag.

  2. Run the following command to tag a parameter. Replace each example resource placeholder with your own information.

    aws ssm add-tags-to-resource \ --resource-type "Parameter" \ --resource-id "parameter-name" \ --tags "Key=tag-key,Value=tag-value"

    If successful, the command has no output.

  3. Run the following command to verify the parameter tags.

    aws ssm list-tags-for-resource --resource-type "Parameter" --resource-id "parameter-name"

Adding tags to an existing parameter (AWS Tools for PowerShell)

  1. Run the following command to list parameters that you can tag.

    Get-SSMParameterList
  2. Run the following commands to tag a parameter. Replace each example resource placeholder with your own information.

    $tag = New-Object Amazon.SimpleSystemsManagement.Model.Tag
    $tag.Key = "tag-key"
    $tag.Value = "tag-value"
    Add-SSMResourceTag ` -ResourceType "Parameter" ` -ResourceId "parameter-name" ` -Tag $tag ` -Force
  3. Run the following command to verify the parameter tags.

    Get-SSMResourceTag ` -ResourceType "Parameter" ` -ResourceId "parameter-name"

Removing tags from SSM parameters

You can use the Systems Manager console or the command line to remove tags from SSM parameters.

Removing tags from SSM parameters (console)

  1. Open the AWS Systems Manager console at https://console.aws.amazon.com/systems-manager/.

  2. In the navigation pane, choose Parameter Store.

    -or-

    If the AWS Systems Manager home page opens first, choose the menu icon ( 
    The menu icon
  ) to open the navigation pane, and then choose Parameter Store.

  3. Choose the name of the parameter to remove tags from, and then choose the Tags tab.

  4. Choose Remove next to the tag pair you no longer need.

  5. Choose Save.

Removing tags from SSM parameters (command line)

  1. Using your preferred command line tool, run the following command to list the parameters in your account.

    Linux & macOS
    aws ssm describe-parameters
    Windows
    aws ssm describe-parameters
    PowerShell
    Get-SSMParameterList

    Note the name of a parameter from which you want to remove tags.

  2. Run the following command to remove tags from a parameter. Replace each example resource placeholder with your own information.

    Linux & macOS
    aws ssm remove-tags-from-resource \ --resource-type "Parameter" \ --resource-id "parameter-name" \ --tag-key "tag-key"
    Windows
    aws ssm remove-tags-from-resource ^ --resource-type "Parameter" ^ --resource-id "parameter-name" ^ --tag-key "tag-key"
    PowerShell
    Remove-SSMResourceTag -ResourceId "parameter-name" -ResourceType "Parameter" -TagKey "tag-key

    If successful, the command has no output.

  3. Run the following command to verify the document tags.

    Linux & macOS
    aws ssm list-tags-for-resource \ --resource-type "Parameter" \ --resource-id "parameter-name"
    Windows
    aws ssm list-tags-for-resource ^ --resource-type "Parameter" ^ --resource-id "parameter-name"
    PowerShell
    Get-SSMResourceTag ` -ResourceType "Parameter" ` -ResourceId "parameter-name"