-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserverless.yml
157 lines (147 loc) · 4.07 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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
service: movie-ticket-watcher
#app: your-app-name
#tenant: your-tenant-name
frameworkVersion: '>=1.28.0 <2.0.0'
provider:
name: aws
runtime: go1.x
stage: ${opt:stage, 'dev'}
region: ${opt:region, 'ap-south-1'}
logRetentionInDays: 14
deploymentBucket:
name: movie-ticket-watcher-go-binaries
apiGateway:
minimumCompressionSize: 1024
tracing:
apiGateway: true
lambda: true
environment:
APP_ENV: ${ssm:/movie-ticket-watcher/${self:provider.stage}/APP_ENV}
APP_STAGE: ${self:provider.stage}
VAPID_PUBLIC_KEY: ${ssm:/movie-ticket-watcher/${self:provider.stage}/VAPID_PUBLIC_KEY}
VAPID_PRIVATE_KEY: ${ssm:/movie-ticket-watcher/${self:provider.stage}/VAPID_PRIVATE_KEY}
iamRoleStatements:
- Effect: "Allow"
Action:
- dynamodb:Query
- dynamodb:Scan
- dynamodb:GetItem
- dynamodb:PutItem
- dynamodb:UpdateItem
- dynamodb:DeleteItem
- dynamodb:BatchWriteItem
Resource: "arn:aws:dynamodb:${self:provider.region}:#{AWS::AccountId}:table/ticket-watcher-${self:provider.stage}.*"
package:
individually: true
excludeDevDependencies: false
exclude:
- ./**
functions:
get-cities:
handler: bin/get-cities
events:
- http:
path: /cities
method: get
cors:
origins:
- 'https://movie-ticket-watcher.jaydp.com'
- 'https://qa.movie-ticket-watcher.jaydp.com'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
allowCredentials: false
package:
include:
- ./bin/get-cities
get-movies:
handler: bin/get-movies
events:
- http:
path: /movies/{regionCode}
method: get
cors:
origins:
- 'https://movie-ticket-watcher.jaydp.com'
- 'https://qa.movie-ticket-watcher.jaydp.com'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
allowCredentials: false
package:
include:
- ./bin/get-movies
get-cinemas:
handler: bin/get-cinemas
events:
- http:
path: /cinemas/{cityID}
method: get
cors:
origins:
- 'https://movie-ticket-watcher.jaydp.com'
- 'https://qa.movie-ticket-watcher.jaydp.com'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
allowCredentials: false
package:
include:
- ./bin/get-cinemas
subscribe:
handler: bin/subscribe
events:
- http:
path: /subscribe
method: post
cors:
origins:
- 'https://movie-ticket-watcher.jaydp.com'
- 'https://qa.movie-ticket-watcher.jaydp.com'
headers:
- Content-Type
- X-Amz-Date
- Authorization
- X-Api-Key
- X-Amz-Security-Token
- X-Amz-User-Agent
allowCredentials: false
package:
include:
- ./bin/subscribe
cron-check-tickets:
handler: bin/cron-check-tickets
events:
- schedule:
name: cron-check-tickets-${self:provider.stage}
rate: rate(10 minutes)
enabled: true
package:
include:
- ./bin/cron-check-tickets
plugins:
- serverless-pseudo-parameters
- serverless-domain-manager
custom:
domains:
prod: api.movie-ticket-watcher.jaydp.com
qa: qa-api.movie-ticket-watcher.jaydp.com
dev: dev-api.movie-ticket-watcher.jaydp.com
customDomain:
basePath: ''
domainName: ${self:custom.domains.${self:provider.stage}}
certificateName: 'wildcard.jaydp.com'
stage: '${self:provider.stage}'
createRoute53Record: false