-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtemplate.yaml
48 lines (41 loc) · 1.61 KB
/
template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
## Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
## SPDX-License-Identifier: MIT-0
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Introduction to serverless for developers:part1 GitHub to Slack
##########################################################################
# Parameters & Globals #
##########################################################################
Parameters:
slackUrl:
Type: String
Description: your Slack Webhook Url.
Default: ""
Resources:
##########################################################################
# Lambda Function #
##########################################################################
webhookHandler:
Type: AWS::Serverless::Function
Properties:
Description: A github webhook handler
CodeUri: src/
Handler: app.handler
Runtime: nodejs12.x
Timeout: 3
Environment:
Variables:
slackEndpoint: !Ref slackUrl
Events:
HttpApiEvent:
Type: HttpApi
Properties:
Path: /
Method: POST
##########################################################################
# Stack outputs #
##########################################################################
Outputs:
GitHubEndpoint:
Description: "The star invocation URl to provide to github webhook"
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com"