

As of November 7, 2025, you can't create new repository associations in Amazon CodeGuru Reviewer. To learn about services with capabilities similar to CodeGuru Reviewer, see [Amazon CodeGuru Reviewer availability change](https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/codeguru-reviewer-availability-change.html).

# Add or update tags for a CodeGuru Reviewer associated repository
<a name="how-to-tag-associated-repository-update"></a>

You can change the value for a tag associated with an associated repository or add a new tag. Keep in mind that there are limits on the characters you can use in the key and value fields. For more information, see [Limits](quotas.md#limits-tags).

**Important**  
Updating the value of a tag for an associated repository can impact access to that associated repository. Before you update the value of a tag for an associated repository, make sure to review any IAM policies that might use the value to control access to resources such as associated repositories. For examples of tag-based access policies, see [Using tags to control access to Amazon CodeGuru Reviewer associated repositories](auth-and-access-control-using-tags.md).

**Topics**
+ [Add or update tags for a CodeGuru Reviewer associated repository (console)](how-to-tag-associated-repository-update-console.md)
+ [Add or update tags for a CodeGuru Reviewer associated repository (AWS CLI)](how-to-tag-associated-repository-update-cli.md)

# Add or update tags for a CodeGuru Reviewer associated repository (console)
<a name="how-to-tag-associated-repository-update-console"></a>

You can use the CodeGuru Reviewer console to update, add, or remove the tags associated with a CodeGuru Reviewer associated repository. Using the console, 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.

**To add or update tags for an associated repository**

1. Open the Amazon CodeGuru Reviewer console at [https://console.aws.amazon.com/codeguru/reviewer/](https://console.aws.amazon.com/codeguru/reviewer/).

1. In the navigation pane, choose **Repositories**.

1. Do one of the following: 
   + Choose the association ID of the associated repository where you want to view tags, then choose **Manage tags**.
   + Choose the radio button next to the associated repository where you want to view tags, then choose **Manage tags**.

1. Enter new values in **key** and **value** to edit tags. Choose **Remove** next to a tag to remove it. Choose **Add new tag** to add a new tag. 

1. Choose **Save changes** when you are finished. 

# Add or update tags for a CodeGuru Reviewer associated repository (AWS CLI)
<a name="how-to-tag-associated-repository-update-cli"></a>

Follow these steps to use the AWS CLI and the **tag-resource** command to add or update the AWS tags for an associated repository. This command adds a new tag or, if you pass in a tag with an existing key, updates the value associated with that key. If you want to use the AWS CLI to update the key of a tag, use **untag-resource** to remove it, then use **tag-resource** to add a new tag with the updated key and its value.

**To add or update tags for an associated repository**

1. Make sure that you have configured the AWS CLI with the AWS Region in which you want to create your code reviews. To verify the Region, run the following command at the command line or terminal and review the information for the default name. 

   ```
   aws configure
   ```

   The default Region name must match the AWS Region for the repository in CodeCommit. 

1. Run the **tag-resource** command. Use `--resource-arn` to specify the Amazon Resource Name (ARN) of the associated repository that contains the tags you want to update or add. Use the `--tags` argument to specify the tags you want to update or add. The following command specifies 3 tags. If one of the keys already exists, its value is updated. If not, a new key is added.

   ```
   aws codeguru-reviewer tag-resource /
     --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid /
     --tags key1=value1,key2=value2,key3=value3
   ```

1. If successful, there is no output and no error. If you want to verify the tags were added correctly, use the **describe-repository-association** command and use `--association-arn` to specify the ARN of the associated repository. 

   ```
   aws codeguru-reviewer describe-repository-association /
     --association-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid
   ```

   The output is a [https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html](https://docs.aws.amazon.com/codeguru/latest/reviewer-api/API_RepositoryAssociation.html) object that includes an array with the 3 added or updated tags. 

   ```
   {
       "RepositoryAssociation": {
           "AssociationId": "repository-association-uuid",
           "Name": "my-repository-name",
           "LastUpdatedTimeStamp": 1603493340.035,
           "ProviderType": "CodeCommit",
           "CreatedTimeStamp": 1603493328.512,
           "Owner": "123456789012",
           "State": "Associated",
           "StateReason": ""Pull Request Notification configuration successful",
           "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid"
       },
       "Tags": {
           "key3": "value3",
           "key2": "value2",
           "key1": "value1"        
       }
   }
   ```