initial-pipeline/pipeline-setup.yml [146:199]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PREventRuleRole: 
    Type: AWS::IAM::Role
    Properties: 
      RoleName: !Join [ '-', [ !Ref ResourceName, 'cloudwatch', 'pr'  ] ]
      AssumeRolePolicyDocument: 
        Version: 2012-10-17
        Statement: 
          - 
            Effect: Allow
            Principal: 
              Service: 
                - lambda.amazonaws.com
            Action: 
              - sts:AssumeRole
      Path: /
      Policies: 
        - 
          PolicyName: PRPolicy
          PolicyDocument: 
            Version: 2012-10-17
            Statement: 
              - 
                Effect: Allow
                Action:
                  - logs:CreateLogGroup
                  - logs:CreateLogStream
                  - logs:PutLogEvents
                Resource: '*'
              - 
                Effect: Allow
                Action:
                  - codepipeline:*
                Resource: '*'

  PREventRule:
    Type: "AWS::Events::Rule"
    Properties:
      Name: !Join [ '-', [ !Ref ResourceName, 'pr'  ] ]
      Description: "Trigger notifications based on CodeCommit Pull Requests"
      EventPattern:
        source:
          - "aws.codecommit"
        detail-type:
          - "CodeCommit Pull Request State Change"
        resources:
          - !GetAtt AppRepository.Arn
        detail:
          event:
            - "pullRequestSourceBranchUpdated"
            - "pullRequestCreated"
      State: "ENABLED"
      Targets:
        - Arn: !GetAtt LambdaPR.Arn
          Id: !Join [ '-', [ !Ref ResourceName, 'pr'  ] ]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



supplemental/pipeline-setup-final.yml [249:302]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
  PREventRuleRole: 
    Type: AWS::IAM::Role
    Properties: 
      RoleName: !Join [ '-', [ !Ref ResourceName, 'cloudwatch', 'pr'  ] ]
      AssumeRolePolicyDocument: 
        Version: 2012-10-17
        Statement: 
          - 
            Effect: Allow
            Principal: 
              Service: 
                - lambda.amazonaws.com
            Action: 
              - sts:AssumeRole
      Path: /
      Policies: 
        - 
          PolicyName: PRPolicy
          PolicyDocument: 
            Version: 2012-10-17
            Statement: 
              - 
                Effect: Allow
                Action:
                  - logs:CreateLogGroup
                  - logs:CreateLogStream
                  - logs:PutLogEvents
                Resource: '*'
              - 
                Effect: Allow
                Action:
                  - codepipeline:*
                Resource: '*'

  PREventRule:
    Type: "AWS::Events::Rule"
    Properties:
      Name: !Join [ '-', [ !Ref ResourceName, 'pr'  ] ]
      Description: "Trigger notifications based on CodeCommit Pull Requests"
      EventPattern:
        source:
          - "aws.codecommit"
        detail-type:
          - "CodeCommit Pull Request State Change"
        resources:
          - !GetAtt AppRepository.Arn
        detail:
          event:
            - "pullRequestSourceBranchUpdated"
            - "pullRequestCreated"
      State: "ENABLED"
      Targets:
        - Arn: !GetAtt LambdaPR.Arn
          Id: !Join [ '-', [ !Ref ResourceName, 'pr'  ] ]
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



