@terra-graph/conventions-aws 1.0.0-rc.1

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.
Files changed (91) hide show
  1. package/CHANGELOG.md +35 -0
  2. package/README.md +25 -0
  3. package/dist/cjs/conventions/dataflow/profiles/base.js +89 -0
  4. package/dist/cjs/conventions/dataflow/profiles/dot.js +44 -0
  5. package/dist/cjs/conventions/dataflow/profiles/dot.test.js +147 -0
  6. package/dist/cjs/conventions/dataflow/rules.js +4 -0
  7. package/dist/cjs/conventions/dataflow/rules.test.js +11 -0
  8. package/dist/cjs/conventions/dataflow/rulesets.js +751 -0
  9. package/dist/cjs/conventions/dataflow/rulesets.test.js +27 -0
  10. package/dist/cjs/conventions/index.js +7 -0
  11. package/dist/cjs/conventions/index.test.js +8 -0
  12. package/dist/cjs/index.js +70 -0
  13. package/dist/cjs/index.test.js +58 -0
  14. package/dist/cjs/namespaces.js +14 -0
  15. package/dist/cjs/namespaces.test.js +17 -0
  16. package/dist/cjs/package.json +1 -0
  17. package/dist/cjs/plugins/AwsApiGateway.js +218 -0
  18. package/dist/cjs/plugins/AwsApiGateway.test.js +427 -0
  19. package/dist/cjs/plugins/AwsIam.js +432 -0
  20. package/dist/cjs/plugins/AwsIam.test.js +468 -0
  21. package/dist/cjs/plugins/AwsS3.js +107 -0
  22. package/dist/cjs/plugins/AwsS3.test.js +102 -0
  23. package/dist/cjs/plugins/AwsSns.js +52 -0
  24. package/dist/cjs/plugins/AwsSns.test.js +55 -0
  25. package/dist/cjs/plugins/AwsTransferFamily.js +105 -0
  26. package/dist/cjs/plugins/AwsTransferFamily.test.js +279 -0
  27. package/dist/cjs/rules/dot.js +36 -0
  28. package/dist/cjs/rules/dot.test.js +42 -0
  29. package/dist/cjs/rules/general.js +69 -0
  30. package/dist/cjs/rules/general.test.js +47 -0
  31. package/dist/cjs/rulesets/dot.js +25 -0
  32. package/dist/cjs/rulesets/dot.test.js +48 -0
  33. package/dist/esm/conventions/dataflow/profiles/base.d.ts +4 -0
  34. package/dist/esm/conventions/dataflow/profiles/base.js +86 -0
  35. package/dist/esm/conventions/dataflow/profiles/dot.d.ts +4 -0
  36. package/dist/esm/conventions/dataflow/profiles/dot.js +38 -0
  37. package/dist/esm/conventions/dataflow/profiles/dot.test.d.ts +1 -0
  38. package/dist/esm/conventions/dataflow/profiles/dot.test.js +109 -0
  39. package/dist/esm/conventions/dataflow/rules.d.ts +3 -0
  40. package/dist/esm/conventions/dataflow/rules.js +2 -0
  41. package/dist/esm/conventions/dataflow/rules.test.d.ts +1 -0
  42. package/dist/esm/conventions/dataflow/rules.test.js +6 -0
  43. package/dist/esm/conventions/dataflow/rulesets.d.ts +3 -0
  44. package/dist/esm/conventions/dataflow/rulesets.js +749 -0
  45. package/dist/esm/conventions/dataflow/rulesets.test.d.ts +1 -0
  46. package/dist/esm/conventions/dataflow/rulesets.test.js +22 -0
  47. package/dist/esm/conventions/index.d.ts +3 -0
  48. package/dist/esm/conventions/index.js +4 -0
  49. package/dist/esm/conventions/index.test.d.ts +1 -0
  50. package/dist/esm/conventions/index.test.js +6 -0
  51. package/dist/esm/index.d.ts +3 -0
  52. package/dist/esm/index.js +32 -0
  53. package/dist/esm/index.test.d.ts +1 -0
  54. package/dist/esm/index.test.js +53 -0
  55. package/dist/esm/namespaces.d.ts +7 -0
  56. package/dist/esm/namespaces.js +6 -0
  57. package/dist/esm/namespaces.test.d.ts +1 -0
  58. package/dist/esm/namespaces.test.js +15 -0
  59. package/dist/esm/plugins/AwsApiGateway.d.ts +6 -0
  60. package/dist/esm/plugins/AwsApiGateway.js +214 -0
  61. package/dist/esm/plugins/AwsApiGateway.test.d.ts +1 -0
  62. package/dist/esm/plugins/AwsApiGateway.test.js +425 -0
  63. package/dist/esm/plugins/AwsIam.d.ts +32 -0
  64. package/dist/esm/plugins/AwsIam.js +428 -0
  65. package/dist/esm/plugins/AwsIam.test.d.ts +1 -0
  66. package/dist/esm/plugins/AwsIam.test.js +466 -0
  67. package/dist/esm/plugins/AwsS3.d.ts +12 -0
  68. package/dist/esm/plugins/AwsS3.js +103 -0
  69. package/dist/esm/plugins/AwsS3.test.d.ts +1 -0
  70. package/dist/esm/plugins/AwsS3.test.js +100 -0
  71. package/dist/esm/plugins/AwsSns.d.ts +6 -0
  72. package/dist/esm/plugins/AwsSns.js +48 -0
  73. package/dist/esm/plugins/AwsSns.test.d.ts +1 -0
  74. package/dist/esm/plugins/AwsSns.test.js +53 -0
  75. package/dist/esm/plugins/AwsTransferFamily.d.ts +6 -0
  76. package/dist/esm/plugins/AwsTransferFamily.js +101 -0
  77. package/dist/esm/plugins/AwsTransferFamily.test.d.ts +1 -0
  78. package/dist/esm/plugins/AwsTransferFamily.test.js +277 -0
  79. package/dist/esm/rules/dot.d.ts +3 -0
  80. package/dist/esm/rules/dot.js +34 -0
  81. package/dist/esm/rules/dot.test.d.ts +1 -0
  82. package/dist/esm/rules/dot.test.js +37 -0
  83. package/dist/esm/rules/general.d.ts +3 -0
  84. package/dist/esm/rules/general.js +67 -0
  85. package/dist/esm/rules/general.test.d.ts +1 -0
  86. package/dist/esm/rules/general.test.js +42 -0
  87. package/dist/esm/rulesets/dot.d.ts +3 -0
  88. package/dist/esm/rulesets/dot.js +23 -0
  89. package/dist/esm/rulesets/dot.test.d.ts +1 -0
  90. package/dist/esm/rulesets/dot.test.js +43 -0
  91. package/package.json +45 -0
@@ -0,0 +1,751 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const core_1 = require("@terra-graph/core");
4
+ const namespaces_js_1 = require("../../namespaces.js");
5
+ const index_js_1 = require("../index.js");
6
+ exports.default = new core_1.NamedRuleSetRegistry({
7
+ [(0, namespaces_js_1.conventionName)(index_js_1.Convention.DataFlow, (0, namespaces_js_1.ruleSetName)('cleanup'))]: new core_1.RuleSet({
8
+ rules: [
9
+ new core_1.RemoveNode({
10
+ node: {
11
+ and: [
12
+ { attr: { key: 'terraform.resource', eq: 'aws_lambda_event_source_mapping' } },
13
+ { not: { edge: { in: { any: true } } } },
14
+ ],
15
+ },
16
+ }),
17
+ ],
18
+ }),
19
+ [(0, namespaces_js_1.conventionName)(index_js_1.Convention.DataFlow, (0, namespaces_js_1.ruleSetName)('semantics'))]: new core_1.RuleSet({
20
+ rules: [
21
+ new core_1.EdgeDirectionSemantic({
22
+ edge: {
23
+ from: {
24
+ attr: {
25
+ key: 'terraform.resource',
26
+ startsWith: 'aws_iam_',
27
+ },
28
+ },
29
+ to: {
30
+ any: true,
31
+ },
32
+ },
33
+ options: {
34
+ semantic: core_1.TgEdgeDirectionSemantics.Authorizes,
35
+ },
36
+ }),
37
+ new core_1.EdgeDirectionSemantic({
38
+ edge: {
39
+ from: {
40
+ and: [
41
+ {
42
+ attr: {
43
+ key: 'terraform.resource',
44
+ endsWith: '_policy',
45
+ },
46
+ },
47
+ {
48
+ not: {
49
+ attr: {
50
+ key: 'terraform.resource',
51
+ startsWith: 'aws_iam_',
52
+ },
53
+ },
54
+ },
55
+ ],
56
+ },
57
+ to: {
58
+ any: true,
59
+ },
60
+ },
61
+ options: {
62
+ semantic: core_1.TgEdgeDirectionSemantics.Authorizes,
63
+ enforceDirection: true,
64
+ },
65
+ }),
66
+ new core_1.EdgeDirectionSemantic({
67
+ edge: {
68
+ from: {
69
+ attr: {
70
+ key: 'terraform.resource',
71
+ eq: 'aws_lambda_permission',
72
+ },
73
+ },
74
+ to: {
75
+ any: true,
76
+ },
77
+ },
78
+ options: {
79
+ semantic: core_1.TgEdgeDirectionSemantics.Authorizes,
80
+ enforceDirection: true,
81
+ },
82
+ }),
83
+ new core_1.EdgeDirectionSemantic({
84
+ edge: {
85
+ from: {
86
+ any: true,
87
+ },
88
+ to: {
89
+ attr: {
90
+ key: 'terraform.resource',
91
+ in: ['aws_cloudwatch_log_group', 'aws_cloudwatch_metric_alarm', 'aws_xray_group'],
92
+ },
93
+ },
94
+ },
95
+ options: {
96
+ semantic: core_1.TgEdgeDirectionSemantics.ObservedBy,
97
+ enforceDirection: true,
98
+ },
99
+ }),
100
+ new core_1.EdgeDirectionSemantic({
101
+ edge: {
102
+ from: {
103
+ attr: {
104
+ key: 'terraform.resource',
105
+ in: ['aws_cloudwatch_event_target'],
106
+ },
107
+ },
108
+ to: {
109
+ not: {
110
+ attr: {
111
+ key: 'terraform.resource',
112
+ startsWith: ['aws_cloudwatch_event_', 'aws_iam_'],
113
+ },
114
+ },
115
+ },
116
+ },
117
+ options: {
118
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
119
+ enforceDirection: true,
120
+ },
121
+ }),
122
+ new core_1.EdgeDirectionSemantic({
123
+ edge: {
124
+ from: {
125
+ attr: {
126
+ key: 'terraform.resource',
127
+ eq: 'aws_cloudwatch_event_rule',
128
+ },
129
+ },
130
+ to: {
131
+ attr: {
132
+ key: 'terraform.resource',
133
+ in: ['aws_cloudwatch_event_target', 'aws_sqs_queue'],
134
+ },
135
+ },
136
+ },
137
+ options: {
138
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
139
+ enforceDirection: true,
140
+ },
141
+ }),
142
+ new core_1.EdgeDirectionSemantic({
143
+ edge: {
144
+ from: {
145
+ attr: {
146
+ key: 'terraform.resource',
147
+ in: ['aws_sqs_queue', 'aws_kinesis_stream', 'aws_dynamodb_table'],
148
+ },
149
+ },
150
+ to: {
151
+ attr: {
152
+ key: 'terraform.resource',
153
+ in: ['aws_lambda_event_source_mapping'],
154
+ },
155
+ },
156
+ },
157
+ options: {
158
+ semantic: core_1.TgEdgeDirectionSemantics.Triggers,
159
+ enforceDirection: true,
160
+ },
161
+ }),
162
+ new core_1.EdgeDirectionSemantic({
163
+ edge: {
164
+ from: {
165
+ attr: {
166
+ key: 'terraform.resource',
167
+ in: ['aws_dynamodb_table'],
168
+ },
169
+ },
170
+ to: {
171
+ attr: {
172
+ key: 'terraform.resource',
173
+ in: ['aws_dynamodb_table_item'],
174
+ },
175
+ },
176
+ },
177
+ options: {
178
+ semantic: core_1.TgEdgeDirectionSemantics.Accesses,
179
+ enforceDirection: true,
180
+ },
181
+ }),
182
+ new core_1.EdgeDirectionSemantic({
183
+ edge: {
184
+ from: {
185
+ attr: {
186
+ key: 'terraform.resource',
187
+ in: [
188
+ 'aws_sns_topic_subscription',
189
+ 'aws_s3_bucket_notification',
190
+ 'aws_lambda_function_url',
191
+ 'aws_cloudwatch_event_target',
192
+ 'aws_scheduler_schedule',
193
+ 'aws_api_gatewayv2_route',
194
+ 'aws_api_gateway_stage',
195
+ 'aws_lambda_event_source_mapping',
196
+ ],
197
+ },
198
+ },
199
+ to: {
200
+ attr: {
201
+ key: 'terraform.resource',
202
+ in: ['aws_lambda_function'],
203
+ },
204
+ },
205
+ },
206
+ options: {
207
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
208
+ enforceDirection: true,
209
+ },
210
+ }),
211
+ new core_1.EdgeDirectionSemantic({
212
+ edge: {
213
+ from: {
214
+ attr: {
215
+ key: 'terraform.resource',
216
+ in: ['aws_scheduler_schedule'],
217
+ },
218
+ },
219
+ to: {
220
+ attr: {
221
+ key: 'terraform.resource',
222
+ in: ['aws_lambda_event_source_mapping'],
223
+ },
224
+ },
225
+ },
226
+ options: {
227
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
228
+ enforceDirection: true,
229
+ },
230
+ }),
231
+ new core_1.EdgeDirectionSemantic({
232
+ edge: {
233
+ from: {
234
+ attr: {
235
+ key: 'terraform.resource',
236
+ in: ['aws_s3_bucket'],
237
+ },
238
+ },
239
+ to: {
240
+ attr: {
241
+ key: 'terraform.resource',
242
+ in: [
243
+ 'aws_s3_bucket_notification',
244
+ 'aws_cloudwatch_event_rule', // when using eventbridge
245
+ ],
246
+ },
247
+ },
248
+ },
249
+ options: {
250
+ semantic: core_1.TgEdgeDirectionSemantics.Triggers,
251
+ enforceDirection: true,
252
+ },
253
+ }),
254
+ new core_1.EdgeDirectionSemantic({
255
+ edge: {
256
+ from: {
257
+ attr: {
258
+ key: 'terraform.resource',
259
+ in: [
260
+ 'aws_lambda_function',
261
+ 'aws_ecs_service',
262
+ 'aws_ecs_task_definition',
263
+ 'aws_sfn_state_machine',
264
+ 'aws_apigatewayv2_api',
265
+ 'aws_s3_bucket_notification',
266
+ ],
267
+ },
268
+ },
269
+ to: {
270
+ attr: {
271
+ key: 'terraform.resource',
272
+ in: [
273
+ 'aws_sns_topic',
274
+ 'aws_sqs_queue',
275
+ 'aws_cloudwatch_event_bus',
276
+ 'aws_kinesis_stream',
277
+ ],
278
+ },
279
+ },
280
+ },
281
+ options: {
282
+ semantic: core_1.TgEdgeDirectionSemantics.Publishes,
283
+ },
284
+ }),
285
+ new core_1.EdgeDirectionSemantic({
286
+ edge: {
287
+ from: {
288
+ attr: {
289
+ key: 'terraform.resource',
290
+ in: ['aws_secretsmanager_secret_version'],
291
+ },
292
+ },
293
+ to: {
294
+ attr: {
295
+ key: 'terraform.resource',
296
+ startsWith: ['aws_secretsmanager_secret'],
297
+ },
298
+ },
299
+ },
300
+ options: {
301
+ semantic: core_1.TgEdgeDirectionSemantics.Accesses,
302
+ enforceDirection: true,
303
+ },
304
+ }),
305
+ new core_1.EdgeDirectionSemantic({
306
+ edge: {
307
+ from: {
308
+ attr: {
309
+ key: 'terraform.resource',
310
+ in: [
311
+ 'aws_lambda_function',
312
+ 'aws_ecs_service',
313
+ 'aws_ecs_task_definition',
314
+ 'aws_glue_job',
315
+ // 'aws_athena_named_query',
316
+ 'aws_glue_catalog_table',
317
+ 'aws_glue_catalog_database',
318
+ 'aws_sfn_state_machine',
319
+ 'aws_cloudwatch_log_delivery_destination',
320
+ ],
321
+ },
322
+ },
323
+ to: {
324
+ attr: {
325
+ key: 'terraform.resource',
326
+ startsWith: [
327
+ 'aws_dynamodb_',
328
+ 'aws_s3_',
329
+ 'aws_rds_',
330
+ 'aws_docdb_',
331
+ 'aws_elasticache_',
332
+ 'aws_opensearch_',
333
+ 'aws_timestream',
334
+ 'aws_redshift_',
335
+ 'aws_secretsmanager_secret_version',
336
+ ],
337
+ },
338
+ },
339
+ },
340
+ options: {
341
+ semantic: core_1.TgEdgeDirectionSemantics.Accesses,
342
+ enforceDirection: true,
343
+ },
344
+ }),
345
+ new core_1.EdgeDirectionSemantic({
346
+ edge: {
347
+ from: {
348
+ attr: {
349
+ key: 'terraform.resource',
350
+ in: ['aws_cloudwatch_log_delivery_source'],
351
+ },
352
+ },
353
+ to: {
354
+ not: {
355
+ attr: {
356
+ key: 'terraform.resource',
357
+ in: ['aws_cloudwatch_log_delivery'],
358
+ },
359
+ },
360
+ },
361
+ },
362
+ options: {
363
+ semantic: core_1.TgEdgeDirectionSemantics.ObservedBy,
364
+ enforceDirection: true,
365
+ },
366
+ }),
367
+ new core_1.EdgeDirectionSemantic({
368
+ edge: {
369
+ from: {
370
+ attr: {
371
+ key: 'terraform.resource',
372
+ in: ['aws_cloudwatch_log_delivery_source'],
373
+ },
374
+ },
375
+ to: {
376
+ attr: {
377
+ key: 'terraform.resource',
378
+ in: ['aws_cloudwatch_log_delivery'],
379
+ },
380
+ },
381
+ },
382
+ options: {
383
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
384
+ enforceDirection: true,
385
+ },
386
+ }),
387
+ new core_1.EdgeDirectionSemantic({
388
+ edge: {
389
+ from: {
390
+ attr: {
391
+ key: 'terraform.resource',
392
+ in: ['aws_cloudwatch_log_delivery'],
393
+ },
394
+ },
395
+ to: {
396
+ attr: {
397
+ key: 'terraform.resource',
398
+ in: ['aws_cloudwatch_log_delivery_destination'],
399
+ },
400
+ },
401
+ },
402
+ options: {
403
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
404
+ enforceDirection: true,
405
+ },
406
+ }),
407
+ new core_1.EdgeDirectionSemantic({
408
+ edge: {
409
+ from: {
410
+ attr: {
411
+ key: 'terraform.resource',
412
+ in: ['aws_athena_named_query'],
413
+ },
414
+ },
415
+ to: {
416
+ attr: {
417
+ key: 'terraform.resource',
418
+ startsWith: ['aws_glue_catalog_database'],
419
+ },
420
+ },
421
+ },
422
+ options: {
423
+ semantic: core_1.TgEdgeDirectionSemantics.Accesses,
424
+ enforceDirection: true,
425
+ },
426
+ }),
427
+ new core_1.EdgeDirectionSemantic({
428
+ edge: {
429
+ from: {
430
+ attr: {
431
+ key: 'terraform.resource',
432
+ in: ['aws_s3_bucket'],
433
+ },
434
+ },
435
+ to: {
436
+ attr: {
437
+ key: 'terraform.resource',
438
+ in: ['aws_s3_bucket_notification'],
439
+ },
440
+ },
441
+ },
442
+ options: {
443
+ semantic: core_1.TgEdgeDirectionSemantics.Triggers,
444
+ enforceDirection: true,
445
+ },
446
+ }),
447
+ new core_1.EdgeDirectionSemantic({
448
+ edge: {
449
+ from: {
450
+ attr: {
451
+ key: 'terraform.resource',
452
+ eq: 'aws_sqs_queue',
453
+ },
454
+ },
455
+ to: {
456
+ attr: {
457
+ key: 'terraform.resource',
458
+ eq: 'aws_sqs_queue',
459
+ },
460
+ },
461
+ },
462
+ options: {
463
+ semantic: core_1.TgEdgeDirectionSemantics.Publishes,
464
+ enforceDirection: true,
465
+ },
466
+ }),
467
+ // this is the generic one
468
+ new core_1.EdgeDirectionSemantic({
469
+ edge: {
470
+ from: {
471
+ attr: {
472
+ key: 'terraform.resource',
473
+ in: [
474
+ // 'aws_sqs_queue',
475
+ 'aws_sns_topic',
476
+ // 'aws_kinesis_stream',
477
+ // 'aws_dynamodb_table',
478
+ 'aws_cloudwatch_event_bus',
479
+ // 'aws_cloudwatch_event_target',
480
+ 'aws_scheduler_schedule',
481
+ // 'aws_s3_bucket',
482
+ ],
483
+ },
484
+ },
485
+ to: {
486
+ attr: {
487
+ key: 'terraform.resource',
488
+ in: [
489
+ // 'aws_lambda_event_source_mapping',
490
+ 'aws_sqs_queue',
491
+ 'aws_cloudwatch_event_rule',
492
+ 'aws_cloudwatch_event_archive',
493
+ 'aws_sfn_state_machine',
494
+ 'aws_ecs_service',
495
+ // 'aws_s3_bucket_notification',
496
+ 'aws_sns_topic_subscription',
497
+ ],
498
+ },
499
+ },
500
+ },
501
+ options: {
502
+ semantic: core_1.TgEdgeDirectionSemantics.Triggers,
503
+ enforceDirection: true,
504
+ },
505
+ }),
506
+ // another weird generic rule
507
+ new core_1.EdgeDirectionSemantic({
508
+ edge: {
509
+ from: {
510
+ attr: {
511
+ key: 'terraform.resource',
512
+ in: [
513
+ 'aws_apigatewayv2_api',
514
+ 'aws_api_gateway_rest_api',
515
+ 'aws_lambda_function',
516
+ 'aws_sfn_state_machine',
517
+ // 'aws_cloudwatch_event_rule',
518
+ ],
519
+ },
520
+ },
521
+ to: {
522
+ attr: {
523
+ key: 'terraform.resource',
524
+ in: ['aws_ecs_service', 'aws_apigatewayv2_api'],
525
+ },
526
+ },
527
+ },
528
+ options: {
529
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
530
+ enforceDirection: true,
531
+ },
532
+ }),
533
+ new core_1.EdgeDirectionSemantic({
534
+ edge: {
535
+ from: {
536
+ attr: {
537
+ key: 'terraform.resource',
538
+ in: [
539
+ 'aws_apigatewayv2_api',
540
+ 'aws_api_gateway_rest_api',
541
+ 'aws_lb',
542
+ 'aws_lb_listener',
543
+ 'aws_cloudfront_distribution',
544
+ 'aws_route53_record',
545
+ ],
546
+ },
547
+ },
548
+ to: {
549
+ not: {
550
+ attr: {
551
+ key: 'terraform.resource',
552
+ startsWith: [
553
+ 'aws_waf',
554
+ 'aws_acm_certificate_',
555
+ 'aws_cloudfront_origin_access_control',
556
+ 'aws_cloudwatch_log_delivery_source',
557
+ ],
558
+ },
559
+ },
560
+ },
561
+ },
562
+ options: {
563
+ semantic: core_1.TgEdgeDirectionSemantics.Routes,
564
+ enforceDirection: true,
565
+ },
566
+ }),
567
+ new core_1.EdgeDirectionSemantic({
568
+ edge: {
569
+ from: {
570
+ attr: {
571
+ key: 'terraform.resource',
572
+ in: ['aws_glue_catalog_database', 'aws_timestreamwrite_database'],
573
+ },
574
+ },
575
+ to: {
576
+ attr: {
577
+ key: 'terraform.resource',
578
+ in: ['aws_glue_catalog_table', 'aws_timestreamwrite_table'],
579
+ },
580
+ },
581
+ },
582
+ options: {
583
+ semantic: core_1.TgEdgeDirectionSemantics.Routes,
584
+ enforceDirection: true,
585
+ },
586
+ }),
587
+ new core_1.EdgeDirectionSemantic({
588
+ edge: {
589
+ from: {
590
+ attr: {
591
+ key: 'terraform.resource',
592
+ in: ['aws_wafv2_ip_set'],
593
+ },
594
+ },
595
+ to: {
596
+ attr: {
597
+ key: 'terraform.resource',
598
+ in: ['aws_wafv2_web_acl'],
599
+ },
600
+ },
601
+ },
602
+ options: {
603
+ semantic: core_1.TgEdgeDirectionSemantics.Authorizes,
604
+ enforceDirection: true,
605
+ },
606
+ }),
607
+ new core_1.EdgeDirectionSemantic({
608
+ edge: {
609
+ from: {
610
+ attr: {
611
+ key: 'terraform.resource',
612
+ in: [
613
+ 'aws_wafv2_web_acl',
614
+ 'aws_acm_certificate_validation',
615
+ 'aws_cloudfront_origin_access_control',
616
+ ],
617
+ },
618
+ },
619
+ to: {
620
+ attr: {
621
+ key: 'terraform.resource',
622
+ in: ['aws_cloudfront_distribution'],
623
+ },
624
+ },
625
+ },
626
+ options: {
627
+ semantic: core_1.TgEdgeDirectionSemantics.Authorizes,
628
+ enforceDirection: true,
629
+ },
630
+ }),
631
+ new core_1.EdgeDirectionSemantic({
632
+ edge: {
633
+ from: {
634
+ attr: {
635
+ key: 'terraform.resource',
636
+ in: ['aws_wafv2_web_acl'],
637
+ },
638
+ },
639
+ to: {
640
+ attr: {
641
+ key: 'terraform.resource',
642
+ in: ['aws_wafv2_web_acl_logging_configuration'],
643
+ },
644
+ },
645
+ },
646
+ options: {
647
+ semantic: core_1.TgEdgeDirectionSemantics.ObservedBy,
648
+ enforceDirection: true,
649
+ },
650
+ }),
651
+ new core_1.EdgeDirectionSemantic({
652
+ edge: {
653
+ from: {
654
+ attr: {
655
+ key: 'terraform.resource',
656
+ in: ['aws_cloudfront_distribution'],
657
+ },
658
+ },
659
+ to: {
660
+ attr: {
661
+ key: 'terraform.resource',
662
+ in: ['aws_s3_bucket'],
663
+ },
664
+ },
665
+ },
666
+ options: {
667
+ semantic: core_1.TgEdgeDirectionSemantics.Accesses,
668
+ enforceDirection: true,
669
+ },
670
+ }),
671
+ new core_1.EdgeDirectionSemantic({
672
+ edge: {
673
+ from: {
674
+ attr: {
675
+ key: 'terraform.resource',
676
+ in: ['aws_wafv2_web_acl_logging_configuration'],
677
+ },
678
+ },
679
+ to: {
680
+ attr: {
681
+ key: 'terraform.resource',
682
+ in: ['aws_kinesis_firehose_delivery_stream'],
683
+ },
684
+ },
685
+ },
686
+ options: {
687
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
688
+ enforceDirection: true,
689
+ },
690
+ }),
691
+ new core_1.EdgeDirectionSemantic({
692
+ edge: {
693
+ from: {
694
+ attr: {
695
+ key: 'terraform.resource',
696
+ in: ['aws_kinesis_firehose_delivery_stream'],
697
+ },
698
+ },
699
+ to: {
700
+ attr: {
701
+ key: 'terraform.resource',
702
+ in: ['aws_cloudwatch_log_stream'],
703
+ },
704
+ },
705
+ },
706
+ options: {
707
+ semantic: core_1.TgEdgeDirectionSemantics.Invokes,
708
+ enforceDirection: true,
709
+ },
710
+ }),
711
+ new core_1.EdgeSemanticLegend({
712
+ edge: {
713
+ from: { any: true },
714
+ to: { any: true },
715
+ },
716
+ options: {
717
+ legendBySemantic: {
718
+ [core_1.TgEdgeDirectionSemantics.Invokes]: {
719
+ title: 'Invokes',
720
+ colour: '#0d6efd',
721
+ },
722
+ [core_1.TgEdgeDirectionSemantics.Accesses]: {
723
+ title: 'Accesses data',
724
+ colour: '#198754',
725
+ },
726
+ [core_1.TgEdgeDirectionSemantics.Publishes]: {
727
+ title: 'Publishes event',
728
+ colour: '#fd7e14',
729
+ },
730
+ [core_1.TgEdgeDirectionSemantics.Triggers]: {
731
+ title: 'Triggers async consumer',
732
+ colour: '#dc3545',
733
+ },
734
+ [core_1.TgEdgeDirectionSemantics.Routes]: {
735
+ title: 'Routes request',
736
+ colour: '#6f42c1',
737
+ },
738
+ [core_1.TgEdgeDirectionSemantics.Authorizes]: {
739
+ title: 'Authorizes',
740
+ colour: '#8dd7c5',
741
+ },
742
+ [core_1.TgEdgeDirectionSemantics.ObservedBy]: {
743
+ title: 'Observed by telemetry',
744
+ colour: '#20c997',
745
+ },
746
+ },
747
+ },
748
+ }),
749
+ ],
750
+ }),
751
+ });