-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
79 lines (61 loc) · 1.83 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
org: timjr
app: strava-data-gen
service: strava-data-gen
frameworkVersion: '3'
custom:
stage: ${opt:stage, self:provider.stage}
region: ${opt:region, self:provider.region}
webBucket: www.trodger.com
dataStoreBucket: ${self:service}-${self:custom.stage}-activities-data-store
activitiesTopic: ${self:service}-${self:custom.stage}-activities
pythonRequirements:
dockerizePip: non-linux
provider:
name: aws
runtime: python3.8
memorySize: 128
stage: dev
region: eu-west-2
iamRoleStatements:
- Effect: Allow
Action:
- "secretsmanager:*"
Resource: "*"
- Effect: Allow
Action: 's3:ListBucket'
Resource: '*'
- Effect: Allow
Action: 's3:CreateBucket'
Resource: '*'
- Effect: Allow
Action: 's3:PutObject'
Resource:
- { "Fn::Join": ["", ["arn:aws:s3:::", "${self:custom.dataStoreBucket}", "/*" ] ] }
- Effect: Allow
Action: 's3:GetObject'
Resource:
- { "Fn::Join": ["", ["arn:aws:s3:::", "${self:custom.dataStoreBucket}", "/*" ] ] }
environment:
SM_SECRET_NAME: StravaAPI
SM_ACCESS_TOKEN_NAME: Strava_${self:custom.stage}_AccessToken
STRAVA_CLIENT_ID: 73413
STRAVA_AUTHZ_URL: "https://www.strava.com/oauth/token"
STRAVA_ACTIVITIES_URL: "https://www.strava.com/api/v3/athlete/activities"
APP_REGION: ${self:custom.region}
WEB_BUCKET: ${self:custom.webBucket}
DATA_STORE_BUCKET: ${self:custom.dataStoreBucket}
functions:
rateHandler:
timeout: 60
handler: functions/handler.run
events:
# Invoke Lambda function every hour - really want this between 8am & 8pm
- schedule: rate(1 hour)
populate:
timeout: 60
handler: functions/populate.run
# reportHeartRate:
# timeout: 60
# handler: functions/reportHeartRate.run
plugins:
- serverless-python-requirements