This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| AWSTemplateFormatVersion: '2010-09-09' | |
| Parameters: | |
| DeployBranch: | |
| Description: A git push to this branch will trigger CD with CodePipeline. | |
| Type: String | |
| Resources: | |
| WebPipelineNotifyFunction: | |
| Type: AWS::Lambda::Function |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| DevNotifyTopic: | |
| Type: AWS::SNS::Topic | |
| Properties: | |
| DisplayName: Filmhub | |
| DevNotifyKlausSMS: | |
| Type: AWS::SNS::Subscription | |
| Properties: | |
| TopicArn: !Ref DevNotifyTopic | |
| Protocol: sms | |
| Endpoint: "1310*******" # enter your cell phone |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WebPipelineNotifyPolicy: | |
| Type: AWS::Lambda::Permission | |
| Properties: | |
| Action: lambda:InvokeFunction | |
| FunctionName: !GetAtt WebPipelineNotifyFunction.Arn | |
| Principal: events.amazonaws.com | |
| SourceArn: !GetAtt WebPipelineNotifyRule.Arn | |
| WebPipelineNotifyRule: | |
| Type: AWS::Events::Rule |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Parameters: | |
| DeployBranch: | |
| Description: A git push to this branch will trigger CD with CodePipeline. | |
| Type: String |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| WebPipelineNotifyFunction: | |
| Type: AWS::Lambda::Function | |
| Properties: | |
| Code: | |
| ZipFile: | | |
| var SNS = require('aws-sdk/clients/sns') | |
| var sns = new SNS() | |
| exports.handler = async (event) => { | |
| console.log(JSON.stringify(event)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var SNS = require('aws-sdk/clients/sns') | |
| var sns = new SNS() | |
| exports.handler = async (event) => { | |
| console.log(JSON.stringify(event)) | |
| const params = { | |
| Message: `Deploy of ${process.env.BRANCH} ${event.detail.state}`, | |
| TopicArn: process.env.TOPIC_ARN, | |
| Subject: `Deploy ${event.detail.state}` | |
| } |