-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
50 lines (48 loc) · 1.11 KB
/
template.yaml
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
---
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: |
Apollo Server Lambda with a Lambda Layer using AWS SAM
Globals:
Function:
Timeout: 60
Layers:
- !Ref Layer
Architectures:
- arm64
Resources:
ApiGateway:
Type: AWS::Serverless::Api
Properties:
StageName: local
Cors:
AllowOrigin: "'https://studio.apollographql.com'"
AllowHeaders: "'*'"
AllowCredentials: true
Lambda:
Type: AWS::Serverless::Function
Properties:
CodeUri: resources/lambda/build
Description: AWS Lambda
Events:
Api:
Type: Api
Properties:
Method: ANY
RestApiId: !Ref ApiGateway
Path: /graphql
Handler: index.handler
Layers:
- !Ref Layer
Runtime: nodejs18.x
Layer:
Type: AWS::Serverless::LayerVersion
Properties:
CompatibleRuntimes:
- nodejs18.x
ContentUri: resources/layer/build/
Description: AWS Layer
LayerName: Layer
RetentionPolicy: Retain
Metadata:
BuildMethod: nodejs18.x