-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
101 lines (91 loc) · 2.2 KB
/
serverless.yml
File metadata and controls
101 lines (91 loc) · 2.2 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
101
service: categories
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"
DOMAIN_SUFFIX: eml-be
CALLBACK_URL: http://localhost:3000
REGION: ${self:provider.region}
SERVICES: ${env:SERVICES}
iam:
role:
statements:
- Effect: Allow
Action:
- dynamodb:*
Resource: "*"
functions:
getCategory:
handler: "src/handlers/getCategory.HANDLER"
events:
- http:
path: /categories/{id}
method: GET
cors: true
getCategories:
handler: "src/handlers/getCategories.HANDLER"
events:
- http:
path: /categories
method: GET
cors: true
createCategory:
handler: "src/handlers/createCategory.HANDLER"
events:
- http:
path: /categories
method: POST
cors: true
updateCategory:
handler: "src/handlers/updateCategory.HANDLER"
events:
- http:
path: /categories/{id}
method: PATCH
cors: true
deleteCategory:
handler: "src/handlers/deleteCategory.HANDLER"
events:
- http:
path: /categories/{id}
method: DELETE
cors: true
resources:
Resources:
#dynamodb tables
CategoriesTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: categories
AttributeDefinitions:
- AttributeName: id
AttributeType: "S"
KeySchema:
- AttributeName: id
KeyType: HASH
BillingMode: PAY_PER_REQUEST