Skip to content

Instantly share code, notes, and snippets.

@andreidiaconu90
Created September 11, 2020 07:16
Show Gist options
  • Save andreidiaconu90/b93c169c3f7a2601eadd39dd0821cc5f to your computer and use it in GitHub Desktop.
Save andreidiaconu90/b93c169c3f7a2601eadd39dd0821cc5f to your computer and use it in GitHub Desktop.
webhook-definition
MyCloudWatchWebHook:
Type: "AWS::Events::Rule"
Properties:
EventPattern:
source:
- aws.codecommit
detail-type:
- "CodeCommit Repository State Change"
resources:
- !Join
- ""
- - "arn:aws:codecommit:*:"
- !Ref "AWS::AccountId"
- ":"
- my-repository-name
detail:
event:
- referenceCreated
- referenceUpdated
referenceType:
- branch
referenceName:
- master
Targets:
- Arn: !Join
- ""
- - "arn:aws:codepipeline:"
- !Ref "AWS::Region"
- ":"
- !Ref "AWS::AccountId"
- ":"
- !Ref MyCodePipeline # reference to the name of the CodePipeline resource
RoleArn: !GetAtt
- MyCloudWatchWebHookRole # reference to the webhook role we've created in the previous step
- Arn
Id: my-webhook # we'll not use this, but it's a required property so you can put anything you want here
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment