-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
122 lines (113 loc) · 2.8 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
###############################
###############################
service: serverlesscatalogs
package:
individually: True
exclude:
# Exclude everything first.
- '**/*'
- secrets.yml
provider:
name: aws
runtime: python3.6
stage: dev
region: us-west-2
memorySize: 3008 # Overwrite the default memory size. Default is 1024
#role: arn:aws:iam::938975972071:role/service-role/PUB_catalog_role
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:*"
Resource:
Fn::Join:
- ""
- - "arn:aws:s3:::publicaciones-sedesol"
- - "arn:aws:s3:::*"
environment:
HOST_ES: "${self:custom.secrets.HOST_ES}"
functions:
cuaps-pub:
handler: cuaps-pub/wrap.handler
package:
include:
- cuaps-pub/**
events:
- s3:
bucket: serverlesscatalogs
event: s3:ObjectCreated:*
rules:
- suffix: .csv
pub-monthly-gen:
handler: pub-monthly-gen/wrap.handler
package:
include:
- pub-monthly/**
events:
- existingS3:
bucket: publicaciones-sedesol
events:
- s3:ObjectCreated:*
rules:
- prefix: pub-publicacion/
pub-monthly:
handler: pub-monthly/wrap.handler
package:
include:
- pub-monthly/**
events:
- existingS3:
bucket: publicaciones-sedesol
events:
- s3:ObjectCreated:*
rules:
- prefix: catalogo-mensual/
- suffix: .csv
pub-etl:
handler: pub-etl/wrap.handler
package:
include:
- pub-monthly/**
events:
- s3:
bucket: pub-raw
event: s3:ObjectCreated:*
rules:
- prefix: decoded_txt/
- suffix: .txt
custom:
pyIndividually:
wrap:cuaps-pub: cuaps-pub/handler.catalog
wrap:pub-monthly: pub-monthly/handler.catalog
wrap:pub-monthly-gen: pub-monthly/handler.create_catalog
wrap:pub-etl: pub-etl/handler.emr_clean
# pythonRequirements:
# zip: true
# dockerizePip: non-linux
# pythonBin: /usr/bin/python3
# #package:
# # excludeDevDependencies: true
stage: ${opt:stage, self:provider.stage}
secrets: ${file(secrets.yml):${self:custom.stage}}
resources:
Resources:
serverlesscatalogs:
Type: AWS::S3::Bucket
Properties:
CorsConfiguration:
CorsRules:
- AllowedHeaders:
- "*"
AllowedMethods:
- GET
- POST
- PUT
- DELETE
AllowedOrigins:
- "*"
plugins:
- serverless-python-individually
- serverless-plugin-existing-s3
#- serverless-python-requirements
#custom:
# pythonRequirements:
# zip: true