-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
54 lines (50 loc) · 1023 Bytes
/
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
service: aqi-monitor
package:
exclude:
- test/**
- coverage/**
- config/**
- flow-typed/**
- src/**
provider:
name: aws
runtime: nodejs8.10
stage: ${opt:config}
region: ${file(config/${opt:config}.yml):REGION}
memorySize: 128
timeout: 30
versionFunctions: false
environment:
${file(config/${opt:config}.yml)}
iamRoleStatements:
- Effect: "Allow"
Action:
- "s3:ListBucket"
Resource:
- Fn::GetAtt:
- DataS3Bucket
- Arn
- Effect: "Allow"
Action:
- "s3:GetObject"
- "s3:PutObject"
Resource:
- 'Fn::Join':
- '/'
- - Fn::GetAtt:
- DataS3Bucket
- Arn
- '*'
functions:
cron:
handler: lib/handler.cron
description: Fetch and Handle AQI
environment:
DATA_BUCKET_NAME:
"Ref": DataS3Bucket
events:
- schedule: rate(11 minutes)
resources:
Resources:
DataS3Bucket:
Type: AWS::S3::Bucket