forked from daisyUniverse/TwitFix
-
-
Notifications
You must be signed in to change notification settings - Fork 52
/
Copy pathserverless.yml
81 lines (74 loc) · 2.2 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
80
81
service: vxTwitter
provider:
name: aws
runtime: python3.12
stage: dev
architecture: arm64
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Resource:
- { "Fn::GetAtt": ["vxTwitterDynamoTable", "Arn" ] }
environment:
VXTWITTER_CACHE_TABLE: ${self:custom.tableName}
RUNNING_SERVERLESS: 1
VXTWITTER_LINK_CACHE: ${env:VXTWITTER_LINK_CACHE, 'json'}
VXTWITTER_DATABASE: ${env:VXTWITTER_DATABASE, 'none'}
VXTWITTER_METHOD: ${env:VXTWITTER_METHOD, 'hybrid'}
VXTWITTER_COLOR: ${env:VXTWITTER_COLOR, '#1DA1F2'}
VXTWITTER_APP_NAME: ${env:VXTWITTER_APP_NAME, 'vxTwitter'}
VXTWITTER_REPO: ${env:VXTWITTER_REPO, 'https://github.com/dylanpdx/BetterTwitFix'}
VXTWITTER_URL: ${env:VXTWITTER_URL, 'https://vxtwitter.com'}
VXTWITTER_COMBINATION_METHOD: ${env:VXTWITTER_COMBINATION_METHOD, 'local'}
VXTWITTER_GIF_CONVERT_API: ${env:VXTWITTER_GIF_CONVERT_API, ''}
VXTWITTER_WORKAROUND_TOKENS: ${env:VXTWITTER_WORKAROUND_TOKENS, ''}
#VXTWITTER_PROXIES: ${env:VXTWITTER_PROXIES, ''}
package:
patterns:
- '!node_modules/**'
- '!venv/**'
plugins:
- serverless-wsgi
- serverless-python-requirements
- serverless-plugin-common-excludes
- serverless-plugin-include-dependencies
functions:
vxTwitterApp:
handler: wsgi_handler.handler
url: true
timeout: 15
memorySize: 500
layers:
- Ref: PythonRequirementsLambdaLayer
custom:
tableName: 'tweets-table-${self:provider.stage}'
wsgi:
app: twitfix.app
pythonRequirements:
layer: true
dockerizePip: true
dockerRunCmdExtraArgs: ['--platform','linux/arm64']
resources:
Resources:
vxTwitterDynamoTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: tweet
AttributeType: S
KeySchema:
-
AttributeName: tweet
KeyType: HASH
TableName: ${self:custom.tableName}
BillingMode: PAY_PER_REQUEST
TimeToLiveSpecification:
AttributeName: ttl
Enabled: true