-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
52 lines (43 loc) · 1.1 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
service: serverless-toggle-vpc-example
frameworkVersion: '>=1.1.0 <2.0.0'
provider:
name: aws
runtime: nodejs10.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'us-east-1'}
vpc: ${self:custom.vpc.${self:provider.stage}}
custom:
vpc:
dev:
# If you don't want to run Lambda under a Vpc, then just give it an empty array
securityGroupIds: []
subnetIds: []
# You can add more stages here
prod:
securityGroupIds:
Fn::Split:
- ','
- ${file(secrets.${self:provider.stage}.yml):VPC_SECURITY_GROUP_IDS}
subnetIds:
Fn::Split:
- ','
- ${file(secrets.${self:provider.stage}.yml):VPC_SUBNET_IDS}
warmup:
cleanFolder: true
memorySize: 256
timeout: 10
prewarm: true
functions:
hello:
handler: handler.hello
events:
- http:
path: /
method: get
plugins:
- serverless-offline
- serverless-secrets-plugin
# Those plugins can create your Vpc automatically or discover existing
# Vpc from your AWS account
# - serverless-vpc-plugin
# - serverless-vpc-discovery