-
Notifications
You must be signed in to change notification settings - Fork 18
/
packaged.yaml
98 lines (97 loc) · 2.81 KB
/
packaged.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
92
93
94
95
96
97
98
AWSTemplateFormatVersion: '2010-09-09'
Description: AppSync Broadcaster
Metadata:
AWS::ServerlessRepo::Application:
Author: awsed
Description: Simple app that broadcasts messages to multiple clients using Serverless
GraphQL real-time subscriptions powered by AWS AppSync
HomepageUrl: https://github.com/awsed/appsync-broadcaster-sar
Labels:
- appsync
- graphql
- real-time
- react
- amplify
LicenseUrl: s3://serverlessapprepository/3849faa42af60828f036a47d682ef6de
Name: appsync-broadcaster
ReadmeUrl: s3://serverlessapprepository/2910b6baaea0162e039f4e3eb04e45b4
SemanticVersion: 1.0.0
SourceCodeUrl: https://github.com/awsed/appsync-broadcaster-sar
SpdxLicenseId: MIT
Outputs:
ApiId:
Description: Unique AWS AppSync GraphQL API Identifier
Value:
Fn::GetAtt:
- broadcasterApi
- ApiId
ApiKey:
Description: The API Key to access your API
Value:
Fn::GetAtt:
- apiKey
- ApiKey
ApiUrl:
Description: The Endpoint URL of your GraphQL API
Value:
Fn::GetAtt:
- broadcasterApi
- GraphQLUrl
Region:
Description: Region where the resources are deployed
Value:
Ref: AWS::Region
Resources:
apiKey:
Properties:
ApiId:
Fn::GetAtt:
- broadcasterApi
- ApiId
Type: AWS::AppSync::ApiKey
broadcasterApi:
Properties:
AuthenticationType: API_KEY
Name: BroadcasterSAR
Type: AWS::AppSync::GraphQLApi
pubSubDataSource:
Properties:
ApiId:
Fn::GetAtt:
- broadcasterApi
- ApiId
Description: Local Resolver
Name: PubSub
Type: NONE
Type: AWS::AppSync::DataSource
pubSubResolver:
Properties:
ApiId:
Fn::GetAtt:
- broadcasterApi
- ApiId
DataSourceName:
Fn::GetAtt:
- pubSubDataSource
- Name
FieldName: sendMessage
RequestMappingTemplate: "{\n \"version\": \"2017-02-28\",\n \"payload\"\
: {\n \"message\": \"${context.arguments.message}\",\n \"sentAt\"\
: \"$util.time.nowISO8601()\"\n }\n}\n"
ResponseMappingTemplate: '$util.toJson($context.result)
'
TypeName: Mutation
Type: AWS::AppSync::Resolver
schema:
Properties:
ApiId:
Fn::GetAtt:
- broadcasterApi
- ApiId
Definition: "schema {\n query: Query\n mutation: Mutation\n subscription:\
\ Subscription\n} \n\ntype Message {\n message: String!\n}\n\ntype Mutation\
\ {\n sendMessage(message: String!): Message\n}\n\ntype Query {\n getMessage:\
\ Message\n}\n\ntype Subscription {\n subscribeToMessage: Message\n @aws_subscribe(mutations:\
\ [\"sendMessage\"])\n}\n"
Type: AWS::AppSync::GraphQLSchema
Transform: AWS::Serverless-2016-10-31