forked from github/safe-settings
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request github#436 from github/sam-template
AWS sam template
- Loading branch information
Showing
2 changed files
with
59 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,3 +132,7 @@ private-key.pem | |
*.pem | ||
.vscode | ||
yarn.lock | ||
|
||
# aws sam stuff | ||
.aws-sam | ||
samconfig.toml |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
AWSTemplateFormatVersion: "2010-09-09" | ||
Transform: AWS::Serverless-2016-10-31 | ||
Description: Safe Settings Serverless GitHub app | ||
|
||
Globals: | ||
Function: | ||
Tags: | ||
owner: !Ref owner | ||
|
||
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 in base64 format | ||
Type: String | ||
environment: | ||
Description: Environment deployment of your GitHub App | ||
Type: String | ||
logLevel: | ||
Description: Log level for your GitHub App | ||
Type: String | ||
owner: | ||
Description: Owner of the GitHub App | ||
Type: String | ||
|
||
Resources: | ||
webhooks: | ||
Type: AWS::Serverless::Function | ||
Properties: | ||
FunctionName: !Sub ${AWS::StackName}-webhooks | ||
Description: Safe Settings GitHub App | ||
CodeUri: . | ||
Handler: handler.webhooks | ||
Runtime: nodejs16.x | ||
MemorySize: 256 | ||
Timeout: 900 | ||
Events: | ||
ApiEvent: | ||
Type: HttpApi | ||
Environment: | ||
Variables: | ||
APP_ID: !Ref githubAppId | ||
WEBHOOK_SECRET: !Ref githubWebhookSecret | ||
PRIVATE_KEY: !Ref githubPrivateKey | ||
NODE_ENV: !Ref environment | ||
LOG_LEVEL: !Ref logLevel | ||
|
||
Outputs: | ||
WebhooksUrl: | ||
Description: "Endpoint URL" | ||
Value: !Sub "https://${ServerlessHttpApi}.execute-api.${AWS::Region}.amazonaws.com/" |