-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
84 lines (80 loc) · 2.09 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
# serverless.yml
service: natyAwsProject
frameworkVersion: "3"
provider:
name: aws
runtime: nodejs18.x
region: ${env:AWS_DEFAULT_REGION, "us-east-1"}
stage: ${env:STAGE, "dev"}
httpApi:
cors: true
# Resources
resources:
- ${file(resources/dynamoTable.yml)}
- ${file(resources/lambdaRole.yml)}
functions:
getT:
handler: src/transferencias/consultar.handler
events:
- httpApi:
path: /transferencias
method: get
environment:
TABLE_NAME: ${self:provider.stage}-transfers
role: LambdasDefaultRole
postT:
handler: src/transferencias/insertar.handler
events:
- httpApi:
path: /transferencias
method: post
environment:
TABLE_NAME: ${self:provider.stage}-transfers
role: LambdasDefaultRole
getTbyId:
handler: src/transferencias/consultarId.handler
events:
- httpApi:
path: /transferencias/{idTransfer}
method: get
environment:
TABLE_NAME: ${self:provider.stage}-transfers
role: LambdasDefaultRole
deleteTbyId:
handler: src/transferencias/eliminar.handler
events:
- httpApi:
path: /transferencias/{idTransfer}
method: delete
environment:
TABLE_NAME: ${self:provider.stage}-transfers
role: LambdasDefaultRole
putTbyId:
handler: src/transferencias/actualizar.handler
events:
- httpApi:
path: /transferencias/{idTransfer}
method: put
environment:
TABLE_NAME: ${self:provider.stage}-transfers
role: LambdasDefaultRole
initTable:
handler: src/init/index.handler
environment:
TABLE_NAME: ${self:provider.stage}-transfers
BUCKET_NAME: ${self:provider.stage}-transfers-bucket-${env:POSTFIX_RANDOM}
role: LambdasDefaultRole
events:
- s3:
bucket: ${self:provider.stage}-transfers-bucket-${env:POSTFIX_RANDOM}
event: s3:ObjectCreated:*
rules:
- prefix: transfers
- suffix: .json
plugins:
- serverless-offline
custom:
serverless-offline:
httpPort: 3000
host: 0.0.0.0
reloadHandler: true