-
Notifications
You must be signed in to change notification settings - Fork 14
/
serverless.yml
79 lines (73 loc) · 1.68 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
74
75
76
77
78
79
service: congresstweets-auto
app: congresstweets-auto
org: alexlitel
package:
individually: true
plugins:
- serverless-offline
- serverless-webpack
- serverless-offline-sns
- serverless-s3-local
- serverless-pseudo-parameters
custom:
serverless-offline:
port: 3000
serverless-offline-sns:
port: 3001
serverless-s3-local:
port: 3002
directory: /tmp
webpack:
webpackConfig: ./webpack.config.js
provider:
name: aws
runtime: nodejs16.x
region: us-west-2
memorySize: 512
environment:
BUCKET:
Ref: congressAutoBucket
TWITTER_API_KEY: ${ssm:TWITTER_API_KEY}
TWITTER_API_SECRET: ${ssm:TWITTER_API_SECRET}
ACCESS_TOKEN: ${ssm:TWITTER_ACCESS_TOKEN}
ACCESS_TOKEN_SECRET: ${ssm:TWITTER_ACCESS_TOKEN_SECRET}
LIST_ID: ${ssm:LIST_ID}
GITHUB_TOKEN: ${ssm:GITHUB_TOKEN}
GITHUB_USER: alexlitel
TWEET_REPO: congresstweets
USER_REPO: congresstweets-accounts
NODE_ENV: production
iamRoleStatements:
- Effect: Allow
Action:
- s3:GetObject
- s3:PutObject
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- Ref: congressAutoBucket
- '/*'
resources:
Resources:
congressAutoBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: congresstweetsauto
functions:
updateData:
handler: src/handlers/updateData.handler
events:
- http:
path: update
method: post
cors: true
checkUsers:
handler: src/handlers/checkUsers.handler
events:
- schedule: cron(10 1 * * ? *)
runApp:
handler: src/handlers/runApp.handler
timeout: 250
events:
- schedule: cron(0 * * * ? *)