-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
132 lines (127 loc) · 2.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
service: onboarding-assistant
frameworkVersion: '^3.0.0'
plugins:
- serverless-domain-manager
- serverless-prune-plugin
- serverless-python-requirements
- serverless-plugin-warmup
- serverless-wsgi
provider:
iamRoleStatements:
-
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
Effect: Allow
Resource:
- { "Fn::GetAtt": ["ShortenerDynamoDbTable", "Arn" ] }
-
Action:
- "secretsmanager:GetSecretValue"
Effect: Allow
Resource:
- "${env:SECRET_ARN}"
-
Action:
- "lambda:InvokeFunction"
Effect: Allow
Resource: "*"
name: aws
region: us-east-1
runtime: python3.8
stage: ${opt:stage, "production"}
environment:
SECRET_ARN: "${env:SECRET_ARN}"
FUNCTION_PREFIX: "${self:service}-${self:provider.stage}-"
SHORTENER_TABLE: ${self:custom.shortenerDynamoDbTableName}
functions:
form:
handler: code/handler.handle_form_submission
memorySize: 128
runtime: python3.8
timeout: 25
analytics:
handler: analytics.event_worker
memorySize: 128
runtime: python3.8
timeout: 25
events:
events:
-
http:
method: any
path: /events
handler: wsgi_handler.handler
memorySize: 128
runtime: python3.8
timeout: 25
interactivity:
events:
-
http:
method: any
path: /interactivity
handler: wsgi_handler.handler
memorySize: 128
runtime: python3.8
timeout: 25
shortener:
events:
-
http:
method: any
path: /{any+}
handler: wsgi_handler.handler
memorySize: 128
runtime: python3.8
timeout: 25
menu:
events:
-
http:
method: any
path: /search
integration: lambda
warmup:
default:
enabled: true
handler: code/menu/handler.menu
memorySize: 128
runtime: nodejs18.x
resources:
Resources:
ShortenerDynamoDbTable:
Type: 'AWS::DynamoDB::Table'
Properties:
AttributeDefinitions:
-
AttributeName: code
AttributeType: S
KeySchema:
-
AttributeName: code
KeyType: HASH
BillingMode: PAY_PER_REQUEST
TableName: ${self:custom.shortenerDynamoDbTableName}
custom:
customDomain:
domainName: 'links.helpful.directory'
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
pythonRequirements:
dockerizePip: true
usePoetry: false
fileName: code/requirements.txt
vendor: code/modules
warmup:
default:
enabled: false
wsgi:
app: code/handler.application
packRequirements: false
shortenerDynamoDbTableName: 'shortener-table-${self:provider.stage}'