Disassociate an approval rule template - AWS CodeCommit

Disassociate an approval rule template

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.

Disassociate an approval rule template (console)

You can use the console to remove the association between a repository and an approval rule template.

To disassociate an approval rule template from repositories

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

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

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

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

You can use the AWS CLI to disassociate one or more repositories from an approval rule template.

To disassociate an approval rule template from a repository

  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-with-repository --repository-name MyDemoRepo --approval-rule-template-name 1-approver-rule-for-all-pull-requests
  2. If successful, this command returns nothing.

To disassociate an approval rule template from multiple repositories

  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-with-repositories --repository-names "MyDemoRepo", "MyOtherDemoRepo" --approval-rule-template-name 1-approver-rule-for-all-pull-requests
  2. If successful, this command returns output similar to the following:

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