-
Notifications
You must be signed in to change notification settings - Fork 0
/
serverless.yml
178 lines (170 loc) · 4.66 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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
# generated by @ng-toolkit/serverless
service: cok-people-search-frontend
plugins:
- serverless-apigw-binary
- serverless-apigwy-binary
- serverless-plugin-include-dependencies
- serverless-associate-waf
- serverless-domain-manager
provider:
name: aws
runtime: nodejs8.10
memorySize: 192
timeout: 10
stage: dev
region: us-east-1
environment:
STAGE: ${self:provider.stage}
MIX_PANEL_KEY: ${self:custom.mixpanel.${self:provider.stage}}
AUTH0_DOMAIN: https://login.connectourkids.org/
AUTH0_CLIENT_ID: ${self:custom.auth0ClientId.${self:provider.stage}}
AUTH0_AUDIENCE: ${self:custom.auth0Audience.${self:provider.stage}}
AUTH0_FAMILY_CONNECTIONS_AUDIENCE: ${self:custom.auth0FamilyConnectionsAudience.${self:provider.stage}}
iamRoleStatements:
- Effect: "Allow"
Action:
- "dynamodb:PutItem"
- "dynamodb:GetItem"
- "dynamodb:BatchWriteItem"
Resource:
- "arn:aws:dynamodb:us-east-1:*:table/pipl-cache"
- "arn:aws:dynamodb:us-east-1:*:table/pipl-search-pointers"
- Effect: "Allow"
Action:
- "ssm:DescribeParameters"
Resource:
Fn::Join:
- ""
- - "*"
- Effect: "Allow"
Action:
- "ssm:GetParametersByPath"
Resource:
Fn::Join:
- ""
- - "arn:aws:ssm:us-east-1:*:parameter/pipl/"
- Effect: "Allow"
Action:
- "ssm:GetParametersByPath"
- "ssm:GetParameter"
Resource:
- "arn:aws:ssm:us-east-1:*:parameter/people-search/*"
package:
exclude:
- src/**
- node_modules/**
- firebug-lite/**
- e2e/**
- coverage/**
- '!node_modules/aws-serverless-express/**'
- '!node_modules/binary-case/**'
- '!node_modules/type-is/**'
- '!node_modules/media-typer/**'
- '!node_modules/mime-types/**'
- '!node_modules/mime-db/**'
include:
- test-data/**
custom:
apigwBinary:
types:
- '*/*'
stage: ${opt:stage, self:provider.stage}
domains:
production: search.connectourkids.org
dev: dev.search.connectourkids.org
customDomain:
basePath: ""
domainName: ${self:custom.domains.${self:custom.stage}}
stage: "${self:custom.stage}"
createRoute53Record: true
certificateName: "search.connectourkids.org"
mixpanel:
production: ${ssm:/people-search/mixpanel/production-key~true}
dev: ${ssm:/people-search/mixpanel/dev-key~true}
associateWaf:
name: us-vn-only
auth0ClientId:
production: i5NGofkl7Z4jEexA7YTbasrLT8pcKLDU
dev: JUR6JVt9N4sn8bHrSXR818rwrj91hsTb
auth0Audience:
production: https://search.connectourkids.org/api/
dev: https://dev.search.connectourkids.org/api/
auth0FamilyConnectionsAudience:
production: https://family.connectourkids.org/api/v1/
dev: https://*.cokids.lucidfoundry.com/api/
auth0ManagementClientId:
production: ${ssm:/people-search/auth0/management-client-secret~true}
dev: ${ssm:/people-search/auth0/management-client-secret~true}
functions:
ui:
handler: lambda/ui.universal
events:
- http: ANY {proxy+}
- http: ANY /
searchv2:
handler: lambda/search-v2.query
events:
- http:
path: api/search-v2
method: POST
cors: true
request:
template:
application/json: >
{
"q" : "$input.params('q')"
}
response:
headers:
Content-Type: "application/json"
query:
handler: lambda/search.query
events:
- http:
path: api/query
method: POST
cors: true
request:
template:
application/json: >
{
"q" : "$input.params('q')",
"location" : "$input.params('location')",
}
response:
headers:
Content-Type: "application/json"
sendEvent:
handler: lambda/analytics.sendEvent
events:
- http:
path: api/sendEvent
method: POST
cors: true
sendUserInfo:
handler: lambda/analytics.sendUserInfo
events:
- http:
path: api/sendUserInfo
method: POST
cors: true
thumbnail:
handler: lambda/search.thumbnail
events:
- http:
path: api/thumbnail
method: GET
contentHandling: CONVERT_TO_BINARY
request:
template:
application/json: >
{
"tokens" : "$input.params('tokens')"
}
redirect:
handler: lambda/redirect.redirect
events:
- http:
path: api/redirect
method: GET
cors: true