HEX
Server: Apache
System: Linux vps-cdc32557.vps.ovh.ca 5.15.0-156-generic #166-Ubuntu SMP Sat Aug 9 00:02:46 UTC 2025 x86_64
User: hanode (1017)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: //lib/python3/dist-packages/awscli/examples/codecommit/create-approval-rule-template.rst
**To create an approval rule template**

The following ``create-approval-rule-template`` example creates an approval rule template named ``2-approver-rule-for-main ``. The template requires two users who assume the role of ``CodeCommitReview`` to approve any pull request before it can be merged to the ``main`` branch. ::

    aws codecommit create-approval-rule-template \
        --approval-rule-template-name 2-approver-rule-for-main \
        --approval-rule-template-description  "Requires two developers from the team to approve the pull request if the destination branch is main" \
        --approval-rule-template-content "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}"

Output::

    {
        "approvalRuleTemplate": {
            "approvalRuleTemplateName": "2-approver-rule-for-main",
            "creationDate": 1571356106.936,
            "approvalRuleTemplateId": "dd8b17fe-EXAMPLE",
            "approvalRuleTemplateContent": "{\"Version\": \"2018-11-08\",\"DestinationReferences\": [\"refs/heads/main\"],\"Statements\": [{\"Type\": \"Approvers\",\"NumberOfApprovalsNeeded\": 2,\"ApprovalPoolMembers\": [\"arn:aws:sts::123456789012:assumed-role/CodeCommitReview/*\"]}]}",
            "lastModifiedUser": "arn:aws:iam::123456789012:user/Mary_Major",
            "approvalRuleTemplateDescription": "Requires two developers from the team to approve the pull request if the destination branch is main",
            "lastModifiedDate": 1571356106.936,
            "ruleContentSha256": "4711b576EXAMPLE"
        }
    }

For more information, see `Create an Approval Rule Template <https://docs.aws.amazon.com/codecommit/latest/userguide/how-to-create-template.html#create-template-cli>`__ in the *AWS CodeCommit User Guide*.