-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
67 lines (54 loc) · 1.63 KB
/
serverless.yml
File metadata and controls
67 lines (54 loc) · 1.63 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
frameworkVersion: ">=3.1.0"
service: NODE-LAMBDA
provider:
name: aws
runtime: nodejs14.x
stage: ${opt:stage, 'dev'}
region: eu-central-1.api.aws
timeout: 30 #Default Lambda timeout
memorySize: 128 #Default Lambda Memory Size
versionFunctions: false # No functions versioning
# Instruct Serverless to use an existing IAM role for all Lambda functions
iam:
role: ${self:custom.secrets.EXECUTION_ROLE}
#deploymentRole: ${self:custom.secrets.DEPLOYMENT_ROLE}
#Global Environment variables
environment:
RDS_DATABASE: ${self:custom.secrets.RDS_DATABASE}
RDS_HOSTNAME: ${self:custom.secrets.RDS_HOSTNAME}
RDS_PASSWORD: ${self:custom.secrets.RDS_PASSWORD}
RDS_USERNAME: ${self:custom.secrets.RDS_USERNAME}
# If you use VPC then both securityGroupIds and subnetIds are required
vpc:
securityGroupIds:
- ${self:custom.secrets.SECURITY_GROUP_ID}
subnetIds:
- ${self:custom.secrets.SUBNET1_ID}
- ${self:custom.secrets.SUBNET2_ID}
package:
individually: true
excludeDevDependencies: true
patterns:
- '!.git/**'
- '!.vscode/**'
- '!.idea/**'
# Custom variables
custom:
secrets: ${file(./configs/${self:provider.stage}.json)}
webpack:
includeModules: true # enable auto-packing of external modules
serverless-offline:
host: '0.0.0.0'
splitStacks:
perFunction: true
perType: true
prune:
automatic: true
number: 3
plugins:
- serverless-webpack
- serverless-offline
- serverless-prune-plugin
functions: ${file(serverless-dynamic.js)}
# Infrastrucure - Cloud Formation
resources: # CloudFormation template syntax