-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
executable file
·84 lines (80 loc) · 2.57 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
org: recursivechaos
app: tool-swap
service: tool-swap-serverless
provider:
name: aws
region: us-east-1
stage: dev
memorySize: 256
runtime: nodejs12.x
iam:
role: LambdaRole
environment:
AURORA_HOST: ${self:custom.AURORA.HOST}
AURORA_PORT: ${self:custom.AURORA.PORT}
DB_NAME: ${self:custom.DB_NAME}
USERNAME: ${self:custom.USERNAME}
PASSWORD: ${self:custom.PASSWORD}
custom:
DB_NAME: toolswap
USERNAME: master
PASSWORD: password
AURORA:
HOST:
Fn::GetAtt: [AuroraRDSCluster, Endpoint.Address]
PORT:
Fn::GetAtt: [AuroraRDSCluster, Endpoint.Port]
VPC_CIDR: 10
plugins:
- serverless-pseudo-parameters
resources:
Resources:
LambdaRole: ${file(./resource/LambdaRole.yml)}
ServerlessInternetGateway: ${file(./resource/ServerlessInternetGateway.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)}
ServerlessSubnetGroup: ${file(./resource/ServerlessSubnetGroup.yml)}
ServerlessSecurityGroup: ${file(./resource/ServerlessSecurityGroup.yml)}
RouteTablePublic: ${file(./resource/RouteTablePublic.yml)}
RoutePublic: ${file(./resource/RoutePublic.yml)}
RouteTableAssociationSubnetA: ${file(./resource/RouteTableAssociationSubnetA.yml)}
RouteTableAssociationSubnetB: ${file(./resource/RouteTableAssociationSubnetB.yml)}
RouteTableAssociationSubnetC: ${file(./resource/RouteTableAssociationSubnetC.yml)}
AuroraRDSClusterParameter: ${file(./resource/AuroraRDSClusterParameter.yml)}
AuroraRDSInstanceParameter: ${file(./resource/AuroraRDSInstanceParameter.yml)}
AuroraRDSCluster: ${file(./resource/AuroraRDSCluster.yml)}
AuroraRDSInstance: ${file(./resource/AuroraRDSInstance.yml)}
functions:
getUser:
handler: src/routes/getUser.getUser
events:
- httpApi:
path: /users/user/{userId}
method: get
getUsers:
handler: src/routes/getUsers.getUsers
events:
- httpApi:
path: /users
method: get
postUser:
handler: src/routes/postUser.postUser
events:
- httpApi:
path: /users/user
method: post
getHealth:
handler: src/routes/getHealth.getHealth
events:
- httpApi:
path: /health
method: get
postInit:
handler: src/routes/postInit.postInit
events:
- httpApi:
path: /admin/init
method: post