

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).

# Tagging a repository association in Amazon CodeGuru Reviewer
Tagging a repository association

A *tag* is a custom attribute label that you or AWS assigns to an AWS resource. Each AWS tag has two parts:
+ A tag *key* (for example, `CostCenter`, `Environment`, `Project`, or `Secret`). Tag keys are case sensitive.
+ An optional field known as a tag *value* (for example, `111122223333`, `Production`, or a team name). Omitting the tag value is the same as using an empty string. Like tag keys, tag values are case sensitive.

Together these are known as *key*-*value* pairs. For limits on the number of tags you can have on an associated repository and restrictions on tag keys and values, see [Tags](quotas.md#limits-tags). 

Tags help you identify and organize your AWS resources. Many AWS services support tagging, so you can assign the same tag to resources from different services to indicate that the resources are related. For example, you can assign the same tag to a CodeGuru Reviewer associated repository that you assign to an AWS CodeBuild build project. For more information about using tags, see the [Tagging Best Practices](https://d1.awsstatic.com/whitepapers/aws-tagging-best-practices.pdf) whitepaper. 

In CodeGuru Reviewer, you can use the CodeGuru Reviewer console, the AWS CLI, CodeGuru Reviewer APIs, or AWS SDKs to add, manage, and remove tags for a repository association. In addition to identifying, organizing, and tracking your repository association with tags, you can use tags in IAM policies to help control who can view and interact with your repository association. 

A repository association has a parent-child hierarchical relationship with code reviews because a repository association contains all the code reviews inside it. Because of this, you can use tags on repository associations to control access to the code reviews in it. 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 a tag to a CodeGuru Reviewer associated repository
](how-to-tag-associated-repositories-add.md)
+ [

# View tags for a CodeGuru Reviewer associated repository
](how-to-tag-associated-repository-view.md)
+ [

# Add or update tags for a CodeGuru Reviewer associated repository
](how-to-tag-associated-repository-update.md)
+ [

# Remove tags from a CodeGuru Reviewer associated repository
](how-to-tag-associated-repository-remove.md)

# Add a tag to a CodeGuru Reviewer associated repository
Add a tag to an associated repository

Adding tags to an associated repository can help you identify and organize your AWS resources and manage access to them. First, you add one or more tags (key-value pairs) to an associated repository. Keep in mind that there are limits on the number of tags you can have on an associated repository. There are restrictions on the characters you can use in the key and value fields. For more information, see [Tags](quotas.md#limits-tags). After you have tags, you can create IAM policies to manage access to the associated repository based on these tags. You can use the CodeGuru Reviewer console, AWS CLI, or SDK to add tags to an associated repository. 

**Important**  
Adding tags to an associated repository can impact access to that associated repository. Before you add a tag to an associated repository, make sure to review any IAM policies that might use tags 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 a tag to a CodeGuru Reviewer associated repository (console)
](how-to-tag-associated-repository-add-console.md)
+ [

# Add a tag to a CodeGuru Reviewer associated repository (AWS CLI)
](how-to-tag-associated-repository-add-cli.md)

# Add a tag to a CodeGuru Reviewer associated repository (console)
Add a tag to an associated repository (console)

You can use the console to add a tag when you create an associated repository or to one that already exists.

**Topics**
+ [

# Add a tag when you create a CodeGuru Reviewer associated repository (console)
](how-to-tag-associated-repository-add-on-create-console.md)
+ [

# Add a tag to an existing CodeGuru Reviewer associated repository (console)
](how-to-tag-associated-repository-add-on-existing-console.md)

# Add a tag when you create a CodeGuru Reviewer associated repository (console)
Add a tag when you create an associated repository (console)

You can use the Amazon CodeGuru Reviewer console to add one or more tags when you create an Amazon CodeGuru Reviewer associated repository. 

**Add a tag when you create an associated repository**

1. Follow the steps in one of the following topics to create an association with your repository type: 
   +  [Create an AWS CodeCommit repository association (console)](https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/create-codecommit-association.html#create-codecommit-association-console) 
   +  [Create a Bitbucket repository association (console)](https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/create-bitbucket-association.html#create-bitbucket-association-console) 
   +  [Create a GitHub or GitHub Enterprise Cloud repository association (console)](https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/create-github-association.html) 
   +  [Create a GitHub Enterprise Server repository association (console)](https://docs.aws.amazon.com/codeguru/latest/reviewer-ug/create-github-enterprise-association.html#create-github-enterprise-association-console) 

1. Expand **Tags**.

1. Choose **Add new tag**.

1. In **Key**, enter a name for the tag. You can add an optional value for the tag in **Value**. 

1. (Optional) To add another tag, choose **Add new tag**.

1. Complete the rest of the steps to create your repository association.

# Add a tag to an existing CodeGuru Reviewer associated repository (console)
Add a tag to an existing associated repository (console)

You can use the Amazon CodeGuru Reviewer console to add one or more tags to an existing CodeGuru Reviewer associated repository. 

**Add a tag to an existing 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. In **Manage tags**, for each tag you want to add: 

   1. Choose **Add new tag**. 

   1. In **key**, enter a name for the tag. 

   1. (Optional) In **value**, enter a value for the tag. 

1. When you have finished adding tags, choose **Save changes**.

# Add a tag to a CodeGuru Reviewer associated repository (AWS CLI)
Add a tag to an associated repository (AWS CLI)

You can use the AWS CLI to add a tag to an associated repository that already exists or when you create it. For information about using the AWS CLI with CodeGuru Reviewer, see the [CodeGuru Reviewer section of the AWS CLI Command Reference](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/codeguru-reviewer/index.html). 

**Topics**
+ [

# Add a tag when you create a CodeGuru Reviewer associated repository (AWS CLI)
](how-to-tag-associated-repository-add-on-create-cli.md)
+ [

# Add a tag to an existing CodeGuru Reviewer associated repository (AWS CLI)
](how-to-tag-associated-repository-add-on-existing-cli.md)

# Add a tag when you create a CodeGuru Reviewer associated repository (AWS CLI)
Add a tag when you create an associated repository (AWS CLI)

You can use the AWS CLI to add tags to an associated repository when you create it. 

**Note**  
Because you cannot use the AWS CLI to create a GitHub repository, you cannot use the AWS CLI to add tags to a GitHub repository when you create it. You can use the AWS CLI to add tags to an existing GitHub repository using **tag-resource**. You can also add tags when you create a GitHub repository association with the console. 

**To add a tag when you create a repository association**

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 **associate-repository** command specifying the tags you want to add with the `--tags` parameter. Specify a tag's key and value using an equal symbol (for example, `my-key=my-value`). For more information about how to use **associate-repository** to create an association with your repository type, see one of the following: 
   +  [Create a CodeCommit repository association (AWS CLI)](create-codecommit-association.md#create-codecommit-association-cli) 
   +  [Create a Bitbucket repository association (AWS CLI)](create-bitbucket-association.md#create-bitbucket-association-cli) 
   +  [Create a GitHub Enterprise Server repository association (AWS CLI)](create-github-enterprise-association.md#create-github-enterprise-association-cli) 

   The following example adds 3 tags when you create an AWS CodeCommit repository association. 

   ```
   aws codeguru-reviewer associate-repository --repository CodeCommit={Name=my-codecommit-repo} /
   --tags value-1=key-1,owner=admin,status=beta
   ```

1. If successful, this command outputs 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 tags. 

   ```
   {
       "RepositoryAssociation": {
           "AssociationId": "repository-association-uuid",
           "Name": "my-codecommit-repo",
           "LastUpdatedTimeStamp": 1595634764.029,
           "ProviderType": "CodeCommit",
           "CreatedTimeStamp": 1595634764.029,
           "Owner": "123456789012",
           "State": "Associating",
           "StateReason": "Pending Repository Association",
           "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid",
       },
       "Tags": {
           "owner": "admin",
           "status": "beta",
           "value-1": "key-1",
       }
   }
   ```

# Add a tag to an existing CodeGuru Reviewer associated repository (AWS CLI)
Add a tag to an existing associated repository (AWS CLI)

You use the same command, **tag-resource**, to update and to use the AWS CLI to add tags to an associated repository. 

**To add a tag to an existing repository association**
+ Follow the steps in [Add or update tags for a CodeGuru Reviewer associated repository (AWS CLI)](how-to-tag-associated-repository-update-cli.md). 

# View tags for a CodeGuru Reviewer associated repository
View tags for an associated repository

Tags can help you identify and organize your AWS resources and manage access to them. For more information about tagging strategies, see [Tagging AWS resources](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html) in the *Amazon Web Services General Reference*. 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**
+ [

# View tags for an associated repository (console)
](how-to-tag-associated-repository-view-console.md)
+ [

# View tags for a CodeGuru Reviewer associated repository (AWS CLI)
](how-to-tag-associated-repository-view-cli.md)

# View tags for an associated repository (console)


You can use the CodeGuru Reviewer console to view the tags associated with a CodeGuru Reviewer associated repository. 

**To view 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 look under **Tags**.
   + Choose the radio button next to the associated repository where you want to view tags, then choose **Manage tags**.

# View tags for a CodeGuru Reviewer associated repository (AWS CLI)
View tags for an associated repository (AWS CLI)

Follow these steps to use the AWS CLI to view the AWS tags for an associated repository. If no tags have been added, the returned tags list in the response is empty (`"Tags": {}`).

**To view 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 **describe-repository-association** command and specify the Amazon Resource Name (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
   ```

1. If successful, this command outputs 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 its tags. 

   ```
   {
       "RepositoryAssociation": {
           "AssociationId": "repository-association-uuid",
           "Name": "my-codecommit-repo",
           "LastUpdatedTimeStamp": 1595634764.029,
           "ProviderType": "CodeCommit",
           "CreatedTimeStamp": 1595634764.029,
           "Owner": "123456789012",
           "State": "Associating",
           "StateReason": "Pending Repository Association",
           "AssociationArn": "arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid",
       },
       "Tags": {
           "owner": "admin",
           "status": "beta",
           "value-1": "key-1",
       }
   }
   ```

# Add or update tags for a CodeGuru Reviewer associated repository
Add or update tags for an associated repository

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)
Add or update tags for an associated repository (console)

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)
Add or update tags for an associated repository (AWS CLI)

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"        
       }
   }
   ```

# Remove tags from a CodeGuru Reviewer associated repository
Remove tags from an associated repository

You can use the console or the AWS CLI to remove tags from an associated repository. 

**Topics**
+ [

# Remove tags from a CodeGuru Reviewer associated repository (console)
](how-to-tag-associated-repository-rmeove-console.md)
+ [

# Remove tags from a CodeGuru Reviewer associated repository (AWS CLI)
](how-to-tag-associated-repository-remove-cli.md)

# Remove tags from a CodeGuru Reviewer associated repository (console)
Remove tags from an associated repository (console)

**To remove tags from 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. Choose the association ID of the associated repository with the tags you want to edit.

1. In **Tags**, choose **Manage tags**. 

1. Choose **Remove** next to each tag you want to remove. 

1. Choose **Save changes**.

# Remove tags from a CodeGuru Reviewer associated repository (AWS CLI)
Remove tags from an associated repository (AWS CLI)

You can remove a tag from an associated repository using the console or the AWS CLI.

**Important**  
Removing a tag from an associated repository can impact access to that associated repository. Before you remove a tag from an associated repository, make sure to review any IAM policies that might use its key or 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).

**To remove tags from 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 **untag-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 to. Use the `--tag-keys` argument to specify the *key* of the tags you want to remove. The following command removes 3 tags.

   ```
   aws codeguru-reviewer untag-resource /
     --resource-arn arn:aws:codeguru-reviewer:us-west-2:123456789012:association:repository-association-uuid /
     --tag-keys key1 key2 key3
   ```

1. If successful, there is no output and no error. If you want to verify the tags were removed 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 that does not contain the keys you removed. In the following output example, all tags were removed so the tags array is empty.

   ```
   {
       "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": {}
   }
   ```