@pwrdrvr/microapps-cdk 0.2.5 → 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 +119 -119
- package/README.md +236 -135
- package/lib/MicroApps.d.ts +51 -51
- package/lib/MicroApps.js +12 -12
- package/lib/MicroAppsAPIGwy.d.ts +31 -31
- package/lib/MicroAppsAPIGwy.js +8 -8
- package/lib/MicroAppsCF.d.ts +59 -59
- package/lib/MicroAppsCF.js +9 -9
- package/lib/MicroAppsS3.d.ts +39 -39
- package/lib/MicroAppsS3.js +14 -14
- package/lib/MicroAppsSvcs.d.ts +43 -43
- package/lib/MicroAppsSvcs.js +10 -10
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -2,151 +2,252 @@
|
|
|
2
2
|
|
|
3
3
|
# Overview
|
|
4
4
|
|
|
5
|
-
The MicroApps project
|
|
5
|
+
The MicroApps project enables rapidly deploying many web apps to AWS on a single shared host name, fronted by a CloudFront Distribution, serving static assets from an S3 Bucket, and routing application requests via API Gateway. MicroApps is delivered as a CDK Construct for deployment, although alternative deployment methods can be used if desired and implemented.
|
|
6
|
+
|
|
7
|
+
MicroApps allows many versions of an application to be deployed either as ephemeral deploys (e.g. for pull request builds) or as semi-permanent deploys. The `microapps-router` Lambda function handled routing requests to apps to the current version targeted for a particular application start request using rules as complex as one is interested in implementing (e.g. A/B testing integration, canary releases, per-user rules for logged in users, per-group, per-deparment, and default rules).
|
|
8
|
+
|
|
9
|
+
Users start applications via a URL such as `[/{prefix}]/{appname}/`, which hits the `microapps-router` that looks up the version of the application to be run, then renders a transparent `iframe` with a link to that version. The URL seen by the user in the browser (and available for bookmarking) has no version in it, so subsequent launches (e.g. the next day or just in another tab) will lookup the version again. All relative URL API requests (e.g. `some/api/path`) will go to the corresponding API version that matches the version of the loaded static files, eliminating issues of incompatibility between static files and API deployments.
|
|
10
|
+
|
|
11
|
+
For development / testing purposes only, each version of an applicaton can be accessed directly via a URL of the pattern `[/{prefix}]/{appname}/{semver}/`. These "versioned" URLs are not intended to be advertised to end users as they would cause a user to be stuck on a particular version of the app if the URL was bookmarked. Note that the system does not limit access to particular versions of an application, as of 2022-01-26, but that can be added as a feature.
|
|
12
|
+
|
|
13
|
+
# Installation / CDK Constructs
|
|
14
|
+
|
|
15
|
+
- `npm i --save-dev @pwrdrvr/microapps-cdk`
|
|
16
|
+
- Add `MicroApps` construct to your stack
|
|
17
|
+
- The `MicroApps` construct does a "turn-key" deployment complete with the Release app
|
|
18
|
+
- [Construct Hub](https://constructs.dev/packages/@pwrdrvr/microapps-cdk/)
|
|
19
|
+
- CDK API docs
|
|
20
|
+
- Python, DotNet, Java, JS/TS installation instructions
|
|
21
|
+
|
|
22
|
+
# Why MicroApps
|
|
23
|
+
|
|
24
|
+
MicroApps are like micro services, but for Web UIs. A MicroApp allows a single functional site to be developed by many independent teams within an organization. Teams must coordinate deployments and agree upon one implementation technology and framework when building a monolithic, or even a monorepo, web application.
|
|
25
|
+
|
|
26
|
+
Teams using MicroApps can deploy independently of each other with coordination being required only at points of intentional integration (e.g. adding a feature to pass context from one MicroApp to another or coordination of a major feature release to users) and sharing UI styles, if desired (it is possible to build styles that look the same across many different UI frameworks).
|
|
27
|
+
|
|
28
|
+
MicroApps also allow each team to use a UI framework and backend language that is most appropriate for their solving their business problem. Not every app has to use React or Next.js or even Node on the backend, but instead they can use whatever framework they want and Java, Go, C#, Python, etc. for UI API calls.
|
|
29
|
+
|
|
30
|
+
For internal sites, or logged-in-customer sites, different tools or products can be hosted in entirely independent MicroApps. A menuing system / toolbar application can be created as a MicroApp and that menu app can open the apps in the system within a transparent iframe. For externally facing sites, such as for an e-commerce site, it is possible to have a MicroApp serving `/product/...`, another serving `/search/...`, another serving `/`, etc.
|
|
31
|
+
|
|
32
|
+
# Limitations / Future Development
|
|
33
|
+
|
|
34
|
+
- `iframes`
|
|
35
|
+
- Yeah, yeah: `iframes` are not framesets and most of the hate about iframes is probably better directed at framesets
|
|
36
|
+
- The iframe serves a purpose but it stinks that it is there, primarily because it will cause issues with search bot indexing (SEO)
|
|
37
|
+
- There are other options available to implement that have their own drabacks:
|
|
38
|
+
- Using the `microapps-router` to proxy the "app start" request to a particular version of an app that then renders all of it's API resource requests to versioned URLs
|
|
39
|
+
- Works only with frameworks that support hashing filenams for each deploy to unique names
|
|
40
|
+
- This page would need to be marked as non-cachable
|
|
41
|
+
- This may work well with Next.js which wants to know the explicit path that it will be running at (it writes that path into all resource and API requests)
|
|
42
|
+
- Possible issue: the app would need to work ok being displayed at `[/{prefix}]/{appname}` when it may think that it's being displayed at `[/{prefix}]/{appname}/{semver}`
|
|
43
|
+
- Disadvantage: requires some level of UI framework features (e.g. writing the absolute resource paths) to work correctly - may not work as easily for all UI frameworks
|
|
44
|
+
- HTML5 added features to allow setting the relative path of all subsequent requests to be different than that displayed in the address bar
|
|
45
|
+
- Gotta see if this works in modern browsers
|
|
46
|
+
- Option to ditch the multiple-versions feature
|
|
47
|
+
- Works only with frameworks that support hashing filenams for each deploy to unique names
|
|
48
|
+
- Allows usage of the deploy and routing tooling without advantages and disadvantages of multiple-versions support
|
|
49
|
+
- AWS Only
|
|
50
|
+
- For the time being this has only been implemented for AWS technologies and APIs
|
|
51
|
+
- It is possible that Azure and GCP have sufficient support to enable porting the framework
|
|
52
|
+
- CDK would have to be replaced as well (unless it's made available for Azure and GCP in the near future)
|
|
53
|
+
- `microapps-publish` only supports Lambda function apps
|
|
54
|
+
- There is no technical reason for the apps to only run as Lambda functions
|
|
55
|
+
- Web apps could just as easily run on EC2, Kubernetes, EKS, ECS, etc
|
|
56
|
+
- Anything that API Gateway can route to can work for serving a MicroApp
|
|
57
|
+
- The publish tool needs to provide additional options for setting up the API Gateway route to the app
|
|
58
|
+
- Authentication
|
|
59
|
+
- Authentication requires rolling your own API Gateway and CloudFront deployment at the moment
|
|
60
|
+
- The "turn key" CDK Construct should provide options to show an example of how authentication can be integrated
|
|
61
|
+
- Release Rules
|
|
62
|
+
- Currently only a Default rule is supported
|
|
63
|
+
- Need to evaluate if a generic implementation can be made, possibly allowing plugins or webhooks to support arbitrary rules
|
|
64
|
+
- If not possible to make it perfectly generic, consider providing a more complete reference implementation of examples
|
|
65
|
+
|
|
66
|
+
# Related Projects / Components
|
|
67
|
+
|
|
68
|
+
- Release App
|
|
69
|
+
- The Release app is an initial, rudimentary, release control console for setting the default version of an application
|
|
70
|
+
- Built with Next.js
|
|
71
|
+
- [](https://github.com/pwrdrvr/microapps-app-release)
|
|
72
|
+
- Next.js Demo App
|
|
73
|
+
- The Next.js Tutorial application deployed as a MicroApp
|
|
74
|
+
- [](https://github.com/pwrdrvr/serverless-nextjs-demo)
|
|
75
|
+
- Serverless Next.js Router
|
|
76
|
+
- [](https://github.com/pwrdrvr/serverless-nextjs-router)
|
|
77
|
+
- Complementary to [@sls-next/serverless-component](https://github.com/serverless-nextjs/serverless-next.js)
|
|
78
|
+
- Allows Next.js apps to run as Lambda @ Origin for speed and cost improvements vs Lambda@Edge
|
|
79
|
+
- Essentially the router translates CloudFront Lambda events to API Gateway Lambda events and vice versa for responses
|
|
80
|
+
- The `serverless-nextjs` project allows Next.js apps to run as Lambda functions without Express, but there was a design change to make the Lambda functions run at Edge (note: need to recheck if this changed after early 2021)
|
|
81
|
+
- Lambda@Edge is _at least_ 3x more expensive than Lambda at the origin:
|
|
82
|
+
- In US East 1, the price per GB-Second is $0.00005001 for Lambda@Edge vs $0.0000166667 for Lambda at the origin
|
|
83
|
+
- Additionally, any DB or services calls from Lambda@Edge back to the origin will pay that 3x higher per GB-Second cost for any time spent waiting to send the request and get a response. Example:
|
|
84
|
+
- Lambda@Edge
|
|
85
|
+
- 0.250s Round Trip Time (RTT) for EU-zone edge request to hit US-East 1 Origin
|
|
86
|
+
- 0.200s DB lookup time
|
|
87
|
+
- 0.050s CPU usage to process the DB response
|
|
88
|
+
- 0.500s total billed time @ $0.00005001 @ 128 MB
|
|
89
|
+
- $0.000003125625 total charge
|
|
90
|
+
- Lambda at Origin
|
|
91
|
+
- RTT does not apply (it's effectively 1-2 ms to hit a DB in the same region)
|
|
92
|
+
- 0.200s DB lookup time
|
|
93
|
+
- 0.050s CPU usage to process the DB response
|
|
94
|
+
- 0.250s total billed time @ $0.0000166667 @ 128 MB
|
|
95
|
+
- Half the billed time of running on Lambda@Edge
|
|
96
|
+
- 1/6th the cost of running on Lambda@Edge:
|
|
97
|
+
- $0.000000520834375 total charge (assuming no CPU time to process the response)
|
|
98
|
+
- $0.000003125625 / $0.000000520834375 = 6x more expensive in Lambda@Edge
|
|
99
|
+
|
|
100
|
+
# Architecure Diagram
|
|
101
|
+
|
|
102
|
+

|
|
6
103
|
|
|
7
104
|
# Project Layout
|
|
8
105
|
|
|
9
|
-
- [packages/cdk]()
|
|
106
|
+
- [packages/cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/cdk)
|
|
107
|
+
- Example CDK Stack
|
|
108
|
+
- Deploys MicroApps CDK stack for the GitHub Workflows
|
|
109
|
+
- Can be used as an example of how to use the MicroApps CDK Construct
|
|
110
|
+
- [packages/demo-app](https://github.com/pwrdrvr/microapps-core/tree/main/packages/demo-app)
|
|
111
|
+
- Example app with static resources and a Lambda function
|
|
112
|
+
- Does not use any Web UI framework at all
|
|
113
|
+
- [packages/microapps-cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-cdk)
|
|
114
|
+
|
|
115
|
+
- MicroApps
|
|
116
|
+
- "Turn key" CDK Construct that creates all assets needed for a working MicroApps deployment
|
|
117
|
+
- MicroAppsAPIGwy
|
|
118
|
+
- Create APIGateway HTTP API
|
|
119
|
+
- Creates domain names to point to the edge (Cloudfront) and origin (API Gateway)
|
|
120
|
+
- MicroAppsCF
|
|
121
|
+
- Creates Cloudfront distribution
|
|
10
122
|
- MicroAppsS3
|
|
11
123
|
- Creates S3 buckets
|
|
12
|
-
- MicroAppsRepos
|
|
13
|
-
- Creates the ECR repos for components to be published into;
|
|
14
|
-
- Deployer
|
|
15
|
-
- Router
|
|
16
124
|
- MicroAppsSvcs
|
|
17
125
|
- Create DynamoDB table
|
|
18
126
|
- Create Deployer Lambda function
|
|
19
127
|
- Create Router Lambda function
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
- [packages/microapps-deployer]()
|
|
128
|
+
|
|
129
|
+
- [packages/microapps-datalib](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-datalib)
|
|
130
|
+
- Installed from `npm`:
|
|
131
|
+
- `npm i -g @pwrdrvr/microapps-datalib`
|
|
132
|
+
- APIs for access to the DynamoDB Table used by `microapps-publish`, `microapps-deployer`, and `@pwrdrvr/microapps-app-release-cdk`
|
|
133
|
+
- [packages/microapps-deployer](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-deployer)
|
|
26
134
|
- Lambda service invoked by `microapps-publish` to record new app/version in the DynamoDB table, create API Gateway integrations, copy S3 assets from staging to prod bucket, etc.
|
|
27
|
-
-
|
|
135
|
+
- Returns a temporary S3 token with restricted access to the staging S3 bucket for upload of the static files for one app/semver
|
|
136
|
+
- [packages/microapps-publish](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-publish)
|
|
137
|
+
- Installed from `npm`:
|
|
138
|
+
- `npm i -g @pwrdrvr/microapps-publish`
|
|
28
139
|
- Node executable that updates versions in config files, deploys static assets to the S3 staging bucket, optionally compiles and deploys a new Lambda function version, and invokes `microapps-deployer`
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
|
|
32
|
-
- ECR write
|
|
33
|
-
- Lambda version publish
|
|
34
|
-
- [packages/microapps-router]()
|
|
140
|
+
- AWS IAM permissions required:
|
|
141
|
+
- `lambda:InvokeFunction`
|
|
142
|
+
- [packages/microapps-router](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-router)
|
|
35
143
|
- Lambda function that determines which version of an app to point a user to on a particular invocation
|
|
36
144
|
|
|
37
|
-
#
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
- Duration Warm: 10 ms
|
|
147
|
-
- Duration Cold: 85 ms
|
|
148
|
-
- Init Duration: 185 ms
|
|
149
|
-
- Billed Duration Warm: 12 ms
|
|
150
|
-
- Billed Duration Init: 85 ms
|
|
151
|
-
- Warm Cost: 0.02 millicents
|
|
152
|
-
- Init Cost: 0.14 millicents
|
|
145
|
+
# Creating a MicroApp Using Zip Lambda Functions
|
|
146
|
+
|
|
147
|
+
[TBC]
|
|
148
|
+
|
|
149
|
+
# Creating a MicroApp Using Docker Lambda Functions
|
|
150
|
+
|
|
151
|
+
Note: semi-deprecated as of 2022-01-27. Zip Lambda functions are better supported.
|
|
152
|
+
|
|
153
|
+
## Next.js Apps
|
|
154
|
+
|
|
155
|
+
Create a Next.js app then follow the steps in this section to set it up for publishing to AWS Lambda @ Origin as a MicroApp. To publish new versions of the app use `npx microapps-publish --new-version x.y.z` when logged in to the target AWS account.
|
|
156
|
+
|
|
157
|
+
### Modify package.json
|
|
158
|
+
|
|
159
|
+
Replace the version with `0.0.0` so it can be modified by the `microapps-publish` tool.
|
|
160
|
+
|
|
161
|
+
### Install Dependencies
|
|
162
|
+
|
|
163
|
+
```
|
|
164
|
+
npm i --save-dev @sls-next/serverless-component@1.19.0 @pwrdrvr/serverless-nextjs-router @pwrdrvr/microapps-publish
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
### Dockerfile
|
|
168
|
+
|
|
169
|
+
Add this file to the root of the app.
|
|
170
|
+
|
|
171
|
+
```Dockerfile
|
|
172
|
+
FROM node:15-slim as base
|
|
173
|
+
|
|
174
|
+
WORKDIR /app
|
|
175
|
+
|
|
176
|
+
# Download the sharp libs once to save time
|
|
177
|
+
# Do this before copying anything else in
|
|
178
|
+
RUN mkdir -p image-lambda-npms && \
|
|
179
|
+
cd image-lambda-npms && npm i sharp && \
|
|
180
|
+
rm -rf node_modules/sharp/vendor/*/include/
|
|
181
|
+
|
|
182
|
+
# Copy in the build output from `npx serverless`
|
|
183
|
+
COPY .serverless_nextjs .
|
|
184
|
+
COPY config.json .
|
|
185
|
+
|
|
186
|
+
# Move the sharp libs into place
|
|
187
|
+
RUN rm -rf image-lambda/node_modules/ && \
|
|
188
|
+
mv image-lambda-npms/node_modules image-labmda/ && \
|
|
189
|
+
rm -rf image-lambda-npms
|
|
190
|
+
|
|
191
|
+
|
|
192
|
+
|
|
193
|
+
FROM public.ecr.aws/lambda/nodejs:14 AS final
|
|
194
|
+
|
|
195
|
+
# Copy in the munged code
|
|
196
|
+
COPY --from=base /app .
|
|
197
|
+
|
|
198
|
+
CMD [ "./index.handler" ]
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
### next.config.js
|
|
202
|
+
|
|
203
|
+
Add this file to the root of the app.
|
|
204
|
+
|
|
205
|
+
Replace `appname` with your URL path-compatible application name.
|
|
206
|
+
|
|
207
|
+
```js
|
|
208
|
+
const appRoot = '/appname/0.0.0';
|
|
209
|
+
|
|
210
|
+
// eslint-disable-next-line no-undef
|
|
211
|
+
module.exports = {
|
|
212
|
+
target: 'serverless',
|
|
213
|
+
webpack: (config, _options) => {
|
|
214
|
+
return config;
|
|
215
|
+
},
|
|
216
|
+
basePath: appRoot,
|
|
217
|
+
publicRuntimeConfig: {
|
|
218
|
+
// Will be available on both server and client
|
|
219
|
+
staticFolder: appRoot,
|
|
220
|
+
},
|
|
221
|
+
};
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
### deploy.json
|
|
225
|
+
|
|
226
|
+
Add this file to the root of the app.
|
|
227
|
+
|
|
228
|
+
Replace `appname` with your URL path-compatible application name.
|
|
229
|
+
|
|
230
|
+
```json
|
|
231
|
+
{
|
|
232
|
+
"AppName": "appname",
|
|
233
|
+
"SemVer": "0.0.0",
|
|
234
|
+
"DefaultFile": "",
|
|
235
|
+
"StaticAssetsPath": "./.serverless_nextjs/assets/appname/0.0.0/",
|
|
236
|
+
"LambdaARN": "arn:aws:lambda:us-east-1:123456789012:function:appname:v0_0_0",
|
|
237
|
+
"AWSAccountID": "123456789012",
|
|
238
|
+
"AWSRegion": "us-east-2",
|
|
239
|
+
"ServerlessNextRouterPath": "./node_modules/@pwrdrvr/serverless-nextjs-router/dist/index.js"
|
|
240
|
+
}
|
|
241
|
+
```
|
|
242
|
+
|
|
243
|
+
### serverless.yaml
|
|
244
|
+
|
|
245
|
+
Add this file to the root of the app.
|
|
246
|
+
|
|
247
|
+
```yaml
|
|
248
|
+
nextApp:
|
|
249
|
+
component: './node_modules/@sls-next/serverless-component'
|
|
250
|
+
inputs:
|
|
251
|
+
deploy: false
|
|
252
|
+
uploadStaticAssetsFromBuild: false
|
|
253
|
+
```
|
package/lib/MicroApps.d.ts
CHANGED
|
@@ -7,77 +7,77 @@ import { IMicroAppsCF } from './MicroAppsCF';
|
|
|
7
7
|
import { IMicroAppsS3 } from './MicroAppsS3';
|
|
8
8
|
import { IMicroAppsSvcs } from './MicroAppsSvcs';
|
|
9
9
|
/**
|
|
10
|
-
* Properties to initialize an instance of `MicroApps`.
|
|
10
|
+
* (experimental) Properties to initialize an instance of `MicroApps`.
|
|
11
11
|
*
|
|
12
|
-
* @
|
|
12
|
+
* @experimental
|
|
13
13
|
*/
|
|
14
14
|
export interface MicroAppsProps {
|
|
15
15
|
/**
|
|
16
|
-
* RemovalPolicy override for child resources.
|
|
16
|
+
* (experimental) RemovalPolicy override for child resources.
|
|
17
17
|
*
|
|
18
18
|
* Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`
|
|
19
19
|
*
|
|
20
20
|
* @default - per resource default
|
|
21
|
-
* @
|
|
21
|
+
* @experimental
|
|
22
22
|
*/
|
|
23
23
|
readonly removalPolicy?: RemovalPolicy;
|
|
24
24
|
/**
|
|
25
|
-
* Passed to NODE_ENV of Router and Deployer Lambda functions.
|
|
25
|
+
* (experimental) Passed to NODE_ENV of Router and Deployer Lambda functions.
|
|
26
26
|
*
|
|
27
27
|
* @default dev
|
|
28
|
-
* @
|
|
28
|
+
* @experimental
|
|
29
29
|
*/
|
|
30
30
|
readonly appEnv: string;
|
|
31
31
|
/**
|
|
32
|
-
* Optional asset name root.
|
|
32
|
+
* (experimental) Optional asset name root.
|
|
33
33
|
*
|
|
34
34
|
* @default - resource names auto assigned
|
|
35
|
-
* @
|
|
35
|
+
* @experimental
|
|
36
36
|
* @example
|
|
37
37
|
*
|
|
38
38
|
* microapps
|
|
39
39
|
*/
|
|
40
40
|
readonly assetNameRoot?: string;
|
|
41
41
|
/**
|
|
42
|
-
* Optional asset name suffix.
|
|
42
|
+
* (experimental) Optional asset name suffix.
|
|
43
43
|
*
|
|
44
44
|
* @default none
|
|
45
|
-
* @
|
|
45
|
+
* @experimental
|
|
46
46
|
* @example
|
|
47
47
|
*
|
|
48
48
|
* -dev-pr-12
|
|
49
49
|
*/
|
|
50
50
|
readonly assetNameSuffix?: string;
|
|
51
51
|
/**
|
|
52
|
-
* Route53 zone in which to create optional `domainNameEdge` record.
|
|
52
|
+
* (experimental) Route53 zone in which to create optional `domainNameEdge` record.
|
|
53
53
|
*
|
|
54
|
-
* @
|
|
54
|
+
* @experimental
|
|
55
55
|
*/
|
|
56
56
|
readonly r53Zone?: r53.IHostedZone;
|
|
57
57
|
/**
|
|
58
|
-
* Certificate in US-East-1 for the CloudFront distribution.
|
|
58
|
+
* (experimental) Certificate in US-East-1 for the CloudFront distribution.
|
|
59
59
|
*
|
|
60
|
-
* @
|
|
60
|
+
* @experimental
|
|
61
61
|
*/
|
|
62
62
|
readonly certEdge?: acm.ICertificate;
|
|
63
63
|
/**
|
|
64
|
-
* Certificate in deployed region for the API Gateway.
|
|
64
|
+
* (experimental) Certificate in deployed region for the API Gateway.
|
|
65
65
|
*
|
|
66
|
-
* @
|
|
66
|
+
* @experimental
|
|
67
67
|
*/
|
|
68
68
|
readonly certOrigin?: acm.ICertificate;
|
|
69
69
|
/**
|
|
70
|
-
* 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.
|
|
70
|
+
* (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.
|
|
71
71
|
*
|
|
72
72
|
* This setting should be used when applications are less than
|
|
73
73
|
* fully trusted.
|
|
74
74
|
*
|
|
75
75
|
* @default false
|
|
76
|
-
* @
|
|
76
|
+
* @experimental
|
|
77
77
|
*/
|
|
78
78
|
readonly s3StrictBucketPolicy?: boolean;
|
|
79
79
|
/**
|
|
80
|
-
* Applies when using s3StrictBucketPolicy = true.
|
|
80
|
+
* (experimental) Applies when using s3StrictBucketPolicy = true.
|
|
81
81
|
*
|
|
82
82
|
* IAM Role or IAM User names to exclude from the DENY rules on the S3 Bucket Policy.
|
|
83
83
|
*
|
|
@@ -87,14 +87,14 @@ export interface MicroAppsProps {
|
|
|
87
87
|
* would be added to this list.
|
|
88
88
|
*
|
|
89
89
|
* @see s3PolicyBypassAROAs
|
|
90
|
-
* @
|
|
90
|
+
* @experimental
|
|
91
91
|
* @example
|
|
92
92
|
*
|
|
93
93
|
* ['arn:aws:iam::1234567890123:role/AdminAccess', 'arn:aws:iam::1234567890123:user/MyAdminUser']
|
|
94
94
|
*/
|
|
95
95
|
readonly s3PolicyBypassPrincipalARNs?: string[];
|
|
96
96
|
/**
|
|
97
|
-
* Applies when using s3StrictBucketPolicy = true.
|
|
97
|
+
* (experimental) Applies when using s3StrictBucketPolicy = true.
|
|
98
98
|
*
|
|
99
99
|
* AROAs of the IAM Role to exclude from the DENY rules on the S3 Bucket Policy.
|
|
100
100
|
* This allows sessions that assume the IAM Role to be excluded from the
|
|
@@ -131,43 +131,43 @@ export interface MicroAppsProps {
|
|
|
131
131
|
* aws iam get-user -–user-name USER-NAME
|
|
132
132
|
*
|
|
133
133
|
* @see s3StrictBucketPolicy
|
|
134
|
-
* @
|
|
134
|
+
* @experimental
|
|
135
135
|
* @example
|
|
136
136
|
*
|
|
137
137
|
* [ 'AROA1234567890123' ]
|
|
138
138
|
*/
|
|
139
139
|
readonly s3PolicyBypassAROAs?: string[];
|
|
140
140
|
/**
|
|
141
|
-
* Optional custom domain name for the CloudFront distribution.
|
|
141
|
+
* (experimental) Optional custom domain name for the CloudFront distribution.
|
|
142
142
|
*
|
|
143
143
|
* @default auto-assigned
|
|
144
|
-
* @
|
|
144
|
+
* @experimental
|
|
145
145
|
* @example
|
|
146
146
|
*
|
|
147
147
|
* apps.pwrdrvr.com
|
|
148
148
|
*/
|
|
149
149
|
readonly domainNameEdge?: string;
|
|
150
150
|
/**
|
|
151
|
-
* Optional custom domain name for the API Gateway HTTPv2 API.
|
|
151
|
+
* (experimental) Optional custom domain name for the API Gateway HTTPv2 API.
|
|
152
152
|
*
|
|
153
153
|
* @default auto-assigned
|
|
154
|
-
* @
|
|
154
|
+
* @experimental
|
|
155
155
|
* @example
|
|
156
156
|
*
|
|
157
157
|
* apps-origin.pwrdrvr.com
|
|
158
158
|
*/
|
|
159
159
|
readonly domainNameOrigin?: string;
|
|
160
160
|
/**
|
|
161
|
-
* Path prefix on the root of the CloudFront distribution.
|
|
161
|
+
* (experimental) Path prefix on the root of the CloudFront distribution.
|
|
162
162
|
*
|
|
163
|
-
* @
|
|
163
|
+
* @experimental
|
|
164
164
|
* @example
|
|
165
165
|
*
|
|
166
166
|
* dev/
|
|
167
167
|
*/
|
|
168
168
|
readonly rootPathPrefix?: string;
|
|
169
169
|
/**
|
|
170
|
-
* Create an extra Behavior (Route) for /api/ that allows API routes to have a period in them.
|
|
170
|
+
* (experimental) Create an extra Behavior (Route) for /api/ that allows API routes to have a period in them.
|
|
171
171
|
*
|
|
172
172
|
* When false API routes with a period in the path will get routed to S3.
|
|
173
173
|
*
|
|
@@ -175,43 +175,43 @@ export interface MicroAppsProps {
|
|
|
175
175
|
* even if they have a period in the path.
|
|
176
176
|
*
|
|
177
177
|
* @default true
|
|
178
|
-
* @
|
|
178
|
+
* @experimental
|
|
179
179
|
*/
|
|
180
180
|
readonly createAPIPathRoute?: boolean;
|
|
181
181
|
}
|
|
182
182
|
/**
|
|
183
|
-
* Represents a MicroApps.
|
|
183
|
+
* (experimental) Represents a MicroApps.
|
|
184
184
|
*
|
|
185
|
-
* @
|
|
185
|
+
* @experimental
|
|
186
186
|
*/
|
|
187
187
|
export interface IMicroApps {
|
|
188
188
|
/**
|
|
189
|
-
* {@inheritdoc IMicroAppsCF}.
|
|
189
|
+
* (experimental) {@inheritdoc IMicroAppsCF}.
|
|
190
190
|
*
|
|
191
|
-
* @
|
|
191
|
+
* @experimental
|
|
192
192
|
*/
|
|
193
193
|
readonly cf: IMicroAppsCF;
|
|
194
194
|
/**
|
|
195
|
-
* {@inheritdoc IMicroAppsS3}.
|
|
195
|
+
* (experimental) {@inheritdoc IMicroAppsS3}.
|
|
196
196
|
*
|
|
197
|
-
* @
|
|
197
|
+
* @experimental
|
|
198
198
|
*/
|
|
199
199
|
readonly s3: IMicroAppsS3;
|
|
200
200
|
/**
|
|
201
|
-
* {@inheritdoc IMicroAppsSvcs}.
|
|
201
|
+
* (experimental) {@inheritdoc IMicroAppsSvcs}.
|
|
202
202
|
*
|
|
203
|
-
* @
|
|
203
|
+
* @experimental
|
|
204
204
|
*/
|
|
205
205
|
readonly svcs: IMicroAppsSvcs;
|
|
206
206
|
/**
|
|
207
|
-
* {@inheritdoc IMicroAppsAPIGwy}.
|
|
207
|
+
* (experimental) {@inheritdoc IMicroAppsAPIGwy}.
|
|
208
208
|
*
|
|
209
|
-
* @
|
|
209
|
+
* @experimental
|
|
210
210
|
*/
|
|
211
211
|
readonly apigwy: IMicroAppsAPIGwy;
|
|
212
212
|
}
|
|
213
213
|
/**
|
|
214
|
-
* Create a new MicroApps "turnkey" construct for simple deployments and for initial evaulation of the MicroApps framework.
|
|
214
|
+
* (experimental) Create a new MicroApps "turnkey" construct for simple deployments and for initial evaulation of the MicroApps framework.
|
|
215
215
|
*
|
|
216
216
|
* Use this construct to create a working entire stack.
|
|
217
217
|
*
|
|
@@ -222,39 +222,39 @@ export interface IMicroApps {
|
|
|
222
222
|
* on API Gateway, etc.).
|
|
223
223
|
*
|
|
224
224
|
* @see {@link https://github.com/pwrdrvr/microapps-core/blob/main/packages/cdk/lib/MicroApps.ts | example usage in a CDK Stack }
|
|
225
|
-
* @
|
|
225
|
+
* @experimental
|
|
226
226
|
*/
|
|
227
227
|
export declare class MicroApps extends Construct implements IMicroApps {
|
|
228
228
|
private _cf;
|
|
229
229
|
/**
|
|
230
|
-
* {@inheritdoc IMicroAppsCF}.
|
|
230
|
+
* (experimental) {@inheritdoc IMicroAppsCF}.
|
|
231
231
|
*
|
|
232
|
-
* @
|
|
232
|
+
* @experimental
|
|
233
233
|
*/
|
|
234
234
|
get cf(): IMicroAppsCF;
|
|
235
235
|
private _s3;
|
|
236
236
|
/**
|
|
237
|
-
* {@inheritdoc IMicroAppsS3}.
|
|
237
|
+
* (experimental) {@inheritdoc IMicroAppsS3}.
|
|
238
238
|
*
|
|
239
|
-
* @
|
|
239
|
+
* @experimental
|
|
240
240
|
*/
|
|
241
241
|
get s3(): IMicroAppsS3;
|
|
242
242
|
private _apigwy;
|
|
243
243
|
/**
|
|
244
|
-
* {@inheritdoc IMicroAppsAPIGwy}.
|
|
244
|
+
* (experimental) {@inheritdoc IMicroAppsAPIGwy}.
|
|
245
245
|
*
|
|
246
|
-
* @
|
|
246
|
+
* @experimental
|
|
247
247
|
*/
|
|
248
248
|
get apigwy(): IMicroAppsAPIGwy;
|
|
249
249
|
private _svcs;
|
|
250
250
|
/**
|
|
251
|
-
* {@inheritdoc IMicroAppsSvcs}.
|
|
251
|
+
* (experimental) {@inheritdoc IMicroAppsSvcs}.
|
|
252
252
|
*
|
|
253
|
-
* @
|
|
253
|
+
* @experimental
|
|
254
254
|
*/
|
|
255
255
|
get svcs(): IMicroAppsSvcs;
|
|
256
256
|
/**
|
|
257
|
-
* @
|
|
257
|
+
* @experimental
|
|
258
258
|
*/
|
|
259
259
|
constructor(scope: Construct, id: string, props?: MicroAppsProps);
|
|
260
260
|
}
|