-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
64 lines (59 loc) · 1.99 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
service: nat-sls
provider:
name: aws
region: eu-west-1
stage: dev
memorySize: 256
runtime: nodejs12.x
role: LambdaRole
environment:
package:
individually: true
resources:
Conditions:
IsProd:
Fn::Equals:
- ${opt:stage, self:provider.stage}
- prod
IsDev:
Fn::Equals:
- ${opt:stage, self:provider.stage}
- dev
Resources:
LambdaRole: ${file(./resource/LambdaRole.yml)}
LambdaSecurityGroup: ${file(./resource/LambdaSecurityGroup.yml)}
ServerlessVPC: ${file(./resource/ServerlessVPC.yml)}
ServerlessVPCGA: ${file(./resource/ServerlessVPCGA.yml)}
ServerlessSubnetA: ${file(./resource/ServerlessSubnetA.yml)}
ServerlessSubnetB: ${file(./resource/ServerlessSubnetB.yml)}
ServerlessSubnetC: ${file(./resource/ServerlessSubnetC.yml)}
ServerlessInternetGateway: ${file(./resource/ServerlessInternetGateway.yml)}
OutgoingRouteTable: ${file(./resource/OutgoingRouteTable.yml)}
OutgoingRoute: ${file(./resource/OutgoingRoute.yml)}
PublicSubnet: ${file(./resource/PublicSubnet.yml)}
PublicSubnetAssociation: ${file(./resource/PublicSubnetAssociation.yml)}
NatInstance: ${file(./resource/NatInstance.yml)}
NatInstanceSG: ${file(./resource/NatInstanceSG.yml)}
NatRoute: ${file(./resource/NatRoute.yml)}
PrivateSRTA: ${file(./resource/PrivateSRTA.yml)}
PrivateSRTB: ${file(./resource/PrivateSRTB.yml)}
PrivateSRTC: ${file(./resource/PrivateSRTC.yml)}
PrivateRouteTable: ${file(./resource/PrivateRouteTable.yml)}
NatEIP: ${file(./resource/NatEIP.yml)}
NatGateway: ${file(./resource/NatGateway.yml)}
NatGatewayRoute: ${file(./resource/NatGatewayRoute.yml)}
functions:
nat:
vpc:
securityGroupIds:
- !GetAtt LambdaSecurityGroup.GroupId
subnetIds:
- Ref: ServerlessSubnetA
- Ref: ServerlessSubnetB
- Ref: ServerlessSubnetC
handler: src/index.handler
events:
- http:
path: /nat
method: get
cors: true