-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
55 lines (48 loc) · 1.46 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
service: tune-buddies
provider:
name: aws
runtime: python3.7
# TODO: Move to a fetch-spotify-access-token local role.
# iamRoleStatements:
# TODO add DynamoDB roles,
package:
exclude:
- "**"
include:
- tune_buddies/**
functions:
fetch-spotify-access-token:
description: Obtain a spotify access token given a spotify refresh token
handler: tune_buddies/serverless/fetch_spotify_access_token.handler
environment:
SPOTIFY_CLIENT_ID: ${self:custom.spotifyClientId}
SPOTIFY_CLIENT_SECRET: CHANGEME
events:
- http:
path: /accesstoken
method: post # to match POST https://accounts.spotify.com/api/token
cors: true
fetch-spotify-refresh-token:
description: Obtain a spotify refresh token given a spotify auth token
handler: tune_buddies/serverless/fetch_spotify_refresh_token.handler
environment:
SPOTIFY_CLIENT_ID: ${self:custom.spotifyClientId}
SPOTIFY_CLIENT_SECRET: CHANGEME
events:
- http:
path: /refreshtoken
method: post # to match POST https://accounts.spotify.com/api/token
cors: true
plugins:
- serverless-python-requirements
- serverless-domain-manager
- serverless-finch
custom:
spotifyClientId: CHANGEME
customDomain:
domainName: api.tunebunnies.com
certificateName: '*.tunebunnies.com'
createRoute53Record: true
stage: ${self:provider.stage}
resources:
- ${file(tune_buddies/resources/dynamodb-table.yml)}