@pwrdrvr/microapps-cdk 0.0.29 → 0.2.6
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/.jsii +3108 -1362
- package/API.md +240 -53
- package/README.md +236 -135
- package/lib/MicroApps.d.ts +86 -50
- package/lib/MicroApps.js +30 -16
- package/lib/MicroAppsAPIGwy.d.ts +42 -37
- package/lib/MicroAppsAPIGwy.js +19 -18
- package/lib/MicroAppsCF.d.ts +115 -57
- package/lib/MicroAppsCF.js +31 -21
- package/lib/MicroAppsS3.d.ts +51 -46
- package/lib/MicroAppsS3.js +23 -22
- package/lib/MicroAppsSvcs.d.ts +123 -44
- package/lib/MicroAppsSvcs.js +112 -42
- package/lib/microapps-deployer/index.js +93 -89
- package/lib/microapps-deployer/index.js.map +3 -3
- package/lib/microapps-router/index.js.map +2 -2
- package/package.json +15 -36
- package/patches/@aws-cdk+aws-apigatewayv2-alpha+2.8.0-alpha.0.patch +39 -0
package/lib/MicroAppsSvcs.d.ts
CHANGED
|
@@ -1,87 +1,151 @@
|
|
|
1
|
-
import * as apigwy from '@aws-cdk/aws-apigatewayv2';
|
|
2
|
-
import
|
|
3
|
-
import * as
|
|
4
|
-
import * as
|
|
5
|
-
import * as
|
|
6
|
-
import * as
|
|
1
|
+
import * as apigwy from '@aws-cdk/aws-apigatewayv2-alpha';
|
|
2
|
+
import { RemovalPolicy } from 'aws-cdk-lib';
|
|
3
|
+
import * as cf from 'aws-cdk-lib/aws-cloudfront';
|
|
4
|
+
import * as dynamodb from 'aws-cdk-lib/aws-dynamodb';
|
|
5
|
+
import * as lambda from 'aws-cdk-lib/aws-lambda';
|
|
6
|
+
import * as s3 from 'aws-cdk-lib/aws-s3';
|
|
7
|
+
import { Construct } from 'constructs';
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* (experimental) Properties to initialize an instance of `MicroAppsSvcs`.
|
|
10
|
+
*
|
|
11
|
+
* @experimental
|
|
9
12
|
*/
|
|
10
13
|
export interface MicroAppsSvcsProps {
|
|
11
14
|
/**
|
|
12
|
-
* RemovalPolicy override for child resources.
|
|
15
|
+
* (experimental) RemovalPolicy override for child resources.
|
|
13
16
|
*
|
|
14
17
|
* Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
|
|
15
18
|
*
|
|
16
19
|
* @default - per resource default
|
|
17
|
-
* @
|
|
20
|
+
* @experimental
|
|
18
21
|
*/
|
|
19
|
-
readonly removalPolicy?:
|
|
22
|
+
readonly removalPolicy?: RemovalPolicy;
|
|
20
23
|
/**
|
|
21
|
-
* S3 bucket for deployed applications.
|
|
24
|
+
* (experimental) S3 bucket for deployed applications.
|
|
22
25
|
*
|
|
23
|
-
* @
|
|
26
|
+
* @experimental
|
|
24
27
|
*/
|
|
25
28
|
readonly bucketApps: s3.IBucket;
|
|
26
29
|
/**
|
|
27
|
-
* CloudFront Origin Access Identity for the deployed applications bucket.
|
|
30
|
+
* (experimental) CloudFront Origin Access Identity for the deployed applications bucket.
|
|
28
31
|
*
|
|
29
|
-
* @
|
|
32
|
+
* @experimental
|
|
30
33
|
*/
|
|
31
34
|
readonly bucketAppsOAI: cf.OriginAccessIdentity;
|
|
32
35
|
/**
|
|
33
|
-
* S3 bucket for staged applications (prior to deploy).
|
|
36
|
+
* (experimental) S3 bucket for staged applications (prior to deploy).
|
|
34
37
|
*
|
|
35
|
-
* @
|
|
38
|
+
* @experimental
|
|
36
39
|
*/
|
|
37
40
|
readonly bucketAppsStaging: s3.IBucket;
|
|
38
41
|
/**
|
|
39
|
-
* API Gateway v2 HTTP for Router and app.
|
|
42
|
+
* (experimental) API Gateway v2 HTTP for Router and app.
|
|
40
43
|
*
|
|
41
|
-
* @
|
|
44
|
+
* @experimental
|
|
42
45
|
*/
|
|
43
46
|
readonly httpApi: apigwy.HttpApi;
|
|
44
47
|
/**
|
|
45
|
-
*
|
|
48
|
+
* (experimental) Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions.
|
|
49
|
+
*
|
|
50
|
+
* @experimental
|
|
46
51
|
*/
|
|
47
52
|
readonly appEnv: string;
|
|
48
53
|
/**
|
|
49
|
-
* Optional asset name root.
|
|
54
|
+
* (experimental) Optional asset name root.
|
|
50
55
|
*
|
|
51
56
|
* @default - resource names auto assigned
|
|
52
|
-
* @
|
|
57
|
+
* @experimental
|
|
53
58
|
* @example
|
|
54
59
|
*
|
|
55
60
|
* microapps
|
|
56
61
|
*/
|
|
57
62
|
readonly assetNameRoot?: string;
|
|
58
63
|
/**
|
|
59
|
-
* Optional asset name suffix.
|
|
64
|
+
* (experimental) Optional asset name suffix.
|
|
60
65
|
*
|
|
61
66
|
* @default none
|
|
62
|
-
* @
|
|
67
|
+
* @experimental
|
|
63
68
|
* @example
|
|
64
69
|
*
|
|
65
70
|
* -dev-pr-12
|
|
66
71
|
*/
|
|
67
72
|
readonly assetNameSuffix?: string;
|
|
68
73
|
/**
|
|
69
|
-
*
|
|
74
|
+
* (experimental) 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.
|
|
75
|
+
*
|
|
76
|
+
* This setting should be used when applications are less than
|
|
77
|
+
* fully trusted.
|
|
78
|
+
*
|
|
79
|
+
* @default false
|
|
80
|
+
* @experimental
|
|
70
81
|
*/
|
|
71
82
|
readonly s3StrictBucketPolicy?: boolean;
|
|
72
83
|
/**
|
|
73
|
-
*
|
|
84
|
+
* (experimental) Applies when using s3StrictBucketPolicy = true.
|
|
85
|
+
*
|
|
86
|
+
* IAM Role or IAM User names to exclude from the DENY rules on the S3 Bucket Policy.
|
|
87
|
+
*
|
|
88
|
+
* Roles that are Assumed must instead have their AROA added to `s3PolicyBypassAROAs`.
|
|
89
|
+
*
|
|
90
|
+
* Typically any admin roles / users that need to view or manage the S3 Bucket
|
|
91
|
+
* would be added to this list.
|
|
92
|
+
*
|
|
93
|
+
* @see s3PolicyBypassAROAs
|
|
94
|
+
* @experimental
|
|
95
|
+
* @example
|
|
96
|
+
*
|
|
97
|
+
* ['arn:aws:iam::1234567890123:role/AdminAccess', 'arn:aws:iam::1234567890123:user/MyAdminUser']
|
|
74
98
|
*/
|
|
75
|
-
readonly
|
|
99
|
+
readonly s3PolicyBypassPrincipalARNs?: string[];
|
|
76
100
|
/**
|
|
77
|
-
*
|
|
101
|
+
* (experimental) Applies when using s3StrictBucketPolicy = true.
|
|
102
|
+
*
|
|
103
|
+
* AROAs of the IAM Role to exclude from the DENY rules on the S3 Bucket Policy.
|
|
104
|
+
* This allows sessions that assume the IAM Role to be excluded from the
|
|
105
|
+
* DENY rules on the S3 Bucket Policy.
|
|
106
|
+
*
|
|
107
|
+
* Typically any admin roles / users that need to view or manage the S3 Bucket
|
|
108
|
+
* would be added to this list.
|
|
109
|
+
*
|
|
110
|
+
* Roles / users that are used directly, not assumed, can be added to `s3PolicyBypassRoleNames` instead.
|
|
111
|
+
*
|
|
112
|
+
* Note: This AROA must be specified to prevent this policy from locking
|
|
113
|
+
* out non-root sessions that have assumed the admin role.
|
|
114
|
+
*
|
|
115
|
+
* The notPrincipals will only match the role name exactly and will not match
|
|
116
|
+
* any session that has assumed the role since notPrincipals does not allow
|
|
117
|
+
* wildcard matches and does not do wildcard matches implicitly either.
|
|
118
|
+
*
|
|
119
|
+
* The AROA must be used because there are only 3 Principal variables available:
|
|
120
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_variables.html#principaltable
|
|
121
|
+
* aws:username, aws:userid, aws:PrincipalTag
|
|
122
|
+
*
|
|
123
|
+
* For an assumed role, aws:username is blank, aws:userid is:
|
|
124
|
+
* [unique id AKA AROA for Role]:[session name]
|
|
125
|
+
*
|
|
126
|
+
* Table of unique ID prefixes such as AROA:
|
|
127
|
+
* https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_identifiers.html#identifiers-prefixes
|
|
128
|
+
*
|
|
129
|
+
* The name of the role is simply not available for an assumed role and, if it was,
|
|
130
|
+
* a complicated comparison would be requierd to prevent exclusion
|
|
131
|
+
* of applying the Deny Rule to roles from other accounts.
|
|
132
|
+
*
|
|
133
|
+
* To get the AROA with the AWS CLI:
|
|
134
|
+
* aws iam get-role --role-name ROLE-NAME
|
|
135
|
+
* aws iam get-user -–user-name USER-NAME
|
|
136
|
+
*
|
|
137
|
+
* @see s3StrictBucketPolicy
|
|
138
|
+
* @experimental
|
|
139
|
+
* @example
|
|
140
|
+
*
|
|
141
|
+
* [ 'AROA1234567890123' ]
|
|
78
142
|
*/
|
|
79
|
-
readonly
|
|
143
|
+
readonly s3PolicyBypassAROAs?: string[];
|
|
80
144
|
/**
|
|
81
|
-
* Path prefix on the root of the deployment.
|
|
145
|
+
* (experimental) Path prefix on the root of the deployment.
|
|
82
146
|
*
|
|
83
147
|
* @default none
|
|
84
|
-
* @
|
|
148
|
+
* @experimental
|
|
85
149
|
* @example
|
|
86
150
|
*
|
|
87
151
|
* dev/
|
|
@@ -89,44 +153,59 @@ export interface MicroAppsSvcsProps {
|
|
|
89
153
|
readonly rootPathPrefix?: string;
|
|
90
154
|
}
|
|
91
155
|
/**
|
|
92
|
-
*
|
|
156
|
+
* (experimental) Represents a MicroApps Services.
|
|
157
|
+
*
|
|
158
|
+
* @experimental
|
|
93
159
|
*/
|
|
94
160
|
export interface IMicroAppsSvcs {
|
|
95
161
|
/**
|
|
96
|
-
* DynamoDB table used by Router, Deployer, and Release console app.
|
|
162
|
+
* (experimental) DynamoDB table used by Router, Deployer, and Release console app.
|
|
97
163
|
*
|
|
98
|
-
* @
|
|
164
|
+
* @experimental
|
|
99
165
|
*/
|
|
100
166
|
readonly table: dynamodb.ITable;
|
|
101
167
|
/**
|
|
102
|
-
* Lambda function for the Deployer.
|
|
168
|
+
* (experimental) Lambda function for the Deployer.
|
|
103
169
|
*
|
|
104
|
-
* @
|
|
170
|
+
* @experimental
|
|
105
171
|
*/
|
|
106
172
|
readonly deployerFunc: lambda.IFunction;
|
|
173
|
+
/**
|
|
174
|
+
* (experimental) Lambda function for the Router.
|
|
175
|
+
*
|
|
176
|
+
* @experimental
|
|
177
|
+
*/
|
|
178
|
+
readonly routerFunc: lambda.IFunction;
|
|
107
179
|
}
|
|
108
180
|
/**
|
|
109
|
-
*
|
|
181
|
+
* (experimental) Create a new MicroApps Services construct, including the Deployer and Router Lambda Functions, and the DynamoDB Table used by both.
|
|
182
|
+
*
|
|
183
|
+
* @experimental
|
|
110
184
|
*/
|
|
111
|
-
export declare class MicroAppsSvcs extends
|
|
185
|
+
export declare class MicroAppsSvcs extends Construct implements IMicroAppsSvcs {
|
|
112
186
|
private _table;
|
|
113
187
|
/**
|
|
114
|
-
* DynamoDB table used by Router, Deployer, and Release console app.
|
|
188
|
+
* (experimental) DynamoDB table used by Router, Deployer, and Release console app.
|
|
115
189
|
*
|
|
116
|
-
* @
|
|
190
|
+
* @experimental
|
|
117
191
|
*/
|
|
118
192
|
get table(): dynamodb.ITable;
|
|
119
193
|
private _deployerFunc;
|
|
120
194
|
/**
|
|
121
|
-
* Lambda function for the Deployer.
|
|
195
|
+
* (experimental) Lambda function for the Deployer.
|
|
122
196
|
*
|
|
123
|
-
* @
|
|
197
|
+
* @experimental
|
|
124
198
|
*/
|
|
125
199
|
get deployerFunc(): lambda.IFunction;
|
|
200
|
+
private _routerFunc;
|
|
126
201
|
/**
|
|
127
|
-
*
|
|
202
|
+
* (experimental) Lambda function for the Router.
|
|
128
203
|
*
|
|
129
|
-
* @
|
|
204
|
+
* @experimental
|
|
205
|
+
*/
|
|
206
|
+
get routerFunc(): lambda.IFunction;
|
|
207
|
+
/**
|
|
208
|
+
* @experimental
|
|
130
209
|
*/
|
|
131
|
-
constructor(scope:
|
|
210
|
+
constructor(scope: Construct, id: string, props?: MicroAppsSvcsProps);
|
|
132
211
|
}
|