@pwrdrvr/microapps-cdk 0.2.8 → 0.2.11

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 (40) hide show
  1. package/.gitattributes +18 -18
  2. package/.jsii +1264 -165
  3. package/API.md +511 -8
  4. package/README.md +29 -0
  5. package/changelog.md +2 -0
  6. package/lib/MicroApps.d.ts +126 -105
  7. package/lib/MicroApps.d.ts.map +1 -0
  8. package/lib/MicroApps.js +32 -30
  9. package/lib/MicroAppsAPIGwy.d.ts +28 -61
  10. package/lib/MicroAppsAPIGwy.d.ts.map +1 -0
  11. package/lib/MicroAppsAPIGwy.js +17 -25
  12. package/lib/MicroAppsCF.d.ts +85 -104
  13. package/lib/MicroAppsCF.d.ts.map +1 -0
  14. package/lib/MicroAppsCF.js +58 -41
  15. package/lib/MicroAppsEdgeToOrigin.d.ts +108 -0
  16. package/lib/MicroAppsEdgeToOrigin.d.ts.map +1 -0
  17. package/lib/MicroAppsEdgeToOrigin.js +139 -0
  18. package/lib/MicroAppsS3.d.ts +19 -69
  19. package/lib/MicroAppsS3.d.ts.map +1 -0
  20. package/lib/MicroAppsS3.js +5 -32
  21. package/lib/MicroAppsSvcs.d.ts +58 -86
  22. package/lib/MicroAppsSvcs.d.ts.map +1 -0
  23. package/lib/MicroAppsSvcs.js +36 -95
  24. package/lib/MicroAppsTable.d.ts +60 -0
  25. package/lib/MicroAppsTable.d.ts.map +1 -0
  26. package/lib/MicroAppsTable.js +42 -0
  27. package/lib/index.d.ts +3 -0
  28. package/lib/index.d.ts.map +1 -0
  29. package/lib/index.js +3 -1
  30. package/lib/microapps-deployer/index.js +174 -113
  31. package/lib/microapps-deployer/index.js.map +3 -3
  32. package/lib/microapps-router/index.js +54 -69
  33. package/lib/microapps-router/index.js.map +3 -3
  34. package/lib/microapps-router/templates/appFrame.html +0 -0
  35. package/lib/utils/ReverseDomain.d.ts +1 -0
  36. package/lib/utils/ReverseDomain.d.ts.map +1 -0
  37. package/package.json +29 -24
  38. package/releasetag.txt +1 -0
  39. package/version.txt +1 -0
  40. package/patches/@aws-cdk+aws-apigatewayv2-alpha+2.8.0-alpha.0.patch +0 -39
package/API.md CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
  Create a new MicroApps "turnkey" construct for simple deployments and for initial evaulation of the MicroApps framework.
10
10
 
11
- Use this construct to create a working entire stack.
11
+ Use this construct to create a PoC working entire stack.
12
12
 
13
13
  Do not use this construct when adding MicroApps to an existing
14
14
  CloudFront, API Gateway, S3 Bucket, etc. or where access
@@ -80,19 +80,27 @@ new MicroApps(scope: Construct, id: string, props?: MicroAppsProps)
80
80
 
81
81
  ---
82
82
 
83
+ ##### `edgeToOrigin`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroApps.edgeToOrigin"></a>
84
+
85
+ - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin`](#@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin)
86
+
87
+ {@inheritdoc IMicroAppsEdgeToOrigin}.
88
+
89
+ ---
90
+
83
91
 
84
92
  ### MicroAppsAPIGwy <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy"></a>
85
93
 
86
94
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
87
95
 
88
- Create a new MicroApps API Gateway HTTP API endpoint.
96
+ Create a new MicroApps API Gateway HTTP API endpoint, optionally requiring IAM authorization.
89
97
 
90
98
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy.Initializer"></a>
91
99
 
92
100
  ```typescript
93
101
  import { MicroAppsAPIGwy } from '@pwrdrvr/microapps-cdk'
94
102
 
95
- new MicroAppsAPIGwy(scope: Construct, id: string, props?: MicroAppsAPIGwyProps)
103
+ new MicroAppsAPIGwy(scope: Construct, id: string, props: MicroAppsAPIGwyProps)
96
104
  ```
97
105
 
98
106
  ##### `scope`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy.scope"></a>
@@ -107,7 +115,7 @@ new MicroAppsAPIGwy(scope: Construct, id: string, props?: MicroAppsAPIGwyProps)
107
115
 
108
116
  ---
109
117
 
110
- ##### `props`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy.props"></a>
118
+ ##### `props`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy.props"></a>
111
119
 
112
120
  - *Type:* [`@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps`](#@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps)
113
121
 
@@ -194,16 +202,16 @@ MicroAppsCF.addRoutes(_scope: Construct, props: AddRoutesOptions)
194
202
  ```typescript
195
203
  import { MicroAppsCF } from '@pwrdrvr/microapps-cdk'
196
204
 
197
- MicroAppsCF.createAPIOriginPolicy(scope: Construct, props: CreateAPIOriginPolicyOptions)
205
+ MicroAppsCF.createAPIOriginPolicy(_scope: Construct, _props: CreateAPIOriginPolicyOptions)
198
206
  ```
199
207
 
200
- ###### `scope`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCF.scope"></a>
208
+ ###### `_scope`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCF._scope"></a>
201
209
 
202
210
  - *Type:* [`constructs.Construct`](#constructs.Construct)
203
211
 
204
212
  ---
205
213
 
206
- ###### `props`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCF.props"></a>
214
+ ###### `_props`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCF._props"></a>
207
215
 
208
216
  - *Type:* [`@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions`](#@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions)
209
217
 
@@ -215,6 +223,78 @@ MicroAppsCF.createAPIOriginPolicy(scope: Construct, props: CreateAPIOriginPolicy
215
223
 
216
224
  - *Type:* [`aws-cdk-lib.aws_cloudfront.Distribution`](#aws-cdk-lib.aws_cloudfront.Distribution)
217
225
 
226
+ The CloudFront distribution.
227
+
228
+ ---
229
+
230
+
231
+ ### MicroAppsEdgeToOrigin <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin"></a>
232
+
233
+ - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin`](#@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin)
234
+
235
+ Create a new MicroApps Edge to Origin Function w/ `config.yml`.
236
+
237
+ #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.Initializer"></a>
238
+
239
+ ```typescript
240
+ import { MicroAppsEdgeToOrigin } from '@pwrdrvr/microapps-cdk'
241
+
242
+ new MicroAppsEdgeToOrigin(scope: Construct, id: string, props: MicroAppsEdgeToOriginProps)
243
+ ```
244
+
245
+ ##### `scope`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.scope"></a>
246
+
247
+ - *Type:* [`constructs.Construct`](#constructs.Construct)
248
+
249
+ ---
250
+
251
+ ##### `id`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.id"></a>
252
+
253
+ - *Type:* `string`
254
+
255
+ ---
256
+
257
+ ##### `props`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.props"></a>
258
+
259
+ - *Type:* [`@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps`](#@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps)
260
+
261
+ ---
262
+
263
+
264
+ #### Static Functions <a name="Static Functions"></a>
265
+
266
+ ##### `generateEdgeToOriginConfig` <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.generateEdgeToOriginConfig"></a>
267
+
268
+ ```typescript
269
+ import { MicroAppsEdgeToOrigin } from '@pwrdrvr/microapps-cdk'
270
+
271
+ MicroAppsEdgeToOrigin.generateEdgeToOriginConfig(props: GenerateEdgeToOriginConfigOptions)
272
+ ```
273
+
274
+ ###### `props`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.props"></a>
275
+
276
+ - *Type:* [`@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions`](#@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions)
277
+
278
+ ---
279
+
280
+ #### Properties <a name="Properties"></a>
281
+
282
+ ##### `edgeToOriginFunction`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.edgeToOriginFunction"></a>
283
+
284
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction`](#aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction) | [`aws-cdk-lib.aws_lambda.Function`](#aws-cdk-lib.aws_lambda.Function)
285
+
286
+ The edge to origin function for API Gateway Request Origin Edge Lambda.
287
+
288
+ The generated `config.yml` is included in the Lambda's code.
289
+
290
+ ---
291
+
292
+ ##### `edgeToOriginLambdas`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin.edgeToOriginLambdas"></a>
293
+
294
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.EdgeLambda`](#aws-cdk-lib.aws_cloudfront.EdgeLambda)[]
295
+
296
+ Configuration of the edge to origin lambda functions.
297
+
218
298
  ---
219
299
 
220
300
 
@@ -222,7 +302,10 @@ MicroAppsCF.createAPIOriginPolicy(scope: Construct, props: CreateAPIOriginPolicy
222
302
 
223
303
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsS3`](#@pwrdrvr/microapps-cdk.IMicroAppsS3)
224
304
 
225
- Create a new MicroApps S3 Bucket.
305
+ Create the durable MicroApps S3 Buckets.
306
+
307
+ These should be created in a stack that will not be deleted if
308
+ there are breaking changes to MicroApps in the future.
226
309
 
227
310
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsS3.Initializer"></a>
228
311
 
@@ -356,6 +439,51 @@ DynamoDB table used by Router, Deployer, and Release console app.
356
439
  ---
357
440
 
358
441
 
442
+ ### MicroAppsTable <a name="@pwrdrvr/microapps-cdk.MicroAppsTable"></a>
443
+
444
+ - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsTable`](#@pwrdrvr/microapps-cdk.IMicroAppsTable)
445
+
446
+ Create a new MicroApps Table for apps / versions / rules.
447
+
448
+ #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsTable.Initializer"></a>
449
+
450
+ ```typescript
451
+ import { MicroAppsTable } from '@pwrdrvr/microapps-cdk'
452
+
453
+ new MicroAppsTable(scope: Construct, id: string, props?: MicroAppsTableProps)
454
+ ```
455
+
456
+ ##### `scope`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTable.scope"></a>
457
+
458
+ - *Type:* [`constructs.Construct`](#constructs.Construct)
459
+
460
+ ---
461
+
462
+ ##### `id`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTable.id"></a>
463
+
464
+ - *Type:* `string`
465
+
466
+ ---
467
+
468
+ ##### `props`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTable.props"></a>
469
+
470
+ - *Type:* [`@pwrdrvr/microapps-cdk.MicroAppsTableProps`](#@pwrdrvr/microapps-cdk.MicroAppsTableProps)
471
+
472
+ ---
473
+
474
+
475
+
476
+ #### Properties <a name="Properties"></a>
477
+
478
+ ##### `table`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTable.table"></a>
479
+
480
+ - *Type:* [`aws-cdk-lib.aws_dynamodb.Table`](#aws-cdk-lib.aws_dynamodb.Table)
481
+
482
+ DynamoDB table used by Router, Deployer, and Release console app.
483
+
484
+ ---
485
+
486
+
359
487
  ## Structs <a name="Structs"></a>
360
488
 
361
489
  ### AddRoutesOptions <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions"></a>
@@ -402,6 +530,14 @@ CloudFront Distribution to add the Behaviors (Routes) to.
402
530
 
403
531
  ---
404
532
 
533
+ ##### `apigwyEdgeFunctions`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions.apigwyEdgeFunctions"></a>
534
+
535
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.EdgeLambda`](#aws-cdk-lib.aws_cloudfront.EdgeLambda)[]
536
+
537
+ Edge lambdas to associate with the API Gateway routes.
538
+
539
+ ---
540
+
405
541
  ##### `createAPIPathRoute`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions.createAPIPathRoute"></a>
406
542
 
407
543
  - *Type:* `boolean`
@@ -416,6 +552,20 @@ even if they have a period in the path.
416
552
 
417
553
  ---
418
554
 
555
+ ##### `createNextDataPathRoute`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions.createNextDataPathRoute"></a>
556
+
557
+ - *Type:* `boolean`
558
+ - *Default:* true
559
+
560
+ Create an extra Behavior (Route) for /_next/data/ This route is used by Next.js to load data from the API Gateway on `getServerSideProps` calls. The requests can end in `.json`, which would cause them to be routed to S3 if this route is not created.
561
+
562
+ When false API routes with a period in the path will get routed to S3.
563
+
564
+ When true API routes that contain /_next/data/ in the path will get routed to API Gateway
565
+ even if they have a period in the path.
566
+
567
+ ---
568
+
419
569
  ##### `rootPathPrefix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions.rootPathPrefix"></a>
420
570
 
421
571
  - *Type:* `string`
@@ -462,6 +612,40 @@ Edge domain name used by CloudFront - If set a custom OriginRequestPolicy will b
462
612
 
463
613
  ---
464
614
 
615
+ ### GenerateEdgeToOriginConfigOptions <a name="@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions"></a>
616
+
617
+ #### Initializer <a name="[object Object].Initializer"></a>
618
+
619
+ ```typescript
620
+ import { GenerateEdgeToOriginConfigOptions } from '@pwrdrvr/microapps-cdk'
621
+
622
+ const generateEdgeToOriginConfigOptions: GenerateEdgeToOriginConfigOptions = { ... }
623
+ ```
624
+
625
+ ##### `addXForwardedHostHeader`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions.addXForwardedHostHeader"></a>
626
+
627
+ - *Type:* `boolean`
628
+
629
+ ---
630
+
631
+ ##### `originRegion`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions.originRegion"></a>
632
+
633
+ - *Type:* `string`
634
+
635
+ ---
636
+
637
+ ##### `replaceHostHeader`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions.replaceHostHeader"></a>
638
+
639
+ - *Type:* `boolean`
640
+
641
+ ---
642
+
643
+ ##### `signingMode`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions.signingMode"></a>
644
+
645
+ - *Type:* `string`
646
+
647
+ ---
648
+
465
649
  ### MicroAppsAPIGwyProps <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps"></a>
466
650
 
467
651
  Properties to initialize an instance of `MicroAppsAPIGwy`.
@@ -538,6 +722,15 @@ Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true
538
722
 
539
723
  ---
540
724
 
725
+ ##### `requireIAMAuthorization`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps.requireIAMAuthorization"></a>
726
+
727
+ - *Type:* `boolean`
728
+ - *Default:* true
729
+
730
+ Require IAM auth on API Gateway.
731
+
732
+ ---
733
+
541
734
  ##### `rootPathPrefix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps.rootPathPrefix"></a>
542
735
 
543
736
  - *Type:* `string`
@@ -623,6 +816,20 @@ even if they have a period in the path.
623
816
 
624
817
  ---
625
818
 
819
+ ##### `createNextDataPathRoute`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCFProps.createNextDataPathRoute"></a>
820
+
821
+ - *Type:* `boolean`
822
+ - *Default:* true
823
+
824
+ Create an extra Behavior (Route) for /_next/data/ This route is used by Next.js to load data from the API Gateway on `getServerSideProps` calls. The requests can end in `.json`, which would cause them to be routed to S3 if this route is not created.
825
+
826
+ When false API routes with a period in the path will get routed to S3.
827
+
828
+ When true API routes that contain /_next/data/ in the path will get routed to API Gateway
829
+ even if they have a period in the path.
830
+
831
+ ---
832
+
626
833
  ##### `domainNameEdge`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCFProps.domainNameEdge"></a>
627
834
 
628
835
  - *Type:* `string`
@@ -641,6 +848,14 @@ API Gateway custom origin domain name.
641
848
 
642
849
  ---
643
850
 
851
+ ##### `edgeToOriginLambdas`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCFProps.edgeToOriginLambdas"></a>
852
+
853
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.EdgeLambda`](#aws-cdk-lib.aws_cloudfront.EdgeLambda)[]
854
+
855
+ Configuration of the edge to origin lambda functions.
856
+
857
+ ---
858
+
644
859
  ##### `r53Zone`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsCFProps.r53Zone"></a>
645
860
 
646
861
  - *Type:* [`aws-cdk-lib.aws_route53.IHostedZone`](#aws-cdk-lib.aws_route53.IHostedZone)
@@ -668,6 +883,100 @@ Path prefix on the root of the CloudFront distribution.
668
883
 
669
884
  ---
670
885
 
886
+ ### MicroAppsEdgeToOriginProps <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps"></a>
887
+
888
+ Properties to initialize an instance of `MicroAppsEdgeToOrigin`.
889
+
890
+ #### Initializer <a name="[object Object].Initializer"></a>
891
+
892
+ ```typescript
893
+ import { MicroAppsEdgeToOriginProps } from '@pwrdrvr/microapps-cdk'
894
+
895
+ const microAppsEdgeToOriginProps: MicroAppsEdgeToOriginProps = { ... }
896
+ ```
897
+
898
+ ##### `addXForwardedHostHeader`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.addXForwardedHostHeader"></a>
899
+
900
+ - *Type:* `boolean`
901
+ - *Default:* true
902
+
903
+ Adds an X-Forwarded-Host-Header when calling API Gateway.
904
+
905
+ Can only be trusted if `signingMode` is enabled, which restricts
906
+ access to API Gateway to only IAM signed requests.
907
+
908
+ Note: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin
909
+
910
+ ---
911
+
912
+ ##### `assetNameRoot`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.assetNameRoot"></a>
913
+
914
+ - *Type:* `string`
915
+ - *Default:* resource names auto assigned
916
+
917
+ Optional asset name root.
918
+
919
+ ---
920
+
921
+ ##### `assetNameSuffix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.assetNameSuffix"></a>
922
+
923
+ - *Type:* `string`
924
+ - *Default:* none
925
+
926
+ Optional asset name suffix.
927
+
928
+ ---
929
+
930
+ ##### `originRegion`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.originRegion"></a>
931
+
932
+ - *Type:* `string`
933
+ - *Default:* undefined
934
+
935
+ Origin region that API Gateway will be deployed to, used for the config.yml on the Edge function to sign requests for the correct region.
936
+
937
+ ---
938
+
939
+ ##### `removalPolicy`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.removalPolicy"></a>
940
+
941
+ - *Type:* [`aws-cdk-lib.RemovalPolicy`](#aws-cdk-lib.RemovalPolicy)
942
+ - *Default:* per resource default
943
+
944
+ RemovalPolicy override for child resources.
945
+
946
+ ---
947
+
948
+ ##### `replaceHostHeader`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.replaceHostHeader"></a>
949
+
950
+ - *Type:* `boolean`
951
+ - *Default:* true
952
+
953
+ Replaces Host header (which will be the Edge domain name) with the Origin domain name when enabled.
954
+
955
+ This is necessary when API Gateway has not been configured
956
+ with a custom domain name that matches the exact domain name used by the CloudFront
957
+ Distribution AND when the OriginRequestPolicy.HeadersBehavior is set
958
+ to pass all headers to the origin.
959
+
960
+ Note: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin
961
+
962
+ ---
963
+
964
+ ##### `signingMode`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps.signingMode"></a>
965
+
966
+ - *Type:* `string`
967
+ - *Default:* 'sign'
968
+
969
+ Requires IAM auth on the API Gateway origin if not set to 'none'.
970
+
971
+ 'sign' - Uses request headers for auth.
972
+ 'presign' - Uses query string for auth.
973
+
974
+ If enabled,
975
+
976
+ Note: if 'sign' or 'presign', creates OriginRequest Lambda @ Edge function for API Gateway Origin
977
+
978
+ ---
979
+
671
980
  ### MicroAppsProps <a name="@pwrdrvr/microapps-cdk.MicroAppsProps"></a>
672
981
 
673
982
  Properties to initialize an instance of `MicroApps`.
@@ -689,6 +998,20 @@ Passed to NODE_ENV of Router and Deployer Lambda functions.
689
998
 
690
999
  ---
691
1000
 
1001
+ ##### `addXForwardedHostHeader`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.addXForwardedHostHeader"></a>
1002
+
1003
+ - *Type:* `boolean`
1004
+ - *Default:* true
1005
+
1006
+ Adds an X-Forwarded-Host-Header when calling API Gateway.
1007
+
1008
+ Can only be trusted if `signingMode` is enabled, which restricts
1009
+ access to API Gateway to only IAM signed requests.
1010
+
1011
+ Note: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin
1012
+
1013
+ ---
1014
+
692
1015
  ##### `assetNameRoot`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.assetNameRoot"></a>
693
1016
 
694
1017
  - *Type:* `string`
@@ -755,6 +1078,15 @@ Optional custom domain name for the API Gateway HTTPv2 API.
755
1078
 
756
1079
  ---
757
1080
 
1081
+ ##### `originRegion`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.originRegion"></a>
1082
+
1083
+ - *Type:* `string`
1084
+ - *Default:* undefined
1085
+
1086
+ Origin region that API Gateway will be deployed to, used for the config.yml on the Edge function to sign requests for the correct region.
1087
+
1088
+ ---
1089
+
758
1090
  ##### `r53Zone`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.r53Zone"></a>
759
1091
 
760
1092
  - *Type:* [`aws-cdk-lib.aws_route53.IHostedZone`](#aws-cdk-lib.aws_route53.IHostedZone)
@@ -774,6 +1106,22 @@ Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true
774
1106
 
775
1107
  ---
776
1108
 
1109
+ ##### `replaceHostHeader`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.replaceHostHeader"></a>
1110
+
1111
+ - *Type:* `boolean`
1112
+ - *Default:* true
1113
+
1114
+ Replaces Host header (which will be the Edge domain name) with the Origin domain name when enabled.
1115
+
1116
+ This is necessary when API Gateway has not been configured
1117
+ with a custom domain name that matches the exact domain name used by the CloudFront
1118
+ Distribution AND when the OriginRequestPolicy.HeadersBehavior is set
1119
+ to pass all headers to the origin.
1120
+
1121
+ Note: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin
1122
+
1123
+ ---
1124
+
777
1125
  ##### `rootPathPrefix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.rootPathPrefix"></a>
778
1126
 
779
1127
  - *Type:* `string`
@@ -855,6 +1203,31 @@ fully trusted.
855
1203
 
856
1204
  ---
857
1205
 
1206
+ ##### `signingMode`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.signingMode"></a>
1207
+
1208
+ - *Type:* `string`
1209
+ - *Default:* 'sign'
1210
+
1211
+ Requires IAM auth on the API Gateway origin if not set to 'none'.
1212
+
1213
+ 'sign' - Uses request headers for auth.
1214
+ 'presign' - Uses query string for auth.
1215
+
1216
+ If enabled,
1217
+
1218
+ Note: if 'sign' or 'presign', creates OriginRequest Lambda @ Edge function for API Gateway Origin
1219
+
1220
+ ---
1221
+
1222
+ ##### `table`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsProps.table"></a>
1223
+
1224
+ - *Type:* [`aws-cdk-lib.aws_dynamodb.ITable`](#aws-cdk-lib.aws_dynamodb.ITable)
1225
+ - *Default:* created by construct
1226
+
1227
+ Existing table for apps/versions/rules.
1228
+
1229
+ ---
1230
+
858
1231
  ### MicroAppsS3Props <a name="@pwrdrvr/microapps-cdk.MicroAppsS3Props"></a>
859
1232
 
860
1233
  Properties to initialize an instance of `MicroAppsS3`.
@@ -1004,6 +1377,15 @@ Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true
1004
1377
 
1005
1378
  ---
1006
1379
 
1380
+ ##### `requireIAMAuthorization`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.requireIAMAuthorization"></a>
1381
+
1382
+ - *Type:* `boolean`
1383
+ - *Default:* true
1384
+
1385
+ Require IAM auth on API Gateway.
1386
+
1387
+ ---
1388
+
1007
1389
  ##### `rootPathPrefix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.rootPathPrefix"></a>
1008
1390
 
1009
1391
  - *Type:* `string`
@@ -1086,6 +1468,73 @@ fully trusted.
1086
1468
 
1087
1469
  ---
1088
1470
 
1471
+ ##### `table`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.table"></a>
1472
+
1473
+ - *Type:* [`aws-cdk-lib.aws_dynamodb.ITable`](#aws-cdk-lib.aws_dynamodb.ITable)
1474
+ - *Default:* created by construct
1475
+
1476
+ Existing table for apps/versions/rules.
1477
+
1478
+ ---
1479
+
1480
+ ### MicroAppsTableProps <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps"></a>
1481
+
1482
+ Properties to initialize an instance of `MicroAppsTable`.
1483
+
1484
+ #### Initializer <a name="[object Object].Initializer"></a>
1485
+
1486
+ ```typescript
1487
+ import { MicroAppsTableProps } from '@pwrdrvr/microapps-cdk'
1488
+
1489
+ const microAppsTableProps: MicroAppsTableProps = { ... }
1490
+ ```
1491
+
1492
+ ##### `appEnv`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps.appEnv"></a>
1493
+
1494
+ - *Type:* `string`
1495
+
1496
+ Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions.
1497
+
1498
+ ---
1499
+
1500
+ ##### `assetNameRoot`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps.assetNameRoot"></a>
1501
+
1502
+ - *Type:* `string`
1503
+ - *Default:* resource names auto assigned
1504
+
1505
+ Optional asset name root.
1506
+
1507
+ ---
1508
+
1509
+ ##### `assetNameSuffix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps.assetNameSuffix"></a>
1510
+
1511
+ - *Type:* `string`
1512
+ - *Default:* none
1513
+
1514
+ Optional asset name suffix.
1515
+
1516
+ ---
1517
+
1518
+ ##### `removalPolicy`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps.removalPolicy"></a>
1519
+
1520
+ - *Type:* [`aws-cdk-lib.RemovalPolicy`](#aws-cdk-lib.RemovalPolicy)
1521
+ - *Default:* per resource default
1522
+
1523
+ RemovalPolicy override for child resources.
1524
+
1525
+ Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
1526
+
1527
+ ---
1528
+
1529
+ ##### `rootPathPrefix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsTableProps.rootPathPrefix"></a>
1530
+
1531
+ - *Type:* `string`
1532
+ - *Default:* none
1533
+
1534
+ Path prefix on the root of the deployment.
1535
+
1536
+ ---
1537
+
1089
1538
 
1090
1539
  ## Protocols <a name="Protocols"></a>
1091
1540
 
@@ -1130,6 +1579,14 @@ Represents a MicroApps.
1130
1579
 
1131
1580
  ---
1132
1581
 
1582
+ ##### `edgeToOrigin`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.IMicroApps.edgeToOrigin"></a>
1583
+
1584
+ - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin`](#@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin)
1585
+
1586
+ {@inheritdoc IMicroAppsEdgeToOrigin}.
1587
+
1588
+ ---
1589
+
1133
1590
  ### IMicroAppsAPIGwy <a name="@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy"></a>
1134
1591
 
1135
1592
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.MicroAppsAPIGwy), [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
@@ -1168,6 +1625,35 @@ Represents a MicroApps CloudFront.
1168
1625
 
1169
1626
  - *Type:* [`aws-cdk-lib.aws_cloudfront.Distribution`](#aws-cdk-lib.aws_cloudfront.Distribution)
1170
1627
 
1628
+ The CloudFront distribution.
1629
+
1630
+ ---
1631
+
1632
+ ### IMicroAppsEdgeToOrigin <a name="@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin"></a>
1633
+
1634
+ - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin`](#@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin), [`@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin`](#@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin)
1635
+
1636
+ Represents a MicroApps Edge to Origin Function.
1637
+
1638
+
1639
+ #### Properties <a name="Properties"></a>
1640
+
1641
+ ##### `edgeToOriginFunction`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin.edgeToOriginFunction"></a>
1642
+
1643
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction`](#aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction) | [`aws-cdk-lib.aws_lambda.Function`](#aws-cdk-lib.aws_lambda.Function)
1644
+
1645
+ The edge to origin function for API Gateway Request Origin Edge Lambda.
1646
+
1647
+ The generated `config.yml` is included in the Lambda's code.
1648
+
1649
+ ---
1650
+
1651
+ ##### `edgeToOriginLambdas`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin.edgeToOriginLambdas"></a>
1652
+
1653
+ - *Type:* [`aws-cdk-lib.aws_cloudfront.EdgeLambda`](#aws-cdk-lib.aws_cloudfront.EdgeLambda)[]
1654
+
1655
+ Configuration of the edge to origin lambda functions.
1656
+
1171
1657
  ---
1172
1658
 
1173
1659
  ### IMicroAppsS3 <a name="@pwrdrvr/microapps-cdk.IMicroAppsS3"></a>
@@ -1252,3 +1738,20 @@ DynamoDB table used by Router, Deployer, and Release console app.
1252
1738
 
1253
1739
  ---
1254
1740
 
1741
+ ### IMicroAppsTable <a name="@pwrdrvr/microapps-cdk.IMicroAppsTable"></a>
1742
+
1743
+ - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsTable`](#@pwrdrvr/microapps-cdk.MicroAppsTable), [`@pwrdrvr/microapps-cdk.IMicroAppsTable`](#@pwrdrvr/microapps-cdk.IMicroAppsTable)
1744
+
1745
+ Represents a MicroAppsTable.
1746
+
1747
+
1748
+ #### Properties <a name="Properties"></a>
1749
+
1750
+ ##### `table`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroAppsTable.table"></a>
1751
+
1752
+ - *Type:* [`aws-cdk-lib.aws_dynamodb.Table`](#aws-cdk-lib.aws_dynamodb.Table)
1753
+
1754
+ DynamoDB table used by Router, Deployer, and Release console app.
1755
+
1756
+ ---
1757
+