Skip to content

Commit 8745afe

Browse files
author
Prakash
committed
Modified CodePipeline to use CloudWatch event trigger
1 parent e54f529 commit 8745afe

File tree

1 file changed

+50
-0
lines changed

1 file changed

+50
-0
lines changed

Diff for: automated-ui-testing.yaml

+50
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,55 @@ Resources:
460460
Resource:
461461
- Fn::Sub: arn:aws:sns:${AWS::Region}:${AWS::AccountId}:${ApprovalTopic}
462462

463+
AmazonCloudWatchEventRole:
464+
Type: AWS::IAM::Role
465+
Properties:
466+
AssumeRolePolicyDocument:
467+
Version: "2012-10-17"
468+
Statement:
469+
-
470+
Effect: Allow
471+
Principal:
472+
Service:
473+
- events.amazonaws.com
474+
Action: sts:AssumeRole
475+
Path: /
476+
Policies:
477+
-
478+
PolicyName: cwe-pipeline-execution
479+
PolicyDocument:
480+
Version: "2012-10-17"
481+
Statement:
482+
-
483+
Effect: Allow
484+
Action: codepipeline:StartPipelineExecution
485+
Resource: !Join [ '', [ 'arn:aws:codepipeline:', !Ref 'AWS::Region', ':', !Ref 'AWS::AccountId', ':', !Ref AutomatedUITestPipeline ] ]
486+
487+
AmazonCloudWatchEventRule:
488+
Type: AWS::Events::Rule
489+
Properties:
490+
EventPattern:
491+
source:
492+
- aws.codecommit
493+
detail-type:
494+
- 'CodeCommit Repository State Change'
495+
resources:
496+
- !Join [ '', [ 'arn:aws:codecommit:', !Ref 'AWS::Region', ':', !Ref 'AWS::AccountId', ':', !Ref SourceRepo ] ]
497+
detail:
498+
event:
499+
- referenceCreated
500+
- referenceUpdated
501+
referenceType:
502+
- branch
503+
referenceName:
504+
- master
505+
Targets:
506+
-
507+
Arn:
508+
!Join [ '', [ 'arn:aws:codepipeline:', !Ref 'AWS::Region', ':', !Ref 'AWS::AccountId', ':', !Ref AutomatedUITestPipeline ] ]
509+
RoleArn: !GetAtt AmazonCloudWatchEventRole.Arn
510+
Id: codepipeline-AutomatedUITestPipeline
511+
463512
TestChromeProject:
464513
Type: AWS::CodeBuild::Project
465514
Properties:
@@ -816,6 +865,7 @@ Resources:
816865
-
817866
Name: UITestSourceOutput
818867
Configuration:
868+
PollForSourceChanges: False
819869
BranchName: master
820870
RepositoryName:
821871
Ref: SourceRepo

0 commit comments

Comments
 (0)