Edit tags for a repository - AWS CodeCommit

AWS CodeCommit is no longer available to new customers. Existing customers of AWS CodeCommit can continue to use the service as normal. Learn more"

Edit tags for a repository

You can change the value for a tag associated with a repository. You can also change the name of the key, which is equivalent to removing the current tag and adding a different one with the new name and the same value as the other key. Keep in mind that there are limits on the characters you can use in the key and value fields. For more information, see Limits.

Important

Editing tags for a repository can impact access to that repository. Before you edit the name (key) or value of a tag for a repository, make sure to review any IAM policies that might use the key or value for a tag to control access to resources such as repositories. For examples of tag-based access policies, see Example 5: Deny or allow actions on repositories with tags.

Edit a tag for a repository (console)

You can use the CodeCommit console to edit the tags associated with a CodeCommit repository.

  1. Open the CodeCommit console at https://console.aws.amazon.com/codesuite/codecommit/home.

  2. In Repositories, choose the name of the repository where you want to edit tags.

  3. In the navigation pane, choose Settings. Choose Repository tags.

  4. Choose Edit.

  5. Editing the value of a tag for a repository

    Do one of the following:

    • To change the tag, enter a new name in Key. Changing the name of the tag is the equivalent of removing a tag and adding a new tag with the new key name.

    • To change the value of a tag, enter a new value. If you want to change the value to nothing, delete the current value and leave the field blank.

  6. When you have finished editing tags, choose Submit.

Edit tags for a repository (AWS CLI)

Follow these steps to use the AWS CLI to update a tag for a CodeCommit repository. You can change the value for an existing key, or add another key.

At the terminal or command line, run the tag-resource command, specifying the Amazon Resource Name (ARN) of the repository where you want to update a tag and specify the tag key and tag value:

aws codecommit tag-resource --resource-arn arn:aws:codecommit:us-west-2:111111111111:MyDemoRepo --tags Team=Li