org-formation / aws-resource-providers

A community driven repository where you can find AWS Resource Type Providers for different purposes (including org-formation ones).
MIT License
88 stars 21 forks source link

feat: CodeCommit - Approval Rule Template #24

Closed eduardomourar closed 3 years ago

eduardomourar commented 3 years ago

Issue #, if available: #15

Description of changes: Add new resource types Community::CodeCommit::ApprovalRuleTemplate and Community::CodeCommit::RepositoryAssociation

Here is a working sample:

AWSTemplateFormatVersion: 2010-09-09

Parameters:
  name:
    Type: String
    Default: "repo-rule"

  description:
    Type: String
    Default: "rule description"

Resources:
  Repo:
    Type: AWS::CodeCommit::Repository
    Properties:
      RepositoryName: "repo"

  Repo2:
    Type: AWS::CodeCommit::Repository
    Properties:
      RepositoryName: "repo2"

  RuleTemplate:
    Type: Community::CodeCommit::ApprovalRuleTemplate
    Properties:
      Name: !Ref name
      Description: !Ref description
      Content:
        Version: "2018-11-08"
        DestinationReferences:
          - "refs/heads/master"
        Statements:
          - Type: "Approvers"
            NumberOfApprovalsNeeded: 3
            ApprovalPoolMembers:
              - "*"

  RepoAssociation:
    Type: Community::CodeCommit::RepositoryAssociation
    Properties:
      ApprovalRuleTemplateArn: !Ref RuleTemplate
      RepositoryNames: [!GetAtt Repo.Name, !GetAtt Repo2.Name]

Outputs:
  RuleTemplateArn:
    Value: !Ref RuleTemplate

  RepoAssociationArn:
    Value: !Ref RepoAssociation
codecov[bot] commented 3 years ago

Codecov Report

Merging #24 into master will increase coverage by 0.73%. The diff coverage is 85.33%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #24      +/-   ##
==========================================
+ Coverage   83.53%   84.27%   +0.73%     
==========================================
  Files           8       10       +2     
  Lines         407      706     +299     
  Branches       58      115      +57     
==========================================
+ Hits          340      595     +255     
- Misses         67      111      +44     
Flag Coverage Δ
#unittests 84.27% <85.33%> (+0.73%) :arrow_up:

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cloud-formation/delay/src/handlers.ts 98.36% <ø> (-0.03%) :arrow_down:
code-commit/approval-rule-template/src/handlers.ts 85.06% <85.06%> (ø)
code-commit/repository-association/src/handlers.ts 85.61% <85.61%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update b28472f...b427b53. Read the comment docs.