-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
116 lines (115 loc) · 3 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
service: pricecheck
package:
exclude:
- '*/**'
provider:
name: aws
runtime: python3.6
timeout: 30
versionFunctions: false
region: ap-southeast-1
environment:
client_id: ${ssm:tcgplayer_client_id}
client_secret: ${ssm:tcgplayer_client_secret}
cache_bucket: ${self:custom.cache-bucket}
cache: ${self:custom.cache.${opt:stage,'dev'}}
tags:
Project: pricecheck
iamRoleStatements:
- Effect: 'Allow'
Action:
- 's3:ListBucket'
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- ${self:custom.cache-bucket}
- Effect: 'Allow'
Action:
- 's3:PutObject'
- 's3:GetObject'
Resource:
Fn::Join:
- ''
- - 'arn:aws:s3:::'
- ${self:custom.cache-bucket}
- '/*'
custom:
cache-bucket: 'pricecheck-cache'
cache:
dev: "False"
v1: "True"
functions:
tcgplayer:
handler: main.tcg_handler
memorySize: 256
layers:
- arn:aws:lambda:ap-southeast-1:549791063841:layer:mtg-price-layer:2
events:
- http:
path: tcgplayer/{querystring}
cors: true
method: get
request:
parameters:
querystring: true
bigweb:
handler: main.big_handler
memorySize: 512
layers:
- arn:aws:lambda:ap-southeast-1:549791063841:layer:mtg-price-layer:2
events:
- http:
path: bigweb/{querystring}
cors: true
method: get
request:
parameters:
querystring: true
hareyuya:
handler: main.har_handler
memorySize: 512
layers:
- arn:aws:lambda:ap-southeast-1:549791063841:layer:mtg-price-layer:2
events:
- http:
path: hareruya/{querystring}
cors: true
method: get
request:
parameters:
querystring: true
cardkingdom:
handler: main.car_handler
memorySize: 512
layers:
- arn:aws:lambda:ap-southeast-1:549791063841:layer:mtg-price-layer:2
events:
- http:
path: cardkingdom/{querystring}
cors: true
method: get
request:
parameters:
querystring: true
resources:
Resources:
ServiceEndpointParameter:
Type: AWS::SSM::Parameter
Properties:
Description: "URL of the service endpoint"
Name: ${self:service}_${opt:stage, self:provider.stage}_ServiceEndpoint
Type: "String"
Value:
Fn::Join:
- ""
- - "https://"
- Ref: ApiGatewayRestApi
- ".execute-api.${opt:region, self:provider.region}.amazonaws.com/${opt:stage, self:provider.stage}"
Outputs:
ParameterName:
Description: Name of the Service endpoint paramter
Value:
Ref: ServiceEndpointParameter
Export:
Name: ${self:service}-${opt:stage, self:provider.stage}-ParameterName