generated from probot/example-aws-lambda-serverless
-
Notifications
You must be signed in to change notification settings - Fork 1
/
template.yml
38 lines (36 loc) · 1.01 KB
/
template.yml
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
AWSTemplateFormatVersion: "2010-09-09"
Transform: AWS::Serverless-2016-10-31
Description: Serverless GitHub app
Parameters:
githubAppId:
Description: The App ID of your GitHub app
Type: String
githubWebhookSecret:
Description: The webhook secret of your GitHub app
Type: String
githubPrivateKey:
Description: The private key of your GitHub app
Type: String
Resources:
webhooks:
Type: AWS::Serverless::Function
Properties:
FunctionName: !Sub ${AWS::StackName}-webhooks
Description: Basic Auth Funtion
CodeUri: .
Handler: handler.webhooks
Runtime: nodejs18.x
MemorySize: 256
Timeout: 20
Events:
ApiEvent:
Type: HttpApi
Environment:
Variables:
APP_ID: !Ref githubAppId
WEBHOOK_SECRET: !Ref githubWebhookSecret
PRIVATE_KEY: !Ref githubPrivateKey
Outputs:
WebhooksUrl:
Description: "Endpoint URL"
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/"