-
Notifications
You must be signed in to change notification settings - Fork 1
/
serverless.yml
177 lines (165 loc) · 5.67 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
service: abstractplay
plugins:
- serverless-dotnet
- serverless-aws-documentation
- serverless-reqvalidator-plugin
- serverless-domain-manager
# - serverless-pseudo-parameters
# You can pin your service to only deploy with a specific Serverless version
# Check out our docs for more details
# frameworkVersion: "=X.X.X"
provider:
name: aws
runtime: dotnetcore2.1
memorySize: 512
timeout: 30
versionFunctions: false
environment:
COMPlus_TieredCompilation : 1
# sns_mutator: ${self:custom.snsMutatorArn}
# sns_pinger: ${self:custom.snsPingerArn}
# sns_maker: ${self:custom.snsMakerArn}
# sns_mover: ${self:custom.snsMoverArn}
url_games: ${file(../apsecrets.yml):domains.games.${self:custom.stage}.domain}
stage: dev
region: us-east-2
functions:
GraphQLPublic:
handler: abstractplay::abstractplay.DBFunctions::GraphQL
environment:
db_server: ${file(../apsecrets.yml):db_server}
db_database: ${file(../apsecrets.yml):db_database}
db_username: ${file(../apsecrets.yml):db_username}
db_password: ${file(../apsecrets.yml):db_password}
vpc:
securityGroupIds:
- ${file(../apsecrets.yml):secGroup}
subnetIds:
- ${file(../apsecrets.yml):subnet1}
- ${file(../apsecrets.yml):subnet2}
- ${file(../apsecrets.yml):subnet3}
events:
- http:
path: /graphql
method: get
cors: true
reqValidatorName: 'xRequestValidateQuery'
request:
parameters:
querystrings:
query: true
documentation:
summary: "GraphQL entry point (read only)"
description: "This is how clients are to request data from the service. It is read only! Changes are made through other endpoints."
GraphQLAuthGet:
handler: abstractplay::abstractplay.DBFunctions::GraphQLAuth
environment:
db_server: ${file(../apsecrets.yml):db_server}
db_database: ${file(../apsecrets.yml):db_database}
db_username: ${file(../apsecrets.yml):db_username}
db_password: ${file(../apsecrets.yml):db_password}
vpc:
securityGroupIds:
- ${file(../apsecrets.yml):secGroup}
subnetIds:
- ${file(../apsecrets.yml):subnet1}
- ${file(../apsecrets.yml):subnet2}
- ${file(../apsecrets.yml):subnet3}
events:
- http:
path: /graphqlauth
method: get
cors: true
authorizer:
arn: ${file(../apsecrets.yml):cognitoarn}
reqValidatorName: 'xRequestValidateQuery'
request:
parameters:
querystrings:
query: true
documentation:
summary: "Authenticated GraphQL entry point (read only)"
description: "This is how authenticated clients are to request data from the service. Mutation requests can only be made via POST."
GraphQLAuthPost:
handler: abstractplay::abstractplay.DBFunctions::GraphQLAuth
environment:
db_server: ${file(../apsecrets.yml):db_server}
db_database: ${file(../apsecrets.yml):db_database}
db_username: ${file(../apsecrets.yml):db_username}
db_password: ${file(../apsecrets.yml):db_password}
vpc:
securityGroupIds:
- ${file(../apsecrets.yml):secGroup}
subnetIds:
- ${file(../apsecrets.yml):subnet1}
- ${file(../apsecrets.yml):subnet2}
- ${file(../apsecrets.yml):subnet3}
events:
- http:
path: /graphqlauth
method: post
cors: true
authorizer:
arn: ${file(../apsecrets.yml):cognitoarn}
reqValidatorName: 'xRequestValidateBody'
documentation:
summary: "Authenticated GraphQL entry point (read/write)"
description: "This is how authenticated clients are to mutate data."
requestModels:
"application/json": "RequestGraphQLPost"
GetGuid:
handler: abstractplay::abstractplay.Functions::GetSequentialGuid
events:
- http:
path: /debug/guid
method: get
cors: true
authorizer:
arn: ${file(../apsecrets.yml):cognitoarn}
documentation:
summary: "Generate a new sequential GUID"
description: "Generate a new sequential GUID"
# you can add CloudFormation resource templates here
resources:
Resources:
xRequestValidateBody:
Type: "AWS::ApiGateway::RequestValidator"
Properties:
Name: 'reqvalidator-body'
RestApiId:
Ref: ApiGatewayRestApi
ValidateRequestBody: true
ValidateRequestParameters: false
xRequestValidateQuery:
Type: "AWS::ApiGateway::RequestValidator"
Properties:
Name: 'reqvalidator-params'
RestApiId:
Ref: ApiGatewayRestApi
ValidateRequestBody: false
ValidateRequestParameters: true
custom:
stage: ${opt:stage, self:provider.stage}
stageConfig: ${file(../apsecrets.yml):domains.api.${self:custom.stage}}
region: ${opt:region, self:provider.region}
dotnet:
slndir: sln/abstractplay
customDomain:
domainName: ${self:custom.stageConfig.domain}
certificateName: ${self:custom.stageConfig.cert}
basepath: ''
stage: ${self:custom.stage}
createRoute53Record: false
endpointType: "edge"
documentation:
info:
version: "1"
title: "Abstract Play API"
description: "The primary Abstract Play API"
termsOfService: "https://www.abstractplay.com/terms"
models:
-
name: "RequestGraphQLPost"
description: "Required body content when POSTing to GraphQL endpoints"
contentType: "application/json"
schema: ${file(models/request_graphql_post.json)}