

# Disassociate an approval rule template
<a name="how-to-disassociate-template"></a>

If the approval rules generated by an approval rule template no longer make sense for your team's workflow in a repository, you can disassociate the template from that repository. Disassociating a template does not remove any approval rules created while the template was associated with the repository. 

For more information about managed policies and permissions for approval rule templates, see [Permissions for actions on approval rule templates](auth-and-access-control-permissions-reference.md#aa-art) and [AWS managed policies for CodeCommit](security-iam-awsmanpol.md).

## Disassociate an approval rule template (console)
<a name="how-to-disassociate-template-console"></a>

You can use the console to remove the association between a repository and an approval rule template.<a name="disassociate-template-console"></a>

## To disassociate an approval rule template from repositories
<a name="disassociate-template-console"></a>

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

1. Choose **Approval rule templates**. Choose the template you want to disassociate from a repository or repositories, and then choose **Edit**.

1. In **Associated repositories**, choose the **X** next to the repositories you want to disassociate. The repository names no longer appear.

1. Choose **Save**. Approval rules are not applied to pull requests created in those repositories. The rules are still applied to pull requests that were made while the association was in place.

## Disassociate an approval rule template (AWS CLI)
<a name="how-to-disassociate-template-cli"></a>

You can use the AWS CLI to disassociate one or more repositories from an approval rule template.<a name="disassociate-template"></a>

## To disassociate an approval rule template from a repository
<a name="disassociate-template"></a>

1. At the terminal or command line, run the **disassociate-approval-rule-template-from-repository** command, specifying:
   + The name of the approval rule template.
   + The name of the repository.

   For example, to disassociate an approval rule template named **1-approver-rule-for-all-pull-requests** from a repository named **MyDemoRepo**:

   ```
   aws codecommit disassociate-approval-rule-template-from-repository --repository-name MyDemoRepo --approval-rule-template-name 1-approver-rule-for-all-pull-requests
   ```

1. If successful, this command returns nothing.<a name="batch-disassociate-template"></a>

## To disassociate an approval rule template from multiple repositories
<a name="batch-disassociate-template"></a>

1. At the terminal or command line, run the **batch-disassociate-approval-rule-template-from-repositories** command, specifying:
   + The name of the approval rule template.
   + The names of the repositories.

   For example, to disassociate an approval rule template named **1-approver-rule-for-all-pull-requests** from a repository named **MyDemoRepo** and a repository named **MyOtherDemoRepo**:

   ```
   aws codecommit batch-disassociate-approval-rule-template-from-repositories --repository-names "MyDemoRepo", "MyOtherDemoRepo" --approval-rule-template-name 1-approver-rule-for-all-pull-requests
   ```

1. If successful, this command returns output similar to the following:

   ```
   {
       "disassociatedRepositoryNames": [
           "MyDemoRepo",
           "MyOtherDemoRepo"
       ],
       "errors": []
   }
   ```