-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
99 lines (98 loc) · 2.49 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
# Welcome to Serverless!
#
# This file is the main serverless config file for this service.
# For full config options, see docs.serverless.com
service: quiccasa
frameworkVersion: '2'
useDotenv: true
provider:
name: aws
runtime: nodejs12.x
profile: serverless
lambdaHashingVersion: 20201221
apiGateway:
shouldStartNameWithService: true
stage: ${opt:stage, "dev"}
region: eu-west-1
deploymentBucket: quiccasa-dev-serverlessdeploymentbucket-ajudt9uilmg6
environment:
bucket: ${self:resources.Resources.NewResource.Properties.BucketName}
region: ${self:provider.region}
service: ${self:service}
iam:
role:
statements:
- Effect: "Allow"
Action:
- "ses:SendEmail"
Resource:
- "*"
Condition:
StringEquals:
ses:FromAddress:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource: { "Fn::Join": [ "", [ "arn:aws:s3:::", "quiccasa-bucket-dev" ] ] }
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
- "s3:DeleteObject"
Resource: { "Fn::Join": [ "", [ "arn:aws:s3:::", "quiccasa-bucket-dev", "/*" ] ] }
functions:
crawl:
handler: index.crawl
events:
- http:
method: get
path: crawl
# - schedule: rate(10 minutes)
# - schedule: cron(0/30 6-22 ? * MON-FRI *) # times are GMT (6 => GMT-1 summertime => 8, 6 => GMT-1 wintertime => 7)
- schedule: cron(0 6-20/4 ? * MON-FRI *) # times are GMT
- schedule: cron(0 6-20/8 ? * SAT-SUN *) # times are GMT
timeout: 30 # seconds, default is 6
home:
handler: index.home
events:
- http:
method: get
path: /home
subscribe:
handler: index.subscribe
events:
- http:
method: get
path: subscribe
reset:
handler: index.reset
events:
- http:
method: get
path: reset
unsubscribe:
handler: index.unsubscribe
events:
- http:
method: get
path: unsubscribe
actionUnsubscribe:
handler: index.actionUnsubscribe
events:
- http:
method: get
path: actionUnsubscribe
package:
package:
exclude:
- private/**
- node_modules/**
- tmp/**
# - website/**
resources:
Resources:
NewResource:
Type: AWS::S3::Bucket
Properties:
BucketName: quiccasa-bucket-dev