-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yaml
More file actions
68 lines (61 loc) · 1.46 KB
/
serverless.yaml
File metadata and controls
68 lines (61 loc) · 1.46 KB
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
service: horses-mouth-backend
frameworkVersion: "2"
useDotenv: true
provider:
name: aws
runtime: nodejs14.x
stage: v1 # Default stage to be used. Default is "dev"
region: ap-south-1
timeout: 20
lambdaHashingVersion: 20201221
apiName: ${self:service}
iam:
role:
statements:
- Effect: Allow
Action:
- s3:PutObjectAcl
- s3:GetObject
- s3:GetObjectAcl
- s3:DeleteObject
- dynamodb:PutItem
- dynamodb:DeleteItem
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:UpdateItem
- dynamodb:Query
- dynamodb:BatchGetItem
- dynamodb:BatchWriteItem
- dynamodb:ConditionCheck
Resource:
- "*"
resources:
Resources:
S3Bucket: ${file(resources/s3Bucket.yaml):S3Bucket}
S3BucketPolicy: ${file(resources/s3Bucket.yaml):S3BucketPolicy}
UsersTable: ${file(resources/usersTable.yaml):UsersTable}
functions:
api:
handler: src/lambda.handler
timeout: 10
reservedConcurrency: 5
events:
- http:
path: /{proxy+}
method: ANY
cors: true
plugins:
- serverless-plugin-typescript
- serverless-offline
- serverless-s3-remover
- serverless-dotenv-plugin
package:
include:
- api-docs.yaml
- service-account.json
custom:
remover:
buckets:
- ${env:UPLOAD_BUCKET}
S3Bucket:
name: ${env:UPLOAD_BUCKET}