-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yaml
91 lines (87 loc) · 2.23 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
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
AWSTemplateFormatVersion: '2010-09-09'
Transform: AWS::Serverless-2016-10-31
Description: >
aws-serverless-graphql-ts
Sample GraphQL API built with TypeScript and AWS SAM
Globals:
Function:
LoggingConfig:
LogFormat: JSON
Resources:
PostsTable:
Type: AWS::Serverless::SimpleTable
PostsGraphQLApi:
Type: AWS::Serverless::GraphQLApi
Properties:
SchemaUri: ./schema.graphql
Logging:
FieldLogLevel: ERROR
Auth:
Type: API_KEY
ApiKeys:
DefaultApiKey:
Description: Default api key
DataSources:
DynamoDb:
Posts:
TableName: !Ref PostsTable
TableArn: !GetAtt PostsTable.Arn
Functions:
createPost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
DataSource: Posts
CodeUri: ./build/createPost.js
getPost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
DataSource: Posts
CodeUri: ./build/getPost.js
getPosts:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
DataSource: Posts
CodeUri: ./build/getPosts.js
deletePost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
DataSource: Posts
CodeUri: ./build/deletePost.js
Resolvers:
Query:
getPost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
Pipeline:
- getPost
getPosts:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
Pipeline:
- getPosts
Mutation:
addPost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
Pipeline:
- createPost
deletePost:
Runtime:
Name: APPSYNC_JS
Version: 1.0.0
Pipeline:
- deletePost
Outputs:
PostsGraphQLApi:
Description: PostsGraphQLApi endpoint URL for Prod environment
Value: !GetAtt PostsGraphQLApi.GraphQLUrl
PostsGraphQLApiDefaultApiKey:
Description: API Key for PostsGraphQLApi
Value: !GetAtt PostsGraphQLApiDefaultApiKey.ApiKey