-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
81 lines (74 loc) · 2.2 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
service: spotfire
plugins:
- serverless-kms-secrets
- serverless-domain-manager
provider:
name: aws
runtime: java8
iamRoleStatements:
- Effect: Allow
Action:
- KMS:Decrypt
Resource: ${self:custom.kmsSecrets.keyArn}
environment:
SPOTIFY_REDIRECT_URI: https://${self:custom.config.ROOT_DOMAIN}/spotify/callback
SPOTIFY_CLIENT_ID_ENC: ${self:custom.kmsSecrets.secrets.SPOTIFY_CLIENT_ID}
SPOTIFY_CLIENT_SECRET_ENC: ${self:custom.kmsSecrets.secrets.SPOTIFY_CLIENT_SECRET}
package:
artifact: build/libs/spotfire-dev-all.jar
custom:
config: ${file(config.yml)}
customDomain:
domainName: spotfire.io
basePath: ''
stage: ${self:provider.stage}
createRoute53Record: true
certificateName: "*.spotfire.io"
kmsSecrets: ${file(kms-secrets.${opt:stage, self:provider.stage}.${opt:region, self:provider.region}.yml)}
functions:
hello:
handler: com.serverless.Handler
spotifyLoginRedirect:
handler: com.github.divideby0.spotfire.web.SpotifyLoginRedirectHandler
events:
- http:
path: /spotify/login
method: get
spotifyLoginCallback:
handler: com.github.divideby0.spotfire.web.SpotifyLoginCallbackHandler
events:
- http:
path: /spotify/callback
method: get
resources:
Resources:
PlaylistBucket:
Type: AWS::S3::Bucket
Properties:
BucketName: ${self:custom.config.PLAYLIST_BUCKET_NAME}
SpotfireUserTable:
Type: AWS::DynamoDB::Table
DeletionPolicy: Retain
Properties:
TableName: SpotifyUser
AttributeDefinitions:
- AttributeName: RefreshTokenHash
AttributeType: S
- AttributeName: UserId
AttributeType: S
KeySchema:
- AttributeName: RefreshTokenHash
KeyType: HASH
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1
GlobalSecondaryIndexes:
- IndexName: ById
KeySchema:
- AttributeName: UserId
KeyType: HASH
Projection:
ProjectionType: ALL
ProvisionedThroughput:
ReadCapacityUnits: 1
WriteCapacityUnits: 1