Push AWS CodePipeline Notifications into Microsoft Teams as Webhook using AWS Lambda Function
This is an improved version of https://github.com/globaldatanet/aws-codepipeline-notification
- Runtime: Python 3.8
- Code: aws-codepipeline-msteams-notification.py
- Environment Variables:
KEY | VALUE | SCOPE |
---|---|---|
WebhookUrl | https://webhook_url_here | Required |
AccountId | My AWS Account | Optional |
- Type: Event Rule
- Event Pattern:
{
"source": ["aws.codepipeline"],
"detail-type": ["CodePipeline Action Execution State Change"],
"detail": {
"state": ["SUCCEEDED", "FAILED"]
}
}
Only Success and Failures are included to avoid spamming. All the three stages Source, Build, and Deploy are included. You may adjust as required.
Refer here to generate a WebHook URL for a Teams Channel.