@pwrdrvr/microapps-cdk 0.2.1 → 0.2.7

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.
package/API.md CHANGED
@@ -6,7 +6,17 @@
6
6
 
7
7
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroApps`](#@pwrdrvr/microapps-cdk.IMicroApps)
8
8
 
9
- Application deployment and runtime environment.
9
+ Create a new MicroApps "turnkey" construct for simple deployments and for initial evaulation of the MicroApps framework.
10
+
11
+ Use this construct to create a working entire stack.
12
+
13
+ Do not use this construct when adding MicroApps to an existing
14
+ CloudFront, API Gateway, S3 Bucket, etc. or where access
15
+ to all features of the AWS Resources are needed (e.g. to
16
+ add additional Behaviors to the CloudFront distribution, set authorizors
17
+ on API Gateway, etc.).
18
+
19
+ > {@link https://github.com/pwrdrvr/microapps-core/blob/main/packages/cdk/lib/MicroApps.ts | example usage in a CDK Stack }
10
20
 
11
21
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroApps.Initializer"></a>
12
22
 
@@ -42,24 +52,32 @@ new MicroApps(scope: Construct, id: string, props?: MicroAppsProps)
42
52
 
43
53
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
44
54
 
55
+ {@inheritdoc IMicroAppsAPIGwy}.
56
+
45
57
  ---
46
58
 
47
59
  ##### `cf`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroApps.cf"></a>
48
60
 
49
61
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsCF`](#@pwrdrvr/microapps-cdk.IMicroAppsCF)
50
62
 
63
+ {@inheritdoc IMicroAppsCF}.
64
+
51
65
  ---
52
66
 
53
67
  ##### `s3`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroApps.s3"></a>
54
68
 
55
69
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsS3`](#@pwrdrvr/microapps-cdk.IMicroAppsS3)
56
70
 
71
+ {@inheritdoc IMicroAppsS3}.
72
+
57
73
  ---
58
74
 
59
75
  ##### `svcs`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroApps.svcs"></a>
60
76
 
61
77
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsSvcs`](#@pwrdrvr/microapps-cdk.IMicroAppsSvcs)
62
78
 
79
+ {@inheritdoc IMicroAppsSvcs}.
80
+
63
81
  ---
64
82
 
65
83
 
@@ -67,6 +85,8 @@ new MicroApps(scope: Construct, id: string, props?: MicroAppsProps)
67
85
 
68
86
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
69
87
 
88
+ Create a new MicroApps API Gateway HTTP API endpoint.
89
+
70
90
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwy.Initializer"></a>
71
91
 
72
92
  ```typescript
@@ -118,6 +138,8 @@ Domain Name applied to API Gateway origin.
118
138
 
119
139
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsCF`](#@pwrdrvr/microapps-cdk.IMicroAppsCF)
120
140
 
141
+ Create a new MicroApps CloudFront Distribution.
142
+
121
143
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsCF.Initializer"></a>
122
144
 
123
145
  ```typescript
@@ -200,6 +222,8 @@ MicroAppsCF.createAPIOriginPolicy(scope: Construct, props: CreateAPIOriginPolicy
200
222
 
201
223
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsS3`](#@pwrdrvr/microapps-cdk.IMicroAppsS3)
202
224
 
225
+ Create a new MicroApps S3 Bucket.
226
+
203
227
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsS3.Initializer"></a>
204
228
 
205
229
  ```typescript
@@ -275,6 +299,8 @@ S3 bucket for CloudFront logs.
275
299
 
276
300
  - *Implements:* [`@pwrdrvr/microapps-cdk.IMicroAppsSvcs`](#@pwrdrvr/microapps-cdk.IMicroAppsSvcs)
277
301
 
302
+ Create a new MicroApps Services construct, including the Deployer and Router Lambda Functions, and the DynamoDB Table used by both.
303
+
278
304
  #### Initializer <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcs.Initializer"></a>
279
305
 
280
306
  ```typescript
@@ -313,6 +339,14 @@ Lambda function for the Deployer.
313
339
 
314
340
  ---
315
341
 
342
+ ##### `routerFunc`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcs.routerFunc"></a>
343
+
344
+ - *Type:* [`aws-cdk-lib.aws_lambda.IFunction`](#aws-cdk-lib.aws_lambda.IFunction)
345
+
346
+ Lambda function for the Router.
347
+
348
+ ---
349
+
316
350
  ##### `table`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcs.table"></a>
317
351
 
318
352
  - *Type:* [`aws-cdk-lib.aws_dynamodb.ITable`](#aws-cdk-lib.aws_dynamodb.ITable)
@@ -326,6 +360,8 @@ DynamoDB table used by Router, Deployer, and Release console app.
326
360
 
327
361
  ### AddRoutesOptions <a name="@pwrdrvr/microapps-cdk.AddRoutesOptions"></a>
328
362
 
363
+ Options for `AddRoutes`.
364
+
329
365
  #### Initializer <a name="[object Object].Initializer"></a>
330
366
 
331
367
  ```typescript
@@ -390,6 +426,8 @@ Path prefix on the root of the CloudFront distribution.
390
426
 
391
427
  ### CreateAPIOriginPolicyOptions <a name="@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions"></a>
392
428
 
429
+ Options for the `CreateAPIOriginPolicy`.
430
+
393
431
  #### Initializer <a name="[object Object].Initializer"></a>
394
432
 
395
433
  ```typescript
@@ -401,12 +439,18 @@ const createAPIOriginPolicyOptions: CreateAPIOriginPolicyOptions = { ... }
401
439
  ##### `assetNameRoot`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions.assetNameRoot"></a>
402
440
 
403
441
  - *Type:* `string`
442
+ - *Default:* resource names auto assigned
443
+
444
+ Optional asset name root.
404
445
 
405
446
  ---
406
447
 
407
448
  ##### `assetNameSuffix`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions.assetNameSuffix"></a>
408
449
 
409
450
  - *Type:* `string`
451
+ - *Default:* none
452
+
453
+ Optional asset name suffix.
410
454
 
411
455
  ---
412
456
 
@@ -420,6 +464,8 @@ Edge domain name used by CloudFront - If set a custom OriginRequestPolicy will b
420
464
 
421
465
  ### MicroAppsAPIGwyProps <a name="@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps"></a>
422
466
 
467
+ Properties to initialize an instance of `MicroAppsAPIGwy`.
468
+
423
469
  #### Initializer <a name="[object Object].Initializer"></a>
424
470
 
425
471
  ```typescript
@@ -503,6 +549,8 @@ Path prefix on the root of the API Gateway Stage.
503
549
 
504
550
  ### MicroAppsCFProps <a name="@pwrdrvr/microapps-cdk.MicroAppsCFProps"></a>
505
551
 
552
+ Properties to initialize an instance of `MicroAppsCF`.
553
+
506
554
  #### Initializer <a name="[object Object].Initializer"></a>
507
555
 
508
556
  ```typescript
@@ -622,7 +670,7 @@ Path prefix on the root of the CloudFront distribution.
622
670
 
623
671
  ### MicroAppsProps <a name="@pwrdrvr/microapps-cdk.MicroAppsProps"></a>
624
672
 
625
- Props for MicroApps.
673
+ Properties to initialize an instance of `MicroApps`.
626
674
 
627
675
  #### Initializer <a name="[object Object].Initializer"></a>
628
676
 
@@ -809,6 +857,8 @@ fully trusted.
809
857
 
810
858
  ### MicroAppsS3Props <a name="@pwrdrvr/microapps-cdk.MicroAppsS3Props"></a>
811
859
 
860
+ Properties to initialize an instance of `MicroAppsS3`.
861
+
812
862
  #### Initializer <a name="[object Object].Initializer"></a>
813
863
 
814
864
  ```typescript
@@ -869,12 +919,14 @@ S3 logs bucket name.
869
919
 
870
920
  RemovalPolicy override for child resources.
871
921
 
872
- Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
922
+ Note: if set to DESTROY the S3 buckets will have `autoDeleteObjects` set to `true`
873
923
 
874
924
  ---
875
925
 
876
926
  ### MicroAppsSvcsProps <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps"></a>
877
927
 
928
+ Properties to initialize an instance of `MicroAppsSvcs`.
929
+
878
930
  #### Initializer <a name="[object Object].Initializer"></a>
879
931
 
880
932
  ```typescript
@@ -887,6 +939,8 @@ const microAppsSvcsProps: MicroAppsSvcsProps = { ... }
887
939
 
888
940
  - *Type:* `string`
889
941
 
942
+ Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions.
943
+
890
944
  ---
891
945
 
892
946
  ##### `bucketApps`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.bucketApps"></a>
@@ -963,17 +1017,72 @@ Path prefix on the root of the deployment.
963
1017
 
964
1018
  - *Type:* `string`[]
965
1019
 
1020
+ Applies when using s3StrictBucketPolicy = true.
1021
+
1022
+ AROAs of the IAM Role to exclude from the DENY rules on the S3 Bucket Policy.
1023
+ This allows sessions that assume the IAM Role to be excluded from the
1024
+ DENY rules on the S3 Bucket Policy.
1025
+
1026
+ Typically any admin roles / users that need to view or manage the S3 Bucket
1027
+ would be added to this list.
1028
+
1029
+ Roles / users that are used directly, not assumed, can be added to `s3PolicyBypassRoleNames` instead.
1030
+
1031
+ Note: This AROA must be specified to prevent this policy from locking
1032
+ out non-root sessions that have assumed the admin role.
1033
+
1034
+ The notPrincipals will only match the role name exactly and will not match
1035
+ any session that has assumed the role since notPrincipals does not allow
1036
+ wildcard matches and does not do wildcard matches implicitly either.
1037
+
1038
+ The AROA must be used because there are only 3 Principal variables available:
1039
+ https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
1040
+ aws:username, aws:userid, aws:PrincipalTag
1041
+
1042
+ For an assumed role, aws:username is blank, aws:userid is:
1043
+ [unique id AKA AROA for Role]:[session name]
1044
+
1045
+ Table of unique ID prefixes such as AROA:
1046
+ https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-prefixes
1047
+
1048
+ The name of the role is simply not available for an assumed role and, if it was,
1049
+ a complicated comparison would be requierd to prevent exclusion
1050
+ of applying the Deny Rule to roles from other accounts.
1051
+
1052
+ To get the AROA with the AWS CLI:
1053
+ aws iam get-role --role-name ROLE-NAME
1054
+ aws iam get-user -–user-name USER-NAME
1055
+
1056
+ > s3StrictBucketPolicy
1057
+
966
1058
  ---
967
1059
 
968
1060
  ##### `s3PolicyBypassPrincipalARNs`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.s3PolicyBypassPrincipalARNs"></a>
969
1061
 
970
1062
  - *Type:* `string`[]
971
1063
 
1064
+ Applies when using s3StrictBucketPolicy = true.
1065
+
1066
+ IAM Role or IAM User names to exclude from the DENY rules on the S3 Bucket Policy.
1067
+
1068
+ Roles that are Assumed must instead have their AROA added to `s3PolicyBypassAROAs`.
1069
+
1070
+ Typically any admin roles / users that need to view or manage the S3 Bucket
1071
+ would be added to this list.
1072
+
1073
+ > s3PolicyBypassAROAs
1074
+
972
1075
  ---
973
1076
 
974
1077
  ##### `s3StrictBucketPolicy`<sup>Optional</sup> <a name="@pwrdrvr/microapps-cdk.MicroAppsSvcsProps.s3StrictBucketPolicy"></a>
975
1078
 
976
1079
  - *Type:* `boolean`
1080
+ - *Default:* false
1081
+
1082
+ Use a strict S3 Bucket Policy that prevents applications from reading/writing/modifying/deleting files in the S3 Bucket outside of the path that is specific to their app/version.
1083
+
1084
+ This setting should be used when applications are less than
1085
+ fully trusted.
977
1086
 
978
1087
  ---
979
1088
 
@@ -984,6 +1093,8 @@ Path prefix on the root of the deployment.
984
1093
 
985
1094
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroApps`](#@pwrdrvr/microapps-cdk.MicroApps), [`@pwrdrvr/microapps-cdk.IMicroApps`](#@pwrdrvr/microapps-cdk.IMicroApps)
986
1095
 
1096
+ Represents a MicroApps.
1097
+
987
1098
 
988
1099
  #### Properties <a name="Properties"></a>
989
1100
 
@@ -991,30 +1102,40 @@ Path prefix on the root of the deployment.
991
1102
 
992
1103
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
993
1104
 
1105
+ {@inheritdoc IMicroAppsAPIGwy}.
1106
+
994
1107
  ---
995
1108
 
996
1109
  ##### `cf`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroApps.cf"></a>
997
1110
 
998
1111
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsCF`](#@pwrdrvr/microapps-cdk.IMicroAppsCF)
999
1112
 
1113
+ {@inheritdoc IMicroAppsCF}.
1114
+
1000
1115
  ---
1001
1116
 
1002
1117
  ##### `s3`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroApps.s3"></a>
1003
1118
 
1004
1119
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsS3`](#@pwrdrvr/microapps-cdk.IMicroAppsS3)
1005
1120
 
1121
+ {@inheritdoc IMicroAppsS3}.
1122
+
1006
1123
  ---
1007
1124
 
1008
1125
  ##### `svcs`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroApps.svcs"></a>
1009
1126
 
1010
1127
  - *Type:* [`@pwrdrvr/microapps-cdk.IMicroAppsSvcs`](#@pwrdrvr/microapps-cdk.IMicroAppsSvcs)
1011
1128
 
1129
+ {@inheritdoc IMicroAppsSvcs}.
1130
+
1012
1131
  ---
1013
1132
 
1014
1133
  ### IMicroAppsAPIGwy <a name="@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy"></a>
1015
1134
 
1016
1135
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.MicroAppsAPIGwy), [`@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy`](#@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy)
1017
1136
 
1137
+ Represents a MicroApps API Gateway.
1138
+
1018
1139
 
1019
1140
  #### Properties <a name="Properties"></a>
1020
1141
 
@@ -1038,6 +1159,8 @@ Domain Name applied to API Gateway origin.
1038
1159
 
1039
1160
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsCF`](#@pwrdrvr/microapps-cdk.MicroAppsCF), [`@pwrdrvr/microapps-cdk.IMicroAppsCF`](#@pwrdrvr/microapps-cdk.IMicroAppsCF)
1040
1161
 
1162
+ Represents a MicroApps CloudFront.
1163
+
1041
1164
 
1042
1165
  #### Properties <a name="Properties"></a>
1043
1166
 
@@ -1051,6 +1174,8 @@ Domain Name applied to API Gateway origin.
1051
1174
 
1052
1175
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsS3`](#@pwrdrvr/microapps-cdk.MicroAppsS3), [`@pwrdrvr/microapps-cdk.IMicroAppsS3`](#@pwrdrvr/microapps-cdk.IMicroAppsS3)
1053
1176
 
1177
+ Represents a MicroApps S3.
1178
+
1054
1179
 
1055
1180
  #### Properties <a name="Properties"></a>
1056
1181
 
@@ -1098,6 +1223,8 @@ S3 bucket for CloudFront logs.
1098
1223
 
1099
1224
  - *Implemented By:* [`@pwrdrvr/microapps-cdk.MicroAppsSvcs`](#@pwrdrvr/microapps-cdk.MicroAppsSvcs), [`@pwrdrvr/microapps-cdk.IMicroAppsSvcs`](#@pwrdrvr/microapps-cdk.IMicroAppsSvcs)
1100
1225
 
1226
+ Represents a MicroApps Services.
1227
+
1101
1228
 
1102
1229
  #### Properties <a name="Properties"></a>
1103
1230
 
@@ -1109,6 +1236,14 @@ Lambda function for the Deployer.
1109
1236
 
1110
1237
  ---
1111
1238
 
1239
+ ##### `routerFunc`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroAppsSvcs.routerFunc"></a>
1240
+
1241
+ - *Type:* [`aws-cdk-lib.aws_lambda.IFunction`](#aws-cdk-lib.aws_lambda.IFunction)
1242
+
1243
+ Lambda function for the Router.
1244
+
1245
+ ---
1246
+
1112
1247
  ##### `table`<sup>Required</sup> <a name="@pwrdrvr/microapps-cdk.IMicroAppsSvcs.table"></a>
1113
1248
 
1114
1249
  - *Type:* [`aws-cdk-lib.aws_dynamodb.ITable`](#aws-cdk-lib.aws_dynamodb.ITable)