-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
53 lines (49 loc) · 1.4 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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: An AWS SAM template for deploying a Probot app
Parameters:
SAMDeploymentRole:
Type: String
Description: The ARN of the IAM role that AWS Lambda assumes when it executes your function.
WebhookSecret:
Type: String
Description: The name of the SSM parameter that contains the webhook secret
Default: /probot/webhook_secret
AppId:
Type: String
Description: GitHub App ID
GitHubToken:
Type: String
Description: GitHub token for authentication
Resources:
ProbotApi:
Type: AWS::Serverless::Api
Properties:
StageName: Prod
ProbotFunction:
Type: AWS::Serverless::Function
Properties:
Handler: index.handler
Runtime: nodejs20.x
Timeout: 10
CodeUri: ./
Role: !Ref SAMDeploymentRole
Environment:
Variables:
NODE_ENV: production
WEBHOOK_SECRET: !Ref WebhookSecret
APP_ID: !Ref AppId
PROBOT_GITHUB_TOKEN: !Ref GitHubToken
Events:
HttpPost:
Type: Api
Properties:
Path: /webhook
Method: post
RestApiId:
Ref: ProbotApi
Outputs:
ProbotFunctionApi:
Description: 'API Gateway endpoint URL for Probot function'
Value:
Fn::Sub: https://${ProbotApi}.execute-api.${AWS::Region}.amazonaws.com/Prod/webhook