-
Notifications
You must be signed in to change notification settings - Fork 0
/
template.yaml
79 lines (73 loc) · 2.24 KB
/
template.yaml
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: Spliiter de Resumen de cuentas
# More info about Globals: https://github.com/awslabs/serverless-application-model/blob/master/docs/globals.rst
Globals:
Function:
Architectures:
- x86_64
Environment:
Variables:
REGION : us-east-1
Handler: app.lambda_handler
Runtime: python3.9
Timeout: 180
Tags:
- Key: "project"
Value: "Resumen de Cuenta"
Resources:
splitter_lambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./lambdas/python/splitter
Description: Obtiene y parsea la data del CSV e invoca a la lambda "core".
Environment:
Variables:
CORE_LAMBDA : !GetAtt core_lambda.Arn
Events:
S3Event:
Type: S3
Properties:
Bucket:
Ref: S3Bucket
Events:
- 's3:ObjectCreated:*'
Filter:
S3Key:
Rules:
- Name: prefix
Value: input/
- Name: suffix
Value: .csv
FunctionName: splitter
core_lambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./lambdas/python/core
Description: Recibe DNI, fecha_desde, fecha_hasta. Realiza las consultas necesarias a la DB y genera un json para invocar a "PDFCreator".
Environment:
Variables:
LAMBDA_PDF_CREATE : !GetAtt PDFCreator.Arn
DB_NAME : XXXXX
DB_HOST : XXXXX
DB_USER : XXXXX
DB_PASSWORD : XXXXX
FunctionName: core
PDFCreator_lambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: ./lambdas/nodeJs/PDFCreator
Description: Recibe un JSON y genera un PDF
Environment:
Variables:
LAMBDA_PDF_CREATE : !GetAtt splitter_lambda.Arn
DB_NAME : XXXXX
DB_HOST : XXXXX
DB_USER : XXXXX
DB_PASSWORD : XXXXX
FunctionName: PDFCreator
Runtime: nodejs12.x
S3Bucket:
Type: 'AWS::S3::Bucket'
Properties:
BucketName: 'recumen-cuenta-s3'