Disassociate an approval rule template - Amazon CodeCommit
Services or capabilities described in Amazon Web Services documentation might vary by Region. To see the differences applicable to the China Regions, see Getting Started with Amazon Web Services in China (PDF).

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

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.

For more information about managed policies and permissions for approval rule templates, see Permissions for actions on approval rule templates and Amazon managed policies for CodeCommit.

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.www.amazonaws.cn/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 (Amazon CLI)

You can use the Amazon 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-from-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-from-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": [] }