This repository has been archived by the owner on Sep 12, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
serverless.yml
73 lines (68 loc) · 1.85 KB
/
serverless.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
service: demo-twitter-buildmeavideo
frameworkVersion: '3'
useDotenv: true
plugins:
- serverless-prune-plugin
custom:
project: ${self:service}
prune:
automatic: true
number: 5
provider:
name: aws
runtime: nodejs16.x
stage: demo
region: ap-southeast-2
lambdaHashingVersion: '20201221'
logRetentionInDays: 30
deploymentBucket:
name: ${env:DEPLOYMENT_BUCKET}
blockPublicAccess: true
iamRoleStatements:
- Effect: 'Allow'
Action:
- 'lambda:InvokeFunction'
- 'lambda:InvokeAsync'
Resource:
- 'arn:aws:lambda:${opt:region, self:provider.region}:*:function:${opt:stage, self:provider.stage}-twitter-buildmeavideo-demo-reply'
environment:
REGION: ${opt:region, self:provider.region}
STAGE: ${opt:stage, self:provider.stage}
TWITTER_API_KEY: ${env:TWITTER_API_KEY}
TWITTER_API_KEY_SECRET: ${env:TWITTER_API_KEY_SECRET}
TWITTER_ACCESS_TOKEN: ${env:TWITTER_ACCESS_TOKEN}
TWITTER_TOKEN_SECRET: ${env:TWITTER_TOKEN_SECRET}
TWITTER_ID: ${env:TWITTER_ID}
SHOTSTACK_API_KEY: ${env:SHOTSTACK_API_KEY}
SHOTSTACK_BASE_URL: ${env:SHOTSTACK_BASE_URL}
SHOTSTACK_ENV: ${env:SHOTSTACK_ENV}
SHOTSTACK_WEBHOOK_URL: ${env:SHOTSTACK_WEBHOOK_URL}
package:
exclude:
- .env
- .env.dist
- .gitignore
- .eslintrc.js
- README.md
functions:
process:
handler: handlers/process/handler.process
description: Process any new mentions
timeout: 300
memorySize: 128
events:
- schedule: rate(1 minute)
webhook:
handler: handlers/webhook/handler.process
description: Respond to webhook
timeout: 30
memorySize: 128
events:
- httpApi:
method: POST
path: /webhook/{id}
reply:
handler: handlers/reply/handler.process
description: Upload rendered videos to Twitter and tweet
timeout: 30
memorySize: 128