forked from jgeschwendt/serverless-prisma
/
serverless.yml
87 lines (78 loc) · 2.24 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
service: serverless-prisma
frameworkVersion: '>=1.9.0 <2.0.0'
custom:
stage: ${opt:stage, self:provider.stage}
webpack:
includeModules: true
packager: yarn
webpackConfig: ./webpack.config.js
package:
individually: true
plugins:
- serverless-webpack
- serverless-offline
provider:
name: aws
region: us-east-1
runtime: nodejs8.10
deploymentBucket: ${env:ARTIFACTS_BUCKET}
environment:
PRISMA_DEBUG: ${env:PRISMA_DEBUG}
PRISMA_ENDPOINT: ${env:PRISMA_ENDPOINT}
PRISMA_SECRET: ${env:PRISMA_SECRET}
PRISMA_SERVICE: ${env:PRISMA_SERVICE}
functions:
graphql:
name: serverless-prisma-${self:custom.stage}
handler: src/graphql.handler
events:
- http:
cors: true
integration: lambda-proxy
method: get
path: /
- http:
cors: true
integration: lambda-proxy
method: post
path: /
playground:
name: serverless-prisma-playground-${self:custom.stage}
handler: src/playground.handler
events:
- http:
cors: true
integration: lambda-proxy
method: get
path: /playground
resources:
Resources:
ApiGatewayBasePathMapping:
DependsOn: ApiGatewayDomainName
Type: AWS::ApiGateway::BasePathMapping
Properties:
BasePath: ''
DomainName: ${env:API_DOMAIN_NAME}
RestApiId:
Ref: ApiGatewayRestApi # created by serverless, check the stack's resources
Stage: ${self:custom.stage}
ApiGatewayDomainName:
Type: AWS::ApiGateway::DomainName
Properties:
CertificateArn: ${env:API_SSL_CERT_ARN}
DomainName: ${env:API_DOMAIN_NAME}
ApiGatewayRecordSetGroup:
Type: AWS::Route53::RecordSetGroup
Properties:
HostedZoneName: ${env:API_HOSTED_ZONE}.
RecordSets:
- Name: ${env:API_DOMAIN_NAME}.
Type: A
AliasTarget:
DNSName: {'Fn::GetAtt': ApiGatewayDomainName.DistributionDomainName}
HostedZoneId: Z2FDTNDATAQYW2
- Name: ${env:API_DOMAIN_NAME}.
Type: AAAA
AliasTarget:
DNSName: {'Fn::GetAtt': ApiGatewayDomainName.DistributionDomainName}
HostedZoneId: Z2FDTNDATAQYW2