-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathserverless.yml
More file actions
71 lines (66 loc) · 1.58 KB
/
Copy pathserverless.yml
File metadata and controls
71 lines (66 loc) · 1.58 KB
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
service: pool-temp
plugins:
- serverless-plugin-typescript
- serverless-offline
- serverless-dotenv-plugin
- serverless-plugin-aws-alerts
provider:
name: aws
runtime: nodejs16.x
region: eu-west-1
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:PutObject"
Resource:
- "arn:aws:s3:::pool-temperatures/*"
- Effect: "Allow"
Action:
- "s3:GetObject"
Resource:
- "arn:aws:s3:::pool-temperatures/*"
custom:
alerts:
stages:
- dev
- production
topics:
alarm:
topic: ${self:service}-${opt:stage}-alerts-alarm
notifications:
- protocol: email
endpoint: rob@squires-associates.com # Change this to your email address
definitions:
httpApiAlarm:
description: 'Http 4XX Responses'
prefixTemplate: $[stackName]
namespace: AWS/ApiGateway
metric: 4XXError
period: 60
statistic: Sum
threshold: 1
evaluationPeriods: 1
datapointsToAlarm: 1
comparisonOperator: GreaterThanOrEqualToThreshold
omitDefaultDimension: true
dimensions:
- Name: ApiName
Value: ${opt:stage}-${self:service}
alarms:
- functionErrors
functions:
ingestTweet:
handler: src/handler.ingestTweet
timeout: 30
alarms:
- httpApiAlarm
events:
- http:
path: /ingest-tweet
method: post
private: false
refreshLatestReading:
handler: src/handler.refreshLatestReading
timeout: 30
events:
- schedule: cron(0 3 * * ? *)