How can i used CloudFormation to add a CodeCommit Approval Rule Template

0

Hi, i need help using CloudFormation to add a CodeCommit Approval Rule Template

Nafiu
質問済み 2ヶ月前400ビュー
2回答
0
承認された回答

Hello.

Creation of approval rule templates is not provided by CloudFormation officially, so you can create them from CloudFormation templates by using packages published by the community as described in the GitHub issue below.
https://github.com/aws-cloudformation/cloudformation-coverage-roadmap/issues/329#issuecomment-743093982

profile picture
エキスパート
回答済み 2ヶ月前
0

To add a CodeCommit approval rule template using CloudFormation, you can include the necessary resources and properties in your CloudFormation template.

  • Add an AWS::CodeCommit::ApprovalRuleTemplate resource to define the approval rule template. Specify properties like:
ApprovalRuleTemplateName
ApprovalRuleTemplateContent
ApprovalRuleTemplateDescription

The ApprovalRuleTemplateContent property defines the approval rule configuration as a JSON string. It supports properties like NumberOfApprovalsNeeded, ApprovalPoolMembers etc.

  • You can use pseudo parameters like Ref and GetAtt to reference the template in other resources as needed.
  • Deploy the CloudFormation stack to create the approval rule template.
  • To update an existing template, update the ApprovalRuleTemplateContent property and redeploy the stack.
profile picture
エキスパート
回答済み 2ヶ月前
  • I did use it

    AWSTemplateFormatVersion: '2010-09-09' Resources: MyApprovalRuleTemplate: Type: 'AWS::CodeCommit::ApprovalRuleTemplate' Properties: ApprovalRuleTemplateName: 'MyApprovalRuleTemplate' ApprovalRuleTemplateContent: DestinationReferences: - !Sub 'refs/heads/${Branch}' ApprovalRuleContent: Type: 'PullRequestApprovalRuleContent' Title: 'Code review required' Rules: - Type: 'Approvers' NumberOfApprovalsNeeded: 1

    But i get an error below

    Template format error: Unrecognized resource types: [AWS::CodeCommit::ApprovalRuleTemplate] (Service: AmazonCloudFormation; Status Code: 400; Error Code: ValidationError; Request ID: 8e7788cb-a8a7-418d-a3f9-aba8313551a2; Proxy: null)

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ