@aws-amplify/graphql-model-transformer 1.1.0-cdkv2.2 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,2316 @@
1
1
  // Jest Snapshot v1, https://goo.gl/fbAQLP
2
2
 
3
+ exports[`ModelTransformer: should not override model objects when override file does not exist 1`] = `
4
+ Object {
5
+ "Conditions": Object {
6
+ "HasEnvironmentParameter": Object {
7
+ "Fn::Not": Array [
8
+ Object {
9
+ "Fn::Equals": Array [
10
+ Object {
11
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
12
+ },
13
+ "NONE",
14
+ ],
15
+ },
16
+ ],
17
+ },
18
+ "ShouldUsePayPerRequestBilling": Object {
19
+ "Fn::Equals": Array [
20
+ Object {
21
+ "Ref": "DynamoDBBillingMode",
22
+ },
23
+ "PAY_PER_REQUEST",
24
+ ],
25
+ },
26
+ "ShouldUsePointInTimeRecovery": Object {
27
+ "Fn::Equals": Array [
28
+ Object {
29
+ "Ref": "DynamoDBEnablePointInTimeRecovery",
30
+ },
31
+ "true",
32
+ ],
33
+ },
34
+ "ShouldUseServerSideEncryption": Object {
35
+ "Fn::Equals": Array [
36
+ Object {
37
+ "Ref": "DynamoDBEnableServerSideEncryption",
38
+ },
39
+ "true",
40
+ ],
41
+ },
42
+ },
43
+ "Outputs": Object {
44
+ "GetAttPostDataSourceName": Object {
45
+ "Description": "Your model DataSource name.",
46
+ "Export": Object {
47
+ "Name": Object {
48
+ "Fn::Join": Array [
49
+ ":",
50
+ Array [
51
+ Object {
52
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
53
+ },
54
+ "GetAtt:PostDataSource:Name",
55
+ ],
56
+ ],
57
+ },
58
+ },
59
+ "Value": Object {
60
+ "Fn::GetAtt": Array [
61
+ "PostDataSource",
62
+ "Name",
63
+ ],
64
+ },
65
+ },
66
+ "GetAttPostTableName": Object {
67
+ "Description": "Your DynamoDB table name.",
68
+ "Export": Object {
69
+ "Name": Object {
70
+ "Fn::Join": Array [
71
+ ":",
72
+ Array [
73
+ Object {
74
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
75
+ },
76
+ "GetAtt:PostTable:Name",
77
+ ],
78
+ ],
79
+ },
80
+ },
81
+ "Value": Object {
82
+ "Ref": "PostTable",
83
+ },
84
+ },
85
+ "GetAttPostTableStreamArn": Object {
86
+ "Description": "Your DynamoDB table StreamArn.",
87
+ "Export": Object {
88
+ "Name": Object {
89
+ "Fn::Join": Array [
90
+ ":",
91
+ Array [
92
+ Object {
93
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
94
+ },
95
+ "GetAtt:PostTable:StreamArn",
96
+ ],
97
+ ],
98
+ },
99
+ },
100
+ "Value": Object {
101
+ "Fn::GetAtt": Array [
102
+ "PostTable",
103
+ "StreamArn",
104
+ ],
105
+ },
106
+ },
107
+ "transformerrootstackPostMutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunctionB82DB57BFunctionId": Object {
108
+ "Value": Object {
109
+ "Fn::GetAtt": Array [
110
+ "MutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunction9E444A7F",
111
+ "FunctionId",
112
+ ],
113
+ },
114
+ },
115
+ "transformerrootstackPostMutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunction148F70DDFunctionId": Object {
116
+ "Value": Object {
117
+ "Fn::GetAtt": Array [
118
+ "MutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunctionBAC7D532",
119
+ "FunctionId",
120
+ ],
121
+ },
122
+ },
123
+ "transformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId": Object {
124
+ "Value": Object {
125
+ "Fn::GetAtt": Array [
126
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
127
+ "FunctionId",
128
+ ],
129
+ },
130
+ },
131
+ "transformerrootstackPostSubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionAE3ECF1FFunctionId": Object {
132
+ "Value": Object {
133
+ "Fn::GetAtt": Array [
134
+ "SubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionB4572868",
135
+ "FunctionId",
136
+ ],
137
+ },
138
+ },
139
+ },
140
+ "Parameters": Object {
141
+ "DynamoDBBillingMode": Object {
142
+ "AllowedValues": Array [
143
+ "PAY_PER_REQUEST",
144
+ "PROVISIONED",
145
+ ],
146
+ "Default": "PAY_PER_REQUEST",
147
+ "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
148
+ "Type": "String",
149
+ },
150
+ "DynamoDBEnablePointInTimeRecovery": Object {
151
+ "AllowedValues": Array [
152
+ "true",
153
+ "false",
154
+ ],
155
+ "Default": "false",
156
+ "Description": "Whether to enable Point in Time Recovery on the table.",
157
+ "Type": "String",
158
+ },
159
+ "DynamoDBEnableServerSideEncryption": Object {
160
+ "AllowedValues": Array [
161
+ "true",
162
+ "false",
163
+ ],
164
+ "Default": "true",
165
+ "Description": "Enable server side encryption powered by KMS.",
166
+ "Type": "String",
167
+ },
168
+ "DynamoDBModelTableReadIOPS": Object {
169
+ "Default": 5,
170
+ "Description": "The number of read IOPS the table should support.",
171
+ "Type": "Number",
172
+ },
173
+ "DynamoDBModelTableWriteIOPS": Object {
174
+ "Default": 5,
175
+ "Description": "The number of write IOPS the table should support.",
176
+ "Type": "Number",
177
+ },
178
+ "referencetotransformerrootstackGraphQLAPI20497F53ApiId": Object {
179
+ "Type": "String",
180
+ },
181
+ "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name": Object {
182
+ "Type": "String",
183
+ },
184
+ "referencetotransformerrootstackS3DeploymentBucket7592718ARef": Object {
185
+ "Type": "String",
186
+ },
187
+ "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": Object {
188
+ "Type": "String",
189
+ },
190
+ "referencetotransformerrootstackenv10C5A902Ref": Object {
191
+ "Type": "String",
192
+ },
193
+ },
194
+ "Resources": Object {
195
+ "CreatePostResolver": Object {
196
+ "Properties": Object {
197
+ "ApiId": Object {
198
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
199
+ },
200
+ "FieldName": "createPost",
201
+ "Kind": "PIPELINE",
202
+ "PipelineConfig": Object {
203
+ "Functions": Array [
204
+ Object {
205
+ "Fn::GetAtt": Array [
206
+ "MutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunction9E444A7F",
207
+ "FunctionId",
208
+ ],
209
+ },
210
+ Object {
211
+ "Fn::GetAtt": Array [
212
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
213
+ "FunctionId",
214
+ ],
215
+ },
216
+ Object {
217
+ "Fn::GetAtt": Array [
218
+ "MutationCreatePostDataResolverFnMutationCreatePostDataResolverFnAppSyncFunctionE45E2000",
219
+ "FunctionId",
220
+ ],
221
+ },
222
+ ],
223
+ },
224
+ "RequestMappingTemplate": Object {
225
+ "Fn::Join": Array [
226
+ "",
227
+ Array [
228
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
229
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"createPost\\"))
230
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
231
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
232
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
233
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
234
+ Object {
235
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
236
+ },
237
+ "\\"))
238
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
239
+ Object {
240
+ "Ref": "PostTable",
241
+ },
242
+ "\\"))
243
+ $util.toJson({})",
244
+ ],
245
+ ],
246
+ },
247
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
248
+ "TypeName": "Mutation",
249
+ },
250
+ "Type": "AWS::AppSync::Resolver",
251
+ },
252
+ "DeletePostResolver": Object {
253
+ "Properties": Object {
254
+ "ApiId": Object {
255
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
256
+ },
257
+ "FieldName": "deletePost",
258
+ "Kind": "PIPELINE",
259
+ "PipelineConfig": Object {
260
+ "Functions": Array [
261
+ Object {
262
+ "Fn::GetAtt": Array [
263
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
264
+ "FunctionId",
265
+ ],
266
+ },
267
+ Object {
268
+ "Fn::GetAtt": Array [
269
+ "MutationDeletePostDataResolverFnMutationDeletePostDataResolverFnAppSyncFunction45B37C12",
270
+ "FunctionId",
271
+ ],
272
+ },
273
+ ],
274
+ },
275
+ "RequestMappingTemplate": Object {
276
+ "Fn::Join": Array [
277
+ "",
278
+ Array [
279
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
280
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"deletePost\\"))
281
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
282
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
283
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
284
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
285
+ Object {
286
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
287
+ },
288
+ "\\"))
289
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
290
+ Object {
291
+ "Ref": "PostTable",
292
+ },
293
+ "\\"))
294
+ $util.toJson({})",
295
+ ],
296
+ ],
297
+ },
298
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
299
+ "TypeName": "Mutation",
300
+ },
301
+ "Type": "AWS::AppSync::Resolver",
302
+ },
303
+ "DynamoDBAccess71ABE5AE": Object {
304
+ "Properties": Object {
305
+ "PolicyDocument": Object {
306
+ "Statement": Array [
307
+ Object {
308
+ "Action": Array [
309
+ "dynamodb:BatchGetItem",
310
+ "dynamodb:BatchWriteItem",
311
+ "dynamodb:PutItem",
312
+ "dynamodb:DeleteItem",
313
+ "dynamodb:GetItem",
314
+ "dynamodb:Scan",
315
+ "dynamodb:Query",
316
+ "dynamodb:UpdateItem",
317
+ ],
318
+ "Effect": "Allow",
319
+ "Resource": Array [
320
+ Object {
321
+ "Fn::Sub": Array [
322
+ "arn:aws:dynamodb:\${AWS::Region}:\${AWS::AccountId}:table/\${tablename}",
323
+ Object {
324
+ "tablename": Object {
325
+ "Fn::Join": Array [
326
+ "",
327
+ Array [
328
+ "Post-",
329
+ Object {
330
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
331
+ },
332
+ "-",
333
+ Object {
334
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
335
+ },
336
+ ],
337
+ ],
338
+ },
339
+ },
340
+ ],
341
+ },
342
+ Object {
343
+ "Fn::Sub": Array [
344
+ "arn:aws:dynamodb:\${AWS::Region}:\${AWS::AccountId}:table/\${tablename}/*",
345
+ Object {
346
+ "tablename": Object {
347
+ "Fn::Join": Array [
348
+ "",
349
+ Array [
350
+ "Post-",
351
+ Object {
352
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
353
+ },
354
+ "-",
355
+ Object {
356
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
357
+ },
358
+ ],
359
+ ],
360
+ },
361
+ },
362
+ ],
363
+ },
364
+ ],
365
+ },
366
+ ],
367
+ "Version": "2012-10-17",
368
+ },
369
+ "PolicyName": "DynamoDBAccess71ABE5AE",
370
+ "Roles": Array [
371
+ Object {
372
+ "Ref": "PostIAMRole83BF708F",
373
+ },
374
+ ],
375
+ },
376
+ "Type": "AWS::IAM::Policy",
377
+ },
378
+ "GetPostResolver": Object {
379
+ "Properties": Object {
380
+ "ApiId": Object {
381
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
382
+ },
383
+ "FieldName": "getPost",
384
+ "Kind": "PIPELINE",
385
+ "PipelineConfig": Object {
386
+ "Functions": Array [
387
+ Object {
388
+ "Fn::GetAtt": Array [
389
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
390
+ "FunctionId",
391
+ ],
392
+ },
393
+ Object {
394
+ "Fn::GetAtt": Array [
395
+ "QueryGetPostDataResolverFnQueryGetPostDataResolverFnAppSyncFunction06724190",
396
+ "FunctionId",
397
+ ],
398
+ },
399
+ ],
400
+ },
401
+ "RequestMappingTemplate": Object {
402
+ "Fn::Join": Array [
403
+ "",
404
+ Array [
405
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Query\\"))
406
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"getPost\\"))
407
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
408
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
409
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
410
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
411
+ Object {
412
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
413
+ },
414
+ "\\"))
415
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
416
+ Object {
417
+ "Ref": "PostTable",
418
+ },
419
+ "\\"))
420
+ $util.toJson({})",
421
+ ],
422
+ ],
423
+ },
424
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
425
+ "TypeName": "Query",
426
+ },
427
+ "Type": "AWS::AppSync::Resolver",
428
+ },
429
+ "ListPostResolver": Object {
430
+ "Properties": Object {
431
+ "ApiId": Object {
432
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
433
+ },
434
+ "FieldName": "listPosts",
435
+ "Kind": "PIPELINE",
436
+ "PipelineConfig": Object {
437
+ "Functions": Array [
438
+ Object {
439
+ "Fn::GetAtt": Array [
440
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
441
+ "FunctionId",
442
+ ],
443
+ },
444
+ Object {
445
+ "Fn::GetAtt": Array [
446
+ "QueryListPostsDataResolverFnQueryListPostsDataResolverFnAppSyncFunction3D526AB7",
447
+ "FunctionId",
448
+ ],
449
+ },
450
+ ],
451
+ },
452
+ "RequestMappingTemplate": Object {
453
+ "Fn::Join": Array [
454
+ "",
455
+ Array [
456
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Query\\"))
457
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"listPosts\\"))
458
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
459
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
460
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
461
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
462
+ Object {
463
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
464
+ },
465
+ "\\"))
466
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
467
+ Object {
468
+ "Ref": "PostTable",
469
+ },
470
+ "\\"))
471
+ $util.toJson({})",
472
+ ],
473
+ ],
474
+ },
475
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
476
+ "TypeName": "Query",
477
+ },
478
+ "Type": "AWS::AppSync::Resolver",
479
+ },
480
+ "MutationCreatePostDataResolverFnMutationCreatePostDataResolverFnAppSyncFunctionE45E2000": Object {
481
+ "DependsOn": Array [
482
+ "PostDataSource",
483
+ ],
484
+ "Properties": Object {
485
+ "ApiId": Object {
486
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
487
+ },
488
+ "DataSourceName": Object {
489
+ "Fn::GetAtt": Array [
490
+ "PostDataSource",
491
+ "Name",
492
+ ],
493
+ },
494
+ "FunctionVersion": "2018-05-29",
495
+ "Name": "MutationCreatePostDataResolverFn",
496
+ "RequestMappingTemplateS3Location": Object {
497
+ "Fn::Join": Array [
498
+ "",
499
+ Array [
500
+ "s3://",
501
+ Object {
502
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
503
+ },
504
+ "/",
505
+ Object {
506
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
507
+ },
508
+ "/resolvers/Mutation.createPost.req.vtl",
509
+ ],
510
+ ],
511
+ },
512
+ "ResponseMappingTemplateS3Location": Object {
513
+ "Fn::Join": Array [
514
+ "",
515
+ Array [
516
+ "s3://",
517
+ Object {
518
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
519
+ },
520
+ "/",
521
+ Object {
522
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
523
+ },
524
+ "/resolvers/Mutation.createPost.res.vtl",
525
+ ],
526
+ ],
527
+ },
528
+ },
529
+ "Type": "AWS::AppSync::FunctionConfiguration",
530
+ },
531
+ "MutationDeletePostDataResolverFnMutationDeletePostDataResolverFnAppSyncFunction45B37C12": Object {
532
+ "DependsOn": Array [
533
+ "PostDataSource",
534
+ ],
535
+ "Properties": Object {
536
+ "ApiId": Object {
537
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
538
+ },
539
+ "DataSourceName": Object {
540
+ "Fn::GetAtt": Array [
541
+ "PostDataSource",
542
+ "Name",
543
+ ],
544
+ },
545
+ "FunctionVersion": "2018-05-29",
546
+ "Name": "MutationDeletePostDataResolverFn",
547
+ "RequestMappingTemplateS3Location": Object {
548
+ "Fn::Join": Array [
549
+ "",
550
+ Array [
551
+ "s3://",
552
+ Object {
553
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
554
+ },
555
+ "/",
556
+ Object {
557
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
558
+ },
559
+ "/resolvers/Mutation.deletePost.req.vtl",
560
+ ],
561
+ ],
562
+ },
563
+ "ResponseMappingTemplateS3Location": Object {
564
+ "Fn::Join": Array [
565
+ "",
566
+ Array [
567
+ "s3://",
568
+ Object {
569
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
570
+ },
571
+ "/",
572
+ Object {
573
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
574
+ },
575
+ "/resolvers/Mutation.deletePost.res.vtl",
576
+ ],
577
+ ],
578
+ },
579
+ },
580
+ "Type": "AWS::AppSync::FunctionConfiguration",
581
+ },
582
+ "MutationUpdatePostDataResolverFnMutationUpdatePostDataResolverFnAppSyncFunctionBF7D410D": Object {
583
+ "DependsOn": Array [
584
+ "PostDataSource",
585
+ ],
586
+ "Properties": Object {
587
+ "ApiId": Object {
588
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
589
+ },
590
+ "DataSourceName": Object {
591
+ "Fn::GetAtt": Array [
592
+ "PostDataSource",
593
+ "Name",
594
+ ],
595
+ },
596
+ "FunctionVersion": "2018-05-29",
597
+ "Name": "MutationUpdatePostDataResolverFn",
598
+ "RequestMappingTemplateS3Location": Object {
599
+ "Fn::Join": Array [
600
+ "",
601
+ Array [
602
+ "s3://",
603
+ Object {
604
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
605
+ },
606
+ "/",
607
+ Object {
608
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
609
+ },
610
+ "/resolvers/Mutation.updatePost.req.vtl",
611
+ ],
612
+ ],
613
+ },
614
+ "ResponseMappingTemplateS3Location": Object {
615
+ "Fn::Join": Array [
616
+ "",
617
+ Array [
618
+ "s3://",
619
+ Object {
620
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
621
+ },
622
+ "/",
623
+ Object {
624
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
625
+ },
626
+ "/resolvers/Mutation.updatePost.res.vtl",
627
+ ],
628
+ ],
629
+ },
630
+ },
631
+ "Type": "AWS::AppSync::FunctionConfiguration",
632
+ },
633
+ "MutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunction9E444A7F": Object {
634
+ "Properties": Object {
635
+ "ApiId": Object {
636
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
637
+ },
638
+ "DataSourceName": Object {
639
+ "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name",
640
+ },
641
+ "FunctionVersion": "2018-05-29",
642
+ "Name": "MutationcreatePostinit0Function",
643
+ "RequestMappingTemplateS3Location": Object {
644
+ "Fn::Join": Array [
645
+ "",
646
+ Array [
647
+ "s3://",
648
+ Object {
649
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
650
+ },
651
+ "/",
652
+ Object {
653
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
654
+ },
655
+ "/resolvers/Mutation.createPost.init.1.req.vtl",
656
+ ],
657
+ ],
658
+ },
659
+ "ResponseMappingTemplate": "$util.toJson({})",
660
+ },
661
+ "Type": "AWS::AppSync::FunctionConfiguration",
662
+ },
663
+ "MutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunctionBAC7D532": Object {
664
+ "Properties": Object {
665
+ "ApiId": Object {
666
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
667
+ },
668
+ "DataSourceName": Object {
669
+ "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name",
670
+ },
671
+ "FunctionVersion": "2018-05-29",
672
+ "Name": "MutationupdatePostinit0Function",
673
+ "RequestMappingTemplateS3Location": Object {
674
+ "Fn::Join": Array [
675
+ "",
676
+ Array [
677
+ "s3://",
678
+ Object {
679
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
680
+ },
681
+ "/",
682
+ Object {
683
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
684
+ },
685
+ "/resolvers/Mutation.updatePost.init.1.req.vtl",
686
+ ],
687
+ ],
688
+ },
689
+ "ResponseMappingTemplate": "$util.toJson({})",
690
+ },
691
+ "Type": "AWS::AppSync::FunctionConfiguration",
692
+ },
693
+ "PostDataSource": Object {
694
+ "DependsOn": Array [
695
+ "PostIAMRole83BF708F",
696
+ ],
697
+ "Properties": Object {
698
+ "ApiId": Object {
699
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
700
+ },
701
+ "DynamoDBConfig": Object {
702
+ "AwsRegion": Object {
703
+ "Ref": "AWS::Region",
704
+ },
705
+ "TableName": Object {
706
+ "Ref": "PostTable",
707
+ },
708
+ },
709
+ "Name": "PostTable",
710
+ "ServiceRoleArn": Object {
711
+ "Fn::GetAtt": Array [
712
+ "PostIAMRole83BF708F",
713
+ "Arn",
714
+ ],
715
+ },
716
+ "Type": "AMAZON_DYNAMODB",
717
+ },
718
+ "Type": "AWS::AppSync::DataSource",
719
+ },
720
+ "PostIAMRole83BF708F": Object {
721
+ "Properties": Object {
722
+ "AssumeRolePolicyDocument": Object {
723
+ "Statement": Array [
724
+ Object {
725
+ "Action": "sts:AssumeRole",
726
+ "Effect": "Allow",
727
+ "Principal": Object {
728
+ "Service": "appsync.amazonaws.com",
729
+ },
730
+ },
731
+ ],
732
+ "Version": "2012-10-17",
733
+ },
734
+ "RoleName": Object {
735
+ "Fn::Join": Array [
736
+ "",
737
+ Array [
738
+ "PostIAMRolebbce9b-",
739
+ Object {
740
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
741
+ },
742
+ "-",
743
+ Object {
744
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
745
+ },
746
+ ],
747
+ ],
748
+ },
749
+ },
750
+ "Type": "AWS::IAM::Role",
751
+ },
752
+ "PostIAMRoleDefaultPolicy04190CA0": Object {
753
+ "Properties": Object {
754
+ "PolicyDocument": Object {
755
+ "Statement": Array [
756
+ Object {
757
+ "Action": Array [
758
+ "dynamodb:BatchGetItem",
759
+ "dynamodb:GetRecords",
760
+ "dynamodb:GetShardIterator",
761
+ "dynamodb:Query",
762
+ "dynamodb:GetItem",
763
+ "dynamodb:Scan",
764
+ "dynamodb:ConditionCheckItem",
765
+ "dynamodb:BatchWriteItem",
766
+ "dynamodb:PutItem",
767
+ "dynamodb:UpdateItem",
768
+ "dynamodb:DeleteItem",
769
+ "dynamodb:DescribeTable",
770
+ ],
771
+ "Effect": "Allow",
772
+ "Resource": Array [
773
+ Object {
774
+ "Fn::GetAtt": Array [
775
+ "PostTable",
776
+ "Arn",
777
+ ],
778
+ },
779
+ Object {
780
+ "Ref": "AWS::NoValue",
781
+ },
782
+ ],
783
+ },
784
+ ],
785
+ "Version": "2012-10-17",
786
+ },
787
+ "PolicyName": "PostIAMRoleDefaultPolicy04190CA0",
788
+ "Roles": Array [
789
+ Object {
790
+ "Ref": "PostIAMRole83BF708F",
791
+ },
792
+ ],
793
+ },
794
+ "Type": "AWS::IAM::Policy",
795
+ },
796
+ "PostTable": Object {
797
+ "DeletionPolicy": "Delete",
798
+ "Properties": Object {
799
+ "AttributeDefinitions": Array [
800
+ Object {
801
+ "AttributeName": "id",
802
+ "AttributeType": "S",
803
+ },
804
+ ],
805
+ "BillingMode": Object {
806
+ "Fn::If": Array [
807
+ "ShouldUsePayPerRequestBilling",
808
+ "PAY_PER_REQUEST",
809
+ Object {
810
+ "Ref": "AWS::NoValue",
811
+ },
812
+ ],
813
+ },
814
+ "KeySchema": Array [
815
+ Object {
816
+ "AttributeName": "id",
817
+ "KeyType": "HASH",
818
+ },
819
+ ],
820
+ "PointInTimeRecoverySpecification": Object {
821
+ "Fn::If": Array [
822
+ "ShouldUsePointInTimeRecovery",
823
+ Object {
824
+ "PointInTimeRecoveryEnabled": true,
825
+ },
826
+ Object {
827
+ "Ref": "AWS::NoValue",
828
+ },
829
+ ],
830
+ },
831
+ "ProvisionedThroughput": Object {
832
+ "Fn::If": Array [
833
+ "ShouldUsePayPerRequestBilling",
834
+ Object {
835
+ "Ref": "AWS::NoValue",
836
+ },
837
+ Object {
838
+ "ReadCapacityUnits": Object {
839
+ "Ref": "DynamoDBModelTableReadIOPS",
840
+ },
841
+ "WriteCapacityUnits": Object {
842
+ "Ref": "DynamoDBModelTableWriteIOPS",
843
+ },
844
+ },
845
+ ],
846
+ },
847
+ "SSESpecification": Object {
848
+ "SSEEnabled": Object {
849
+ "Fn::If": Array [
850
+ "ShouldUseServerSideEncryption",
851
+ true,
852
+ false,
853
+ ],
854
+ },
855
+ },
856
+ "StreamSpecification": Object {
857
+ "StreamViewType": "NEW_AND_OLD_IMAGES",
858
+ },
859
+ "TableName": Object {
860
+ "Fn::Join": Array [
861
+ "",
862
+ Array [
863
+ "Post-",
864
+ Object {
865
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
866
+ },
867
+ "-",
868
+ Object {
869
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
870
+ },
871
+ ],
872
+ ],
873
+ },
874
+ },
875
+ "Type": "AWS::DynamoDB::Table",
876
+ "UpdateReplacePolicy": "Delete",
877
+ },
878
+ "QueryGetPostDataResolverFnQueryGetPostDataResolverFnAppSyncFunction06724190": Object {
879
+ "DependsOn": Array [
880
+ "PostDataSource",
881
+ ],
882
+ "Properties": Object {
883
+ "ApiId": Object {
884
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
885
+ },
886
+ "DataSourceName": Object {
887
+ "Fn::GetAtt": Array [
888
+ "PostDataSource",
889
+ "Name",
890
+ ],
891
+ },
892
+ "FunctionVersion": "2018-05-29",
893
+ "Name": "QueryGetPostDataResolverFn",
894
+ "RequestMappingTemplateS3Location": Object {
895
+ "Fn::Join": Array [
896
+ "",
897
+ Array [
898
+ "s3://",
899
+ Object {
900
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
901
+ },
902
+ "/",
903
+ Object {
904
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
905
+ },
906
+ "/resolvers/Query.getPost.req.vtl",
907
+ ],
908
+ ],
909
+ },
910
+ "ResponseMappingTemplateS3Location": Object {
911
+ "Fn::Join": Array [
912
+ "",
913
+ Array [
914
+ "s3://",
915
+ Object {
916
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
917
+ },
918
+ "/",
919
+ Object {
920
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
921
+ },
922
+ "/resolvers/Query.getPost.res.vtl",
923
+ ],
924
+ ],
925
+ },
926
+ },
927
+ "Type": "AWS::AppSync::FunctionConfiguration",
928
+ },
929
+ "QueryListPostsDataResolverFnQueryListPostsDataResolverFnAppSyncFunction3D526AB7": Object {
930
+ "DependsOn": Array [
931
+ "PostDataSource",
932
+ ],
933
+ "Properties": Object {
934
+ "ApiId": Object {
935
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
936
+ },
937
+ "DataSourceName": Object {
938
+ "Fn::GetAtt": Array [
939
+ "PostDataSource",
940
+ "Name",
941
+ ],
942
+ },
943
+ "FunctionVersion": "2018-05-29",
944
+ "Name": "QueryListPostsDataResolverFn",
945
+ "RequestMappingTemplateS3Location": Object {
946
+ "Fn::Join": Array [
947
+ "",
948
+ Array [
949
+ "s3://",
950
+ Object {
951
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
952
+ },
953
+ "/",
954
+ Object {
955
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
956
+ },
957
+ "/resolvers/Query.listPosts.req.vtl",
958
+ ],
959
+ ],
960
+ },
961
+ "ResponseMappingTemplateS3Location": Object {
962
+ "Fn::Join": Array [
963
+ "",
964
+ Array [
965
+ "s3://",
966
+ Object {
967
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
968
+ },
969
+ "/",
970
+ Object {
971
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
972
+ },
973
+ "/resolvers/Query.listPosts.res.vtl",
974
+ ],
975
+ ],
976
+ },
977
+ },
978
+ "Type": "AWS::AppSync::FunctionConfiguration",
979
+ },
980
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F": Object {
981
+ "Properties": Object {
982
+ "ApiId": Object {
983
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
984
+ },
985
+ "DataSourceName": Object {
986
+ "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name",
987
+ },
988
+ "FunctionVersion": "2018-05-29",
989
+ "Name": "QuerygetPostpostAuth0Function",
990
+ "RequestMappingTemplateS3Location": Object {
991
+ "Fn::Join": Array [
992
+ "",
993
+ Array [
994
+ "s3://",
995
+ Object {
996
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
997
+ },
998
+ "/",
999
+ Object {
1000
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1001
+ },
1002
+ "/resolvers/Query.getPost.postAuth.1.req.vtl",
1003
+ ],
1004
+ ],
1005
+ },
1006
+ "ResponseMappingTemplate": "$util.toJson({})",
1007
+ },
1008
+ "Type": "AWS::AppSync::FunctionConfiguration",
1009
+ },
1010
+ "SubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionB4572868": Object {
1011
+ "Properties": Object {
1012
+ "ApiId": Object {
1013
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1014
+ },
1015
+ "DataSourceName": Object {
1016
+ "Ref": "referencetotransformerrootstackGraphQLAPINONEDS2BA9D1C8Name",
1017
+ },
1018
+ "FunctionVersion": "2018-05-29",
1019
+ "Name": "SubscriptionOnCreatePostDataResolverFn",
1020
+ "RequestMappingTemplateS3Location": Object {
1021
+ "Fn::Join": Array [
1022
+ "",
1023
+ Array [
1024
+ "s3://",
1025
+ Object {
1026
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1027
+ },
1028
+ "/",
1029
+ Object {
1030
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1031
+ },
1032
+ "/resolvers/Subscription.onCreatePost.req.vtl",
1033
+ ],
1034
+ ],
1035
+ },
1036
+ "ResponseMappingTemplateS3Location": Object {
1037
+ "Fn::Join": Array [
1038
+ "",
1039
+ Array [
1040
+ "s3://",
1041
+ Object {
1042
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1043
+ },
1044
+ "/",
1045
+ Object {
1046
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1047
+ },
1048
+ "/resolvers/Subscription.onCreatePost.res.vtl",
1049
+ ],
1050
+ ],
1051
+ },
1052
+ },
1053
+ "Type": "AWS::AppSync::FunctionConfiguration",
1054
+ },
1055
+ "SubscriptiononCreatePostResolver": Object {
1056
+ "Properties": Object {
1057
+ "ApiId": Object {
1058
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1059
+ },
1060
+ "FieldName": "onCreatePost",
1061
+ "Kind": "PIPELINE",
1062
+ "PipelineConfig": Object {
1063
+ "Functions": Array [
1064
+ Object {
1065
+ "Fn::GetAtt": Array [
1066
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
1067
+ "FunctionId",
1068
+ ],
1069
+ },
1070
+ Object {
1071
+ "Fn::GetAtt": Array [
1072
+ "SubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionB4572868",
1073
+ "FunctionId",
1074
+ ],
1075
+ },
1076
+ ],
1077
+ },
1078
+ "RequestMappingTemplate": Object {
1079
+ "Fn::Join": Array [
1080
+ "",
1081
+ Array [
1082
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
1083
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onCreatePost\\"))
1084
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1085
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1086
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
1087
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1088
+ Object {
1089
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1090
+ },
1091
+ "\\"))
1092
+
1093
+ $util.toJson({})",
1094
+ ],
1095
+ ],
1096
+ },
1097
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1098
+ "TypeName": "Subscription",
1099
+ },
1100
+ "Type": "AWS::AppSync::Resolver",
1101
+ },
1102
+ "SubscriptiononDeletePostResolver": Object {
1103
+ "Properties": Object {
1104
+ "ApiId": Object {
1105
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1106
+ },
1107
+ "FieldName": "onDeletePost",
1108
+ "Kind": "PIPELINE",
1109
+ "PipelineConfig": Object {
1110
+ "Functions": Array [
1111
+ Object {
1112
+ "Fn::GetAtt": Array [
1113
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
1114
+ "FunctionId",
1115
+ ],
1116
+ },
1117
+ Object {
1118
+ "Fn::GetAtt": Array [
1119
+ "SubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionB4572868",
1120
+ "FunctionId",
1121
+ ],
1122
+ },
1123
+ ],
1124
+ },
1125
+ "RequestMappingTemplate": Object {
1126
+ "Fn::Join": Array [
1127
+ "",
1128
+ Array [
1129
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
1130
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onDeletePost\\"))
1131
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1132
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1133
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
1134
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1135
+ Object {
1136
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1137
+ },
1138
+ "\\"))
1139
+
1140
+ $util.toJson({})",
1141
+ ],
1142
+ ],
1143
+ },
1144
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1145
+ "TypeName": "Subscription",
1146
+ },
1147
+ "Type": "AWS::AppSync::Resolver",
1148
+ },
1149
+ "SubscriptiononUpdatePostResolver": Object {
1150
+ "Properties": Object {
1151
+ "ApiId": Object {
1152
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1153
+ },
1154
+ "FieldName": "onUpdatePost",
1155
+ "Kind": "PIPELINE",
1156
+ "PipelineConfig": Object {
1157
+ "Functions": Array [
1158
+ Object {
1159
+ "Fn::GetAtt": Array [
1160
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
1161
+ "FunctionId",
1162
+ ],
1163
+ },
1164
+ Object {
1165
+ "Fn::GetAtt": Array [
1166
+ "SubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionB4572868",
1167
+ "FunctionId",
1168
+ ],
1169
+ },
1170
+ ],
1171
+ },
1172
+ "RequestMappingTemplate": Object {
1173
+ "Fn::Join": Array [
1174
+ "",
1175
+ Array [
1176
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
1177
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onUpdatePost\\"))
1178
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1179
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1180
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
1181
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1182
+ Object {
1183
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1184
+ },
1185
+ "\\"))
1186
+
1187
+ $util.toJson({})",
1188
+ ],
1189
+ ],
1190
+ },
1191
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1192
+ "TypeName": "Subscription",
1193
+ },
1194
+ "Type": "AWS::AppSync::Resolver",
1195
+ },
1196
+ "UpdatePostResolver": Object {
1197
+ "Properties": Object {
1198
+ "ApiId": Object {
1199
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1200
+ },
1201
+ "FieldName": "updatePost",
1202
+ "Kind": "PIPELINE",
1203
+ "PipelineConfig": Object {
1204
+ "Functions": Array [
1205
+ Object {
1206
+ "Fn::GetAtt": Array [
1207
+ "MutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunctionBAC7D532",
1208
+ "FunctionId",
1209
+ ],
1210
+ },
1211
+ Object {
1212
+ "Fn::GetAtt": Array [
1213
+ "QuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunctionC72E5C0F",
1214
+ "FunctionId",
1215
+ ],
1216
+ },
1217
+ Object {
1218
+ "Fn::GetAtt": Array [
1219
+ "MutationUpdatePostDataResolverFnMutationUpdatePostDataResolverFnAppSyncFunctionBF7D410D",
1220
+ "FunctionId",
1221
+ ],
1222
+ },
1223
+ ],
1224
+ },
1225
+ "RequestMappingTemplate": Object {
1226
+ "Fn::Join": Array [
1227
+ "",
1228
+ Array [
1229
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
1230
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"updatePost\\"))
1231
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1232
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1233
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
1234
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1235
+ Object {
1236
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1237
+ },
1238
+ "\\"))
1239
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
1240
+ Object {
1241
+ "Ref": "PostTable",
1242
+ },
1243
+ "\\"))
1244
+ $util.toJson({})",
1245
+ ],
1246
+ ],
1247
+ },
1248
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1249
+ "TypeName": "Mutation",
1250
+ },
1251
+ "Type": "AWS::AppSync::Resolver",
1252
+ },
1253
+ },
1254
+ }
1255
+ `;
1256
+
1257
+ exports[`ModelTransformer: should not override model objects when override file does not exist 2`] = `
1258
+ Object {
1259
+ "Conditions": Object {
1260
+ "HasEnvironmentParameter": Object {
1261
+ "Fn::Not": Array [
1262
+ Object {
1263
+ "Fn::Equals": Array [
1264
+ Object {
1265
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
1266
+ },
1267
+ "NONE",
1268
+ ],
1269
+ },
1270
+ ],
1271
+ },
1272
+ "ShouldUsePayPerRequestBilling": Object {
1273
+ "Fn::Equals": Array [
1274
+ Object {
1275
+ "Ref": "DynamoDBBillingMode",
1276
+ },
1277
+ "PAY_PER_REQUEST",
1278
+ ],
1279
+ },
1280
+ "ShouldUsePointInTimeRecovery": Object {
1281
+ "Fn::Equals": Array [
1282
+ Object {
1283
+ "Ref": "DynamoDBEnablePointInTimeRecovery",
1284
+ },
1285
+ "true",
1286
+ ],
1287
+ },
1288
+ "ShouldUseServerSideEncryption": Object {
1289
+ "Fn::Equals": Array [
1290
+ Object {
1291
+ "Ref": "DynamoDBEnableServerSideEncryption",
1292
+ },
1293
+ "true",
1294
+ ],
1295
+ },
1296
+ },
1297
+ "Outputs": Object {
1298
+ "GetAttCommentDataSourceName": Object {
1299
+ "Description": "Your model DataSource name.",
1300
+ "Export": Object {
1301
+ "Name": Object {
1302
+ "Fn::Join": Array [
1303
+ ":",
1304
+ Array [
1305
+ Object {
1306
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1307
+ },
1308
+ "GetAtt:CommentDataSource:Name",
1309
+ ],
1310
+ ],
1311
+ },
1312
+ },
1313
+ "Value": Object {
1314
+ "Fn::GetAtt": Array [
1315
+ "CommentDataSource",
1316
+ "Name",
1317
+ ],
1318
+ },
1319
+ },
1320
+ "GetAttCommentTableName": Object {
1321
+ "Description": "Your DynamoDB table name.",
1322
+ "Export": Object {
1323
+ "Name": Object {
1324
+ "Fn::Join": Array [
1325
+ ":",
1326
+ Array [
1327
+ Object {
1328
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1329
+ },
1330
+ "GetAtt:CommentTable:Name",
1331
+ ],
1332
+ ],
1333
+ },
1334
+ },
1335
+ "Value": Object {
1336
+ "Ref": "CommentTable",
1337
+ },
1338
+ },
1339
+ "GetAttCommentTableStreamArn": Object {
1340
+ "Description": "Your DynamoDB table StreamArn.",
1341
+ "Export": Object {
1342
+ "Name": Object {
1343
+ "Fn::Join": Array [
1344
+ ":",
1345
+ Array [
1346
+ Object {
1347
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1348
+ },
1349
+ "GetAtt:CommentTable:StreamArn",
1350
+ ],
1351
+ ],
1352
+ },
1353
+ },
1354
+ "Value": Object {
1355
+ "Fn::GetAtt": Array [
1356
+ "CommentTable",
1357
+ "StreamArn",
1358
+ ],
1359
+ },
1360
+ },
1361
+ },
1362
+ "Parameters": Object {
1363
+ "DynamoDBBillingMode": Object {
1364
+ "AllowedValues": Array [
1365
+ "PAY_PER_REQUEST",
1366
+ "PROVISIONED",
1367
+ ],
1368
+ "Default": "PAY_PER_REQUEST",
1369
+ "Description": "Configure @model types to create DynamoDB tables with PAY_PER_REQUEST or PROVISIONED billing modes.",
1370
+ "Type": "String",
1371
+ },
1372
+ "DynamoDBEnablePointInTimeRecovery": Object {
1373
+ "AllowedValues": Array [
1374
+ "true",
1375
+ "false",
1376
+ ],
1377
+ "Default": "false",
1378
+ "Description": "Whether to enable Point in Time Recovery on the table.",
1379
+ "Type": "String",
1380
+ },
1381
+ "DynamoDBEnableServerSideEncryption": Object {
1382
+ "AllowedValues": Array [
1383
+ "true",
1384
+ "false",
1385
+ ],
1386
+ "Default": "true",
1387
+ "Description": "Enable server side encryption powered by KMS.",
1388
+ "Type": "String",
1389
+ },
1390
+ "DynamoDBModelTableReadIOPS": Object {
1391
+ "Default": 5,
1392
+ "Description": "The number of read IOPS the table should support.",
1393
+ "Type": "Number",
1394
+ },
1395
+ "DynamoDBModelTableWriteIOPS": Object {
1396
+ "Default": 5,
1397
+ "Description": "The number of write IOPS the table should support.",
1398
+ "Type": "Number",
1399
+ },
1400
+ "referencetotransformerrootstackGraphQLAPI20497F53ApiId": Object {
1401
+ "Type": "String",
1402
+ },
1403
+ "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostMutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunctionB82DB57BFunctionId": Object {
1404
+ "Type": "String",
1405
+ },
1406
+ "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostMutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunction148F70DDFunctionId": Object {
1407
+ "Type": "String",
1408
+ },
1409
+ "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId": Object {
1410
+ "Type": "String",
1411
+ },
1412
+ "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostSubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionAE3ECF1FFunctionId": Object {
1413
+ "Type": "String",
1414
+ },
1415
+ "referencetotransformerrootstackS3DeploymentBucket7592718ARef": Object {
1416
+ "Type": "String",
1417
+ },
1418
+ "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref": Object {
1419
+ "Type": "String",
1420
+ },
1421
+ "referencetotransformerrootstackenv10C5A902Ref": Object {
1422
+ "Type": "String",
1423
+ },
1424
+ },
1425
+ "Resources": Object {
1426
+ "CommentDataSource": Object {
1427
+ "DependsOn": Array [
1428
+ "CommentIAMRoleD5EC5F51",
1429
+ ],
1430
+ "Properties": Object {
1431
+ "ApiId": Object {
1432
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1433
+ },
1434
+ "DynamoDBConfig": Object {
1435
+ "AwsRegion": Object {
1436
+ "Ref": "AWS::Region",
1437
+ },
1438
+ "TableName": Object {
1439
+ "Ref": "CommentTable",
1440
+ },
1441
+ },
1442
+ "Name": "CommentTable",
1443
+ "ServiceRoleArn": Object {
1444
+ "Fn::GetAtt": Array [
1445
+ "CommentIAMRoleD5EC5F51",
1446
+ "Arn",
1447
+ ],
1448
+ },
1449
+ "Type": "AMAZON_DYNAMODB",
1450
+ },
1451
+ "Type": "AWS::AppSync::DataSource",
1452
+ },
1453
+ "CommentIAMRoleD5EC5F51": Object {
1454
+ "Properties": Object {
1455
+ "AssumeRolePolicyDocument": Object {
1456
+ "Statement": Array [
1457
+ Object {
1458
+ "Action": "sts:AssumeRole",
1459
+ "Effect": "Allow",
1460
+ "Principal": Object {
1461
+ "Service": "appsync.amazonaws.com",
1462
+ },
1463
+ },
1464
+ ],
1465
+ "Version": "2012-10-17",
1466
+ },
1467
+ "RoleName": Object {
1468
+ "Fn::Join": Array [
1469
+ "",
1470
+ Array [
1471
+ "CommentIAMRole20388d-",
1472
+ Object {
1473
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1474
+ },
1475
+ "-",
1476
+ Object {
1477
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
1478
+ },
1479
+ ],
1480
+ ],
1481
+ },
1482
+ },
1483
+ "Type": "AWS::IAM::Role",
1484
+ },
1485
+ "CommentIAMRoleDefaultPolicyA8D6F6B5": Object {
1486
+ "Properties": Object {
1487
+ "PolicyDocument": Object {
1488
+ "Statement": Array [
1489
+ Object {
1490
+ "Action": Array [
1491
+ "dynamodb:BatchGetItem",
1492
+ "dynamodb:GetRecords",
1493
+ "dynamodb:GetShardIterator",
1494
+ "dynamodb:Query",
1495
+ "dynamodb:GetItem",
1496
+ "dynamodb:Scan",
1497
+ "dynamodb:ConditionCheckItem",
1498
+ "dynamodb:BatchWriteItem",
1499
+ "dynamodb:PutItem",
1500
+ "dynamodb:UpdateItem",
1501
+ "dynamodb:DeleteItem",
1502
+ "dynamodb:DescribeTable",
1503
+ ],
1504
+ "Effect": "Allow",
1505
+ "Resource": Array [
1506
+ Object {
1507
+ "Fn::GetAtt": Array [
1508
+ "CommentTable",
1509
+ "Arn",
1510
+ ],
1511
+ },
1512
+ Object {
1513
+ "Ref": "AWS::NoValue",
1514
+ },
1515
+ ],
1516
+ },
1517
+ ],
1518
+ "Version": "2012-10-17",
1519
+ },
1520
+ "PolicyName": "CommentIAMRoleDefaultPolicyA8D6F6B5",
1521
+ "Roles": Array [
1522
+ Object {
1523
+ "Ref": "CommentIAMRoleD5EC5F51",
1524
+ },
1525
+ ],
1526
+ },
1527
+ "Type": "AWS::IAM::Policy",
1528
+ },
1529
+ "CommentTable": Object {
1530
+ "DeletionPolicy": "Delete",
1531
+ "Properties": Object {
1532
+ "AttributeDefinitions": Array [
1533
+ Object {
1534
+ "AttributeName": "id",
1535
+ "AttributeType": "S",
1536
+ },
1537
+ ],
1538
+ "BillingMode": Object {
1539
+ "Fn::If": Array [
1540
+ "ShouldUsePayPerRequestBilling",
1541
+ "PAY_PER_REQUEST",
1542
+ Object {
1543
+ "Ref": "AWS::NoValue",
1544
+ },
1545
+ ],
1546
+ },
1547
+ "KeySchema": Array [
1548
+ Object {
1549
+ "AttributeName": "id",
1550
+ "KeyType": "HASH",
1551
+ },
1552
+ ],
1553
+ "PointInTimeRecoverySpecification": Object {
1554
+ "Fn::If": Array [
1555
+ "ShouldUsePointInTimeRecovery",
1556
+ Object {
1557
+ "PointInTimeRecoveryEnabled": true,
1558
+ },
1559
+ Object {
1560
+ "Ref": "AWS::NoValue",
1561
+ },
1562
+ ],
1563
+ },
1564
+ "ProvisionedThroughput": Object {
1565
+ "Fn::If": Array [
1566
+ "ShouldUsePayPerRequestBilling",
1567
+ Object {
1568
+ "Ref": "AWS::NoValue",
1569
+ },
1570
+ Object {
1571
+ "ReadCapacityUnits": Object {
1572
+ "Ref": "DynamoDBModelTableReadIOPS",
1573
+ },
1574
+ "WriteCapacityUnits": Object {
1575
+ "Ref": "DynamoDBModelTableWriteIOPS",
1576
+ },
1577
+ },
1578
+ ],
1579
+ },
1580
+ "SSESpecification": Object {
1581
+ "SSEEnabled": Object {
1582
+ "Fn::If": Array [
1583
+ "ShouldUseServerSideEncryption",
1584
+ true,
1585
+ false,
1586
+ ],
1587
+ },
1588
+ },
1589
+ "StreamSpecification": Object {
1590
+ "StreamViewType": "NEW_AND_OLD_IMAGES",
1591
+ },
1592
+ "TableName": Object {
1593
+ "Fn::Join": Array [
1594
+ "",
1595
+ Array [
1596
+ "Comment-",
1597
+ Object {
1598
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1599
+ },
1600
+ "-",
1601
+ Object {
1602
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
1603
+ },
1604
+ ],
1605
+ ],
1606
+ },
1607
+ },
1608
+ "Type": "AWS::DynamoDB::Table",
1609
+ "UpdateReplacePolicy": "Delete",
1610
+ },
1611
+ "CreateCommentResolver": Object {
1612
+ "Properties": Object {
1613
+ "ApiId": Object {
1614
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1615
+ },
1616
+ "FieldName": "createComment",
1617
+ "Kind": "PIPELINE",
1618
+ "PipelineConfig": Object {
1619
+ "Functions": Array [
1620
+ Object {
1621
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostMutationcreatePostinit0FunctionMutationcreatePostinit0FunctionAppSyncFunctionB82DB57BFunctionId",
1622
+ },
1623
+ Object {
1624
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
1625
+ },
1626
+ Object {
1627
+ "Fn::GetAtt": Array [
1628
+ "MutationCreateCommentDataResolverFnMutationCreateCommentDataResolverFnAppSyncFunctionD019FFE0",
1629
+ "FunctionId",
1630
+ ],
1631
+ },
1632
+ ],
1633
+ },
1634
+ "RequestMappingTemplate": Object {
1635
+ "Fn::Join": Array [
1636
+ "",
1637
+ Array [
1638
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
1639
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"createComment\\"))
1640
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1641
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1642
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
1643
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1644
+ Object {
1645
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1646
+ },
1647
+ "\\"))
1648
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
1649
+ Object {
1650
+ "Ref": "CommentTable",
1651
+ },
1652
+ "\\"))
1653
+ $util.toJson({})",
1654
+ ],
1655
+ ],
1656
+ },
1657
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1658
+ "TypeName": "Mutation",
1659
+ },
1660
+ "Type": "AWS::AppSync::Resolver",
1661
+ },
1662
+ "DeleteCommentResolver": Object {
1663
+ "Properties": Object {
1664
+ "ApiId": Object {
1665
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1666
+ },
1667
+ "FieldName": "deleteComment",
1668
+ "Kind": "PIPELINE",
1669
+ "PipelineConfig": Object {
1670
+ "Functions": Array [
1671
+ Object {
1672
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
1673
+ },
1674
+ Object {
1675
+ "Fn::GetAtt": Array [
1676
+ "MutationDeleteCommentDataResolverFnMutationDeleteCommentDataResolverFnAppSyncFunctionD661C8CB",
1677
+ "FunctionId",
1678
+ ],
1679
+ },
1680
+ ],
1681
+ },
1682
+ "RequestMappingTemplate": Object {
1683
+ "Fn::Join": Array [
1684
+ "",
1685
+ Array [
1686
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
1687
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"deleteComment\\"))
1688
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1689
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1690
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
1691
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1692
+ Object {
1693
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1694
+ },
1695
+ "\\"))
1696
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
1697
+ Object {
1698
+ "Ref": "CommentTable",
1699
+ },
1700
+ "\\"))
1701
+ $util.toJson({})",
1702
+ ],
1703
+ ],
1704
+ },
1705
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1706
+ "TypeName": "Mutation",
1707
+ },
1708
+ "Type": "AWS::AppSync::Resolver",
1709
+ },
1710
+ "DynamoDBAccess71ABE5AE": Object {
1711
+ "Properties": Object {
1712
+ "PolicyDocument": Object {
1713
+ "Statement": Array [
1714
+ Object {
1715
+ "Action": Array [
1716
+ "dynamodb:BatchGetItem",
1717
+ "dynamodb:BatchWriteItem",
1718
+ "dynamodb:PutItem",
1719
+ "dynamodb:DeleteItem",
1720
+ "dynamodb:GetItem",
1721
+ "dynamodb:Scan",
1722
+ "dynamodb:Query",
1723
+ "dynamodb:UpdateItem",
1724
+ ],
1725
+ "Effect": "Allow",
1726
+ "Resource": Array [
1727
+ Object {
1728
+ "Fn::Sub": Array [
1729
+ "arn:aws:dynamodb:\${AWS::Region}:\${AWS::AccountId}:table/\${tablename}",
1730
+ Object {
1731
+ "tablename": Object {
1732
+ "Fn::Join": Array [
1733
+ "",
1734
+ Array [
1735
+ "Comment-",
1736
+ Object {
1737
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1738
+ },
1739
+ "-",
1740
+ Object {
1741
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
1742
+ },
1743
+ ],
1744
+ ],
1745
+ },
1746
+ },
1747
+ ],
1748
+ },
1749
+ Object {
1750
+ "Fn::Sub": Array [
1751
+ "arn:aws:dynamodb:\${AWS::Region}:\${AWS::AccountId}:table/\${tablename}/*",
1752
+ Object {
1753
+ "tablename": Object {
1754
+ "Fn::Join": Array [
1755
+ "",
1756
+ Array [
1757
+ "Comment-",
1758
+ Object {
1759
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1760
+ },
1761
+ "-",
1762
+ Object {
1763
+ "Ref": "referencetotransformerrootstackenv10C5A902Ref",
1764
+ },
1765
+ ],
1766
+ ],
1767
+ },
1768
+ },
1769
+ ],
1770
+ },
1771
+ ],
1772
+ },
1773
+ ],
1774
+ "Version": "2012-10-17",
1775
+ },
1776
+ "PolicyName": "DynamoDBAccess71ABE5AE",
1777
+ "Roles": Array [
1778
+ Object {
1779
+ "Ref": "CommentIAMRoleD5EC5F51",
1780
+ },
1781
+ ],
1782
+ },
1783
+ "Type": "AWS::IAM::Policy",
1784
+ },
1785
+ "GetCommentResolver": Object {
1786
+ "Properties": Object {
1787
+ "ApiId": Object {
1788
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1789
+ },
1790
+ "FieldName": "getComment",
1791
+ "Kind": "PIPELINE",
1792
+ "PipelineConfig": Object {
1793
+ "Functions": Array [
1794
+ Object {
1795
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
1796
+ },
1797
+ Object {
1798
+ "Fn::GetAtt": Array [
1799
+ "QueryGetCommentDataResolverFnQueryGetCommentDataResolverFnAppSyncFunction8473E2B0",
1800
+ "FunctionId",
1801
+ ],
1802
+ },
1803
+ ],
1804
+ },
1805
+ "RequestMappingTemplate": Object {
1806
+ "Fn::Join": Array [
1807
+ "",
1808
+ Array [
1809
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Query\\"))
1810
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"getComment\\"))
1811
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1812
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1813
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
1814
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1815
+ Object {
1816
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1817
+ },
1818
+ "\\"))
1819
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
1820
+ Object {
1821
+ "Ref": "CommentTable",
1822
+ },
1823
+ "\\"))
1824
+ $util.toJson({})",
1825
+ ],
1826
+ ],
1827
+ },
1828
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1829
+ "TypeName": "Query",
1830
+ },
1831
+ "Type": "AWS::AppSync::Resolver",
1832
+ },
1833
+ "ListCommentResolver": Object {
1834
+ "Properties": Object {
1835
+ "ApiId": Object {
1836
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1837
+ },
1838
+ "FieldName": "listComments",
1839
+ "Kind": "PIPELINE",
1840
+ "PipelineConfig": Object {
1841
+ "Functions": Array [
1842
+ Object {
1843
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
1844
+ },
1845
+ Object {
1846
+ "Fn::GetAtt": Array [
1847
+ "QueryListCommentsDataResolverFnQueryListCommentsDataResolverFnAppSyncFunction474D4A91",
1848
+ "FunctionId",
1849
+ ],
1850
+ },
1851
+ ],
1852
+ },
1853
+ "RequestMappingTemplate": Object {
1854
+ "Fn::Join": Array [
1855
+ "",
1856
+ Array [
1857
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Query\\"))
1858
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"listComments\\"))
1859
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
1860
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
1861
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
1862
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
1863
+ Object {
1864
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1865
+ },
1866
+ "\\"))
1867
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
1868
+ Object {
1869
+ "Ref": "CommentTable",
1870
+ },
1871
+ "\\"))
1872
+ $util.toJson({})",
1873
+ ],
1874
+ ],
1875
+ },
1876
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
1877
+ "TypeName": "Query",
1878
+ },
1879
+ "Type": "AWS::AppSync::Resolver",
1880
+ },
1881
+ "MutationCreateCommentDataResolverFnMutationCreateCommentDataResolverFnAppSyncFunctionD019FFE0": Object {
1882
+ "DependsOn": Array [
1883
+ "CommentDataSource",
1884
+ ],
1885
+ "Properties": Object {
1886
+ "ApiId": Object {
1887
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1888
+ },
1889
+ "DataSourceName": Object {
1890
+ "Fn::GetAtt": Array [
1891
+ "CommentDataSource",
1892
+ "Name",
1893
+ ],
1894
+ },
1895
+ "FunctionVersion": "2018-05-29",
1896
+ "Name": "MutationCreateCommentDataResolverFn",
1897
+ "RequestMappingTemplateS3Location": Object {
1898
+ "Fn::Join": Array [
1899
+ "",
1900
+ Array [
1901
+ "s3://",
1902
+ Object {
1903
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1904
+ },
1905
+ "/",
1906
+ Object {
1907
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1908
+ },
1909
+ "/resolvers/Mutation.createComment.req.vtl",
1910
+ ],
1911
+ ],
1912
+ },
1913
+ "ResponseMappingTemplateS3Location": Object {
1914
+ "Fn::Join": Array [
1915
+ "",
1916
+ Array [
1917
+ "s3://",
1918
+ Object {
1919
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1920
+ },
1921
+ "/",
1922
+ Object {
1923
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1924
+ },
1925
+ "/resolvers/Mutation.createComment.res.vtl",
1926
+ ],
1927
+ ],
1928
+ },
1929
+ },
1930
+ "Type": "AWS::AppSync::FunctionConfiguration",
1931
+ },
1932
+ "MutationDeleteCommentDataResolverFnMutationDeleteCommentDataResolverFnAppSyncFunctionD661C8CB": Object {
1933
+ "DependsOn": Array [
1934
+ "CommentDataSource",
1935
+ ],
1936
+ "Properties": Object {
1937
+ "ApiId": Object {
1938
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1939
+ },
1940
+ "DataSourceName": Object {
1941
+ "Fn::GetAtt": Array [
1942
+ "CommentDataSource",
1943
+ "Name",
1944
+ ],
1945
+ },
1946
+ "FunctionVersion": "2018-05-29",
1947
+ "Name": "MutationDeleteCommentDataResolverFn",
1948
+ "RequestMappingTemplateS3Location": Object {
1949
+ "Fn::Join": Array [
1950
+ "",
1951
+ Array [
1952
+ "s3://",
1953
+ Object {
1954
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1955
+ },
1956
+ "/",
1957
+ Object {
1958
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1959
+ },
1960
+ "/resolvers/Mutation.deleteComment.req.vtl",
1961
+ ],
1962
+ ],
1963
+ },
1964
+ "ResponseMappingTemplateS3Location": Object {
1965
+ "Fn::Join": Array [
1966
+ "",
1967
+ Array [
1968
+ "s3://",
1969
+ Object {
1970
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
1971
+ },
1972
+ "/",
1973
+ Object {
1974
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
1975
+ },
1976
+ "/resolvers/Mutation.deleteComment.res.vtl",
1977
+ ],
1978
+ ],
1979
+ },
1980
+ },
1981
+ "Type": "AWS::AppSync::FunctionConfiguration",
1982
+ },
1983
+ "MutationUpdateCommentDataResolverFnMutationUpdateCommentDataResolverFnAppSyncFunctionB47372B5": Object {
1984
+ "DependsOn": Array [
1985
+ "CommentDataSource",
1986
+ ],
1987
+ "Properties": Object {
1988
+ "ApiId": Object {
1989
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
1990
+ },
1991
+ "DataSourceName": Object {
1992
+ "Fn::GetAtt": Array [
1993
+ "CommentDataSource",
1994
+ "Name",
1995
+ ],
1996
+ },
1997
+ "FunctionVersion": "2018-05-29",
1998
+ "Name": "MutationUpdateCommentDataResolverFn",
1999
+ "RequestMappingTemplateS3Location": Object {
2000
+ "Fn::Join": Array [
2001
+ "",
2002
+ Array [
2003
+ "s3://",
2004
+ Object {
2005
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2006
+ },
2007
+ "/",
2008
+ Object {
2009
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2010
+ },
2011
+ "/resolvers/Mutation.updateComment.req.vtl",
2012
+ ],
2013
+ ],
2014
+ },
2015
+ "ResponseMappingTemplateS3Location": Object {
2016
+ "Fn::Join": Array [
2017
+ "",
2018
+ Array [
2019
+ "s3://",
2020
+ Object {
2021
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2022
+ },
2023
+ "/",
2024
+ Object {
2025
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2026
+ },
2027
+ "/resolvers/Mutation.updateComment.res.vtl",
2028
+ ],
2029
+ ],
2030
+ },
2031
+ },
2032
+ "Type": "AWS::AppSync::FunctionConfiguration",
2033
+ },
2034
+ "QueryGetCommentDataResolverFnQueryGetCommentDataResolverFnAppSyncFunction8473E2B0": Object {
2035
+ "DependsOn": Array [
2036
+ "CommentDataSource",
2037
+ ],
2038
+ "Properties": Object {
2039
+ "ApiId": Object {
2040
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2041
+ },
2042
+ "DataSourceName": Object {
2043
+ "Fn::GetAtt": Array [
2044
+ "CommentDataSource",
2045
+ "Name",
2046
+ ],
2047
+ },
2048
+ "FunctionVersion": "2018-05-29",
2049
+ "Name": "QueryGetCommentDataResolverFn",
2050
+ "RequestMappingTemplateS3Location": Object {
2051
+ "Fn::Join": Array [
2052
+ "",
2053
+ Array [
2054
+ "s3://",
2055
+ Object {
2056
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2057
+ },
2058
+ "/",
2059
+ Object {
2060
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2061
+ },
2062
+ "/resolvers/Query.getComment.req.vtl",
2063
+ ],
2064
+ ],
2065
+ },
2066
+ "ResponseMappingTemplateS3Location": Object {
2067
+ "Fn::Join": Array [
2068
+ "",
2069
+ Array [
2070
+ "s3://",
2071
+ Object {
2072
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2073
+ },
2074
+ "/",
2075
+ Object {
2076
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2077
+ },
2078
+ "/resolvers/Query.getComment.res.vtl",
2079
+ ],
2080
+ ],
2081
+ },
2082
+ },
2083
+ "Type": "AWS::AppSync::FunctionConfiguration",
2084
+ },
2085
+ "QueryListCommentsDataResolverFnQueryListCommentsDataResolverFnAppSyncFunction474D4A91": Object {
2086
+ "DependsOn": Array [
2087
+ "CommentDataSource",
2088
+ ],
2089
+ "Properties": Object {
2090
+ "ApiId": Object {
2091
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2092
+ },
2093
+ "DataSourceName": Object {
2094
+ "Fn::GetAtt": Array [
2095
+ "CommentDataSource",
2096
+ "Name",
2097
+ ],
2098
+ },
2099
+ "FunctionVersion": "2018-05-29",
2100
+ "Name": "QueryListCommentsDataResolverFn",
2101
+ "RequestMappingTemplateS3Location": Object {
2102
+ "Fn::Join": Array [
2103
+ "",
2104
+ Array [
2105
+ "s3://",
2106
+ Object {
2107
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2108
+ },
2109
+ "/",
2110
+ Object {
2111
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2112
+ },
2113
+ "/resolvers/Query.listComments.req.vtl",
2114
+ ],
2115
+ ],
2116
+ },
2117
+ "ResponseMappingTemplateS3Location": Object {
2118
+ "Fn::Join": Array [
2119
+ "",
2120
+ Array [
2121
+ "s3://",
2122
+ Object {
2123
+ "Ref": "referencetotransformerrootstackS3DeploymentBucket7592718ARef",
2124
+ },
2125
+ "/",
2126
+ Object {
2127
+ "Ref": "referencetotransformerrootstackS3DeploymentRootKeyA71EA735Ref",
2128
+ },
2129
+ "/resolvers/Query.listComments.res.vtl",
2130
+ ],
2131
+ ],
2132
+ },
2133
+ },
2134
+ "Type": "AWS::AppSync::FunctionConfiguration",
2135
+ },
2136
+ "SubscriptiononCreateCommentResolver": Object {
2137
+ "Properties": Object {
2138
+ "ApiId": Object {
2139
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2140
+ },
2141
+ "FieldName": "onCreateComment",
2142
+ "Kind": "PIPELINE",
2143
+ "PipelineConfig": Object {
2144
+ "Functions": Array [
2145
+ Object {
2146
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
2147
+ },
2148
+ Object {
2149
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostSubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionAE3ECF1FFunctionId",
2150
+ },
2151
+ ],
2152
+ },
2153
+ "RequestMappingTemplate": Object {
2154
+ "Fn::Join": Array [
2155
+ "",
2156
+ Array [
2157
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
2158
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onCreateComment\\"))
2159
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
2160
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
2161
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
2162
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
2163
+ Object {
2164
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2165
+ },
2166
+ "\\"))
2167
+
2168
+ $util.toJson({})",
2169
+ ],
2170
+ ],
2171
+ },
2172
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
2173
+ "TypeName": "Subscription",
2174
+ },
2175
+ "Type": "AWS::AppSync::Resolver",
2176
+ },
2177
+ "SubscriptiononDeleteCommentResolver": Object {
2178
+ "Properties": Object {
2179
+ "ApiId": Object {
2180
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2181
+ },
2182
+ "FieldName": "onDeleteComment",
2183
+ "Kind": "PIPELINE",
2184
+ "PipelineConfig": Object {
2185
+ "Functions": Array [
2186
+ Object {
2187
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
2188
+ },
2189
+ Object {
2190
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostSubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionAE3ECF1FFunctionId",
2191
+ },
2192
+ ],
2193
+ },
2194
+ "RequestMappingTemplate": Object {
2195
+ "Fn::Join": Array [
2196
+ "",
2197
+ Array [
2198
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
2199
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onDeleteComment\\"))
2200
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
2201
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
2202
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
2203
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
2204
+ Object {
2205
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2206
+ },
2207
+ "\\"))
2208
+
2209
+ $util.toJson({})",
2210
+ ],
2211
+ ],
2212
+ },
2213
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
2214
+ "TypeName": "Subscription",
2215
+ },
2216
+ "Type": "AWS::AppSync::Resolver",
2217
+ },
2218
+ "SubscriptiononUpdateCommentResolver": Object {
2219
+ "Properties": Object {
2220
+ "ApiId": Object {
2221
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2222
+ },
2223
+ "FieldName": "onUpdateComment",
2224
+ "Kind": "PIPELINE",
2225
+ "PipelineConfig": Object {
2226
+ "Functions": Array [
2227
+ Object {
2228
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
2229
+ },
2230
+ Object {
2231
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostSubscriptionOnCreatePostDataResolverFnSubscriptionOnCreatePostDataResolverFnAppSyncFunctionAE3ECF1FFunctionId",
2232
+ },
2233
+ ],
2234
+ },
2235
+ "RequestMappingTemplate": Object {
2236
+ "Fn::Join": Array [
2237
+ "",
2238
+ Array [
2239
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Subscription\\"))
2240
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"onUpdateComment\\"))
2241
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
2242
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
2243
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"NONE\\"))
2244
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
2245
+ Object {
2246
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2247
+ },
2248
+ "\\"))
2249
+
2250
+ $util.toJson({})",
2251
+ ],
2252
+ ],
2253
+ },
2254
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
2255
+ "TypeName": "Subscription",
2256
+ },
2257
+ "Type": "AWS::AppSync::Resolver",
2258
+ },
2259
+ "UpdateCommentResolver": Object {
2260
+ "Properties": Object {
2261
+ "ApiId": Object {
2262
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2263
+ },
2264
+ "FieldName": "updateComment",
2265
+ "Kind": "PIPELINE",
2266
+ "PipelineConfig": Object {
2267
+ "Functions": Array [
2268
+ Object {
2269
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostMutationupdatePostinit0FunctionMutationupdatePostinit0FunctionAppSyncFunction148F70DDFunctionId",
2270
+ },
2271
+ Object {
2272
+ "Ref": "referencetotransformerrootstackPostNestedStackPostNestedStackResource45FCAC5EOutputstransformerrootstackPostQuerygetPostpostAuth0FunctionQuerygetPostpostAuth0FunctionAppSyncFunction052A79B2FunctionId",
2273
+ },
2274
+ Object {
2275
+ "Fn::GetAtt": Array [
2276
+ "MutationUpdateCommentDataResolverFnMutationUpdateCommentDataResolverFnAppSyncFunctionB47372B5",
2277
+ "FunctionId",
2278
+ ],
2279
+ },
2280
+ ],
2281
+ },
2282
+ "RequestMappingTemplate": Object {
2283
+ "Fn::Join": Array [
2284
+ "",
2285
+ Array [
2286
+ "$util.qr($ctx.stash.put(\\"typeName\\", \\"Mutation\\"))
2287
+ $util.qr($ctx.stash.put(\\"fieldName\\", \\"updateComment\\"))
2288
+ $util.qr($ctx.stash.put(\\"conditions\\", []))
2289
+ $util.qr($ctx.stash.put(\\"metadata\\", {}))
2290
+ $util.qr($ctx.stash.metadata.put(\\"dataSourceType\\", \\"AMAZON_DYNAMODB\\"))
2291
+ $util.qr($ctx.stash.metadata.put(\\"apiId\\", \\"",
2292
+ Object {
2293
+ "Ref": "referencetotransformerrootstackGraphQLAPI20497F53ApiId",
2294
+ },
2295
+ "\\"))
2296
+ $util.qr($ctx.stash.put(\\"tableName\\", \\"",
2297
+ Object {
2298
+ "Ref": "CommentTable",
2299
+ },
2300
+ "\\"))
2301
+ $util.toJson({})",
2302
+ ],
2303
+ ],
2304
+ },
2305
+ "ResponseMappingTemplate": "$util.toJson($ctx.prev.result)",
2306
+ "TypeName": "Mutation",
2307
+ },
2308
+ "Type": "AWS::AppSync::Resolver",
2309
+ },
2310
+ },
2311
+ }
2312
+ `;
2313
+
3
2314
  exports[`ModelTransformer: should override model objects when given override config 1`] = `
4
2315
  Object {
5
2316
  "Conditions": Object {