-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
100 lines (92 loc) · 2.11 KB
/
serverless.yml
File metadata and controls
100 lines (92 loc) · 2.11 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
service: addresses
frameworkVersion: "2"
useDotenv: true
plugins:
- serverless-webpack
- serverless-dynamodb-local
- serverless-offline-dotenv
- serverless-offline
custom:
webpack:
webpackConfig: "./webpack.config.js"
includeModules:
forceExclude:
- aws-sdk
packager: "npm"
serverless-offline:
httpPort: 4000
ignoreJWTSignature: true
provider:
name: aws
region: eu-central-1
# profile: swexception
runtime: nodejs12.x
lambdaHashingVersion: "20201221"
stage: ${opt:stage, 'dev'}
apiGateway:
restApiId: 95kq9eggu9
restApiRootResourceId: zsd84g8moe
environment:
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1"
REGION: ${self:provider.region}
SERVICES: ${env:SERVICES}
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:*
Resource: "*"
functions:
getAddress:
handler: "src/handlers/getAddress.HANDLER"
events:
- http:
path: /addresses/{id}
method: GET
cors: true
getAddresses:
handler: "src/handlers/getAddresses.HANDLER"
events:
- http:
path: /addresses
method: GET
cors: true
createAddress:
handler: "src/handlers/createAddress.HANDLER"
events:
- http:
path: /addresses
method: POST
cors: true
deleteAddress:
handler: "src/handlers/deleteAddress.HANDLER"
events:
- http:
path: /addresses/{id}
method: DELETE
cors: true
updateAddress:
handler: "src/handlers/updateAddress.HANDLER"
events:
- http:
path: /addresses/{id}
method: PATCH
cors: true
resources:
Resources:
AddressesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: addresses
AttributeDefinitions:
- AttributeName: userid
AttributeType: "S"
- AttributeName: id
AttributeType: "S"
KeySchema:
- AttributeName: userid
KeyType: HASH
- AttributeName: id
KeyType: RANGE
BillingMode: PAY_PER_REQUEST