-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
77 lines (67 loc) · 1.53 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
service: bgcscraper
frameworkVersion: "3"
plugins:
- serverless-offline
provider:
name: aws
runtime: nodejs20.x
timeout: 20
iamRoleStatements:
- Effect: Allow
Action:
- dynamodb:PutItem
- dynamodb:GetItem
- dynamodb:DeleteItem
Resource:
- "arn:aws:dynamodb:as-east-1:585247497817:table/products"
functions:
scraper:
handler: dist/products/handler.handlerScrapperBd
getItems:
handler: dist/products/handlerGet.getItems
events:
- http:
path: /items
method: GET
timeout: 20
getItem:
handler: dist/products/itemGet.getItem
events:
- http:
path: /items/{id}
method: GET
request:
parameters:
paths:
id: true
deleteItem:
handler: dist/products/itemDelete.deleteItem
events:
- http:
path: /items/{id}
method: DELETE
request:
parameters:
paths:
id: true
getAllCategory:
handler: dist/categories/category.getAll
events:
- http:
path: /category
method: GET
resources:
Resources:
ProductsTable:
Type: AWS::DynamoDB::Table
Properties:
TableName: products
AttributeDefinitions:
- AttributeName: productId
AttributeType: S
KeySchema:
- AttributeName: productId
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 5
WriteCapacityUnits: 5