@pwrdrvr/microapps-cdk 0.3.2 → 0.3.4-rc1
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 +293 -156
- package/API.md +127 -49
- package/README.md +2 -0
- package/changelog.md +1 -1
- package/lib/MicroApps.d.ts +38 -4
- package/lib/MicroApps.d.ts.map +1 -1
- package/lib/MicroApps.js +30 -17
- package/lib/MicroAppsAPIGwy.js +1 -1
- package/lib/MicroAppsCF.d.ts +22 -11
- package/lib/MicroAppsCF.d.ts.map +1 -1
- package/lib/MicroAppsCF.js +27 -24
- package/lib/MicroAppsEdgeToOrigin.d.ts +6 -0
- package/lib/MicroAppsEdgeToOrigin.d.ts.map +1 -1
- package/lib/MicroAppsEdgeToOrigin.js +11 -7
- package/lib/MicroAppsS3.d.ts +9 -0
- package/lib/MicroAppsS3.d.ts.map +1 -1
- package/lib/MicroAppsS3.js +4 -3
- package/lib/MicroAppsSvcs.d.ts +1 -1
- package/lib/MicroAppsSvcs.d.ts.map +1 -1
- package/lib/MicroAppsSvcs.js +38 -34
- package/lib/MicroAppsTable.js +1 -1
- package/lib/microapps-deployer/index.js +61 -235
- package/lib/microapps-deployer/index.js.map +3 -3
- package/lib/microapps-edge-to-origin/index.js +43 -43
- package/lib/microapps-edge-to-origin/index.js.map +2 -2
- package/package.json +1 -1
- package/releasetag.txt +1 -1
- package/version.txt +1 -1
package/.jsii
CHANGED
|
@@ -3100,7 +3100,7 @@
|
|
|
3100
3100
|
},
|
|
3101
3101
|
"name": "@pwrdrvr/microapps-cdk",
|
|
3102
3102
|
"readme": {
|
|
3103
|
-
"markdown": "  \n\n# Overview\n\nThe 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.\n\nMicroApps 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).\n\nUsers 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.\n\nFor 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.\n\n# Table of Contents <!-- omit in toc -->\n\n- [Overview](#overview)\n- [Video Preview of the Deploying CDK Construct](#video-preview-of-the-deploying-cdk-construct)\n- [Installation / CDK Constructs](#installation--cdk-constructs)\n- [Tutorial - Bootstrapping a Deploy](#tutorial---bootstrapping-a-deploy)\n- [Why MicroApps](#why-microapps)\n- [Limitations / Future Development](#limitations--future-development)\n- [Related Projects / Components](#related-projects--components)\n- [Architecure Diagram](#architecure-diagram)\n- [Project Layout](#project-layout)\n- [Creating a MicroApp Using Zip Lambda Functions](#creating-a-microapp-using-zip-lambda-functions)\n- [Creating a MicroApp Using Docker Lambda Functions](#creating-a-microapp-using-docker-lambda-functions)\n - [Next.js Apps](#nextjs-apps)\n - [Modify package.json](#modify-packagejson)\n - [Install Dependencies](#install-dependencies)\n - [Dockerfile](#dockerfile)\n - [next.config.js](#nextconfigjs)\n - [deploy.json](#deployjson)\n - [serverless.yaml](#serverlessyaml)\n- [Troubleshooting](#troubleshooting)\n - [CloudFront Requests to API Gateway are Rejected with 403 Forbidden](#cloudfront-requests-to-api-gateway-are-rejected-with-403-forbidden)\n - [SignatureV4 Headers](#signaturev4-headers)\n\n# Video Preview of the Deploying CDK Construct\n\n\n\n# Installation / CDK Constructs\n\n- `npm i --save-dev @pwrdrvr/microapps-cdk`\n- Add `MicroApps` construct to your stack\n- The `MicroApps` construct does a \"turn-key\" deployment complete with the Release app\n- [Construct Hub](https://constructs.dev/packages/@pwrdrvr/microapps-cdk/)\n - CDK API docs\n - Python, DotNet, Java, JS/TS installation instructions\n\n# Tutorial - Bootstrapping a Deploy\n\n- `git clone https://github.com/pwrdrvr/microapps-core.git`\n - Note: the repo is only being for the example CDK Stack, it is not necessary to clone the repo when used in a custom CDK Stack\n- `cd microapps-core`\n- `npm i -g aws-cdk`\n - Install AWS CDK v2 CLI\n- `asp [my-sso-profile-name]`\n - Using the `aws` plugin from `oh-my-zsh` for AWS SSO\n - Of course, there are other methods of setting env vars\n- `aws sso login`\n - Establish an AWS SSO session\n- `cdk-sso-sync`\n - Using `npm i -g cdk-sso-sync`\n - Sets AWS SSO credentials in a way that CDK can use them\n - Not necessary if not using AWS SSO\n- `export AWS_REGION=us-east-2`\n - Region needs to be set for the Lambda invoke - This can be done other ways in `~/.aws/config` as well\n- `./deploy.sh`\n - Deploys the CDK Stack\n - Essentially runs two commands along with extraction of outputs:\n - `npx cdk deploy --context @pwrdrvr/microapps:deployReleaseApp=true microapps-basic`\n - `npx microapps-publish publish -a release -n ${RELEASE_APP_PACKAGE_VERSION} -d ${DEPLOYER_LAMBDA_NAME} -l ${RELEASE_APP_LAMBDA_NAME} -s node_modules/@pwrdrvr/microapps-app-release-cdk/lib/.static_files/release/${RELEASE_APP_PACKAGE_VERSION}/ --overwrite --noCache`\n - URL will be printed as last output\n\n# Why MicroApps\n\nMicroApps 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.\n\nTeams 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).\n\nMicroApps 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.\n\nFor 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.\n\n# Limitations / Future Development\n\n- `iframes`\n - Yeah, yeah: `iframes` are not framesets and most of the hate about iframes is probably better directed at framesets\n - The iframe serves a purpose but it stinks that it is there, primarily because it will cause issues with search bot indexing (SEO)\n - There are other options available to implement that have their own drabacks:\n - 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\n - Works only with frameworks that support hashing filenams for each deploy to unique names\n - This page would need to be marked as non-cachable\n - 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)\n - 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}`\n - 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\n - HTML5 added features to allow setting the relative path of all subsequent requests to be different than that displayed in the address bar\n - Gotta see if this works in modern browsers\n - Option to ditch the multiple-versions feature\n - Works only with frameworks that support hashing filenams for each deploy to unique names\n - Allows usage of the deploy and routing tooling without advantages and disadvantages of multiple-versions support\n- AWS Only\n - For the time being this has only been implemented for AWS technologies and APIs\n - It is possible that Azure and GCP have sufficient support to enable porting the framework\n - CDK would have to be replaced as well (unless it's made available for Azure and GCP in the near future)\n- `microapps-publish` only supports Lambda function apps\n - There is no technical reason for the apps to only run as Lambda functions\n - Web apps could just as easily run on EC2, Kubernetes, EKS, ECS, etc\n - Anything that API Gateway can route to can work for serving a MicroApp\n - The publish tool needs to provide additional options for setting up the API Gateway route to the app\n- Authentication\n - Authentication requires rolling your own API Gateway and CloudFront deployment at the moment\n - The \"turn key\" CDK Construct should provide options to show an example of how authentication can be integrated\n- Release Rules\n - Currently only a Default rule is supported\n - Need to evaluate if a generic implementation can be made, possibly allowing plugins or webhooks to support arbitrary rules\n - If not possible to make it perfectly generic, consider providing a more complete reference implementation of examples\n\n# Related Projects / Components\n\n- Release App\n - The Release app is an initial, rudimentary, release control console for setting the default version of an application\n - Built with Next.js\n - [pwrdrvr/microapps-app-release](https://github.com/pwrdrvr/microapps-app-release)\n- Next.js Demo App\n - The Next.js Tutorial application deployed as a MicroApp\n - [pwrdrvr/serverless-nextjs-demo](https://github.com/pwrdrvr/serverless-nextjs-demo)\n- Serverless Next.js Router\n - [pwrdrvr/serverless-nextjs-router](https://github.com/pwrdrvr/serverless-nextjs-router)\n - Complementary to [@sls-next/serverless-component](https://github.com/serverless-nextjs/serverless-next.js)\n - Allows Next.js apps to run as Lambda @ Origin for speed and cost improvements vs Lambda@Edge\n - Essentially the router translates CloudFront Lambda events to API Gateway Lambda events and vice versa for responses\n - 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)\n - Lambda@Edge is _at least_ 3x more expensive than Lambda at the origin:\n - In US East 1, the price per GB-Second is $0.00005001 for Lambda@Edge vs $0.0000166667 for Lambda at the origin\n - 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:\n - Lambda@Edge\n - 0.250s Round Trip Time (RTT) for EU-zone edge request to hit US-East 1 Origin\n - 0.200s DB lookup time\n - 0.050s CPU usage to process the DB response\n - 0.500s total billed time @ $0.00005001 @ 128 MB\n - $0.000003125625 total charge\n - Lambda at Origin\n - RTT does not apply (it's effectively 1-2 ms to hit a DB in the same region)\n - 0.200s DB lookup time\n - 0.050s CPU usage to process the DB response\n - 0.250s total billed time @ $0.0000166667 @ 128 MB\n - Half the billed time of running on Lambda@Edge\n - 1/6th the cost of running on Lambda@Edge:\n - $0.000000520834375 total charge (assuming no CPU time to process the response)\n - $0.000003125625 / $0.000000520834375 = 6x more expensive in Lambda@Edge\n\n# Architecure Diagram\n\n\n\n# Project Layout\n\n- [packages/cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/cdk)\n - Example CDK Stack\n - Deploys MicroApps CDK stack for the GitHub Workflows\n - Can be used as an example of how to use the MicroApps CDK Construct\n- [packages/demo-app](https://github.com/pwrdrvr/microapps-core/tree/main/packages/demo-app)\n - Example app with static resources and a Lambda function\n - Does not use any Web UI framework at all\n- [packages/microapps-cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-cdk)\n - MicroApps\n - \"Turn key\" CDK Construct that creates all assets needed for a working MicroApps deployment\n - MicroAppsAPIGwy\n - Create APIGateway HTTP API\n - Creates domain names to point to the edge (Cloudfront) and origin (API Gateway)\n - MicroAppsCF\n - Creates Cloudfront distribution\n - MicroAppsS3\n - Creates S3 buckets\n - MicroAppsSvcs\n - Create DynamoDB table\n - Create Deployer Lambda function\n - Create Router Lambda function\n- [packages/microapps-datalib](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-datalib)\n - Installed from `npm`:\n - `npm i -g @pwrdrvr/microapps-datalib`\n - APIs for access to the DynamoDB Table used by `microapps-publish`, `microapps-deployer`, and `@pwrdrvr/microapps-app-release-cdk`\n- [packages/microapps-deployer](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-deployer)\n - 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.\n - Returns a temporary S3 token with restricted access to the staging S3 bucket for upload of the static files for one app/semver\n- [packages/microapps-publish](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-publish)\n - Installed from `npm`:\n - `npm i -g @pwrdrvr/microapps-publish`\n - 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`\n - AWS IAM permissions required:\n - `lambda:InvokeFunction`\n- [packages/microapps-router](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-router)\n - Lambda function that determines which version of an app to point a user to on a particular invocation\n\n# Creating a MicroApp Using Zip Lambda Functions\n\n[TBC]\n\n# Creating a MicroApp Using Docker Lambda Functions\n\nNote: semi-deprecated as of 2022-01-27. Zip Lambda functions are better supported.\n\n## Next.js Apps\n\nCreate 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.\n\n### Modify package.json\n\nReplace the version with `0.0.0` so it can be modified by the `microapps-publish` tool.\n\n### Install Dependencies\n\n```\nnpm i --save-dev @sls-next/serverless-component@1.19.0 @pwrdrvr/serverless-nextjs-router @pwrdrvr/microapps-publish\n```\n\n### Dockerfile\n\nAdd this file to the root of the app.\n\n```Dockerfile\nFROM node:15-slim as base\n\nWORKDIR /app\n\n# Download the sharp libs once to save time\n# Do this before copying anything else in\nRUN mkdir -p image-lambda-npms && \\\n cd image-lambda-npms && npm i sharp && \\\n rm -rf node_modules/sharp/vendor/*/include/\n\n# Copy in the build output from `npx serverless`\nCOPY .serverless_nextjs .\nCOPY config.json .\n\n# Move the sharp libs into place\nRUN rm -rf image-lambda/node_modules/ && \\\n mv image-lambda-npms/node_modules image-labmda/ && \\\n rm -rf image-lambda-npms\n\nFROM public.ecr.aws/lambda/nodejs:14 AS final\n\n# Copy in the munged code\nCOPY --from=base /app .\n\nCMD [ \"./index.handler\" ]\n```\n\n### next.config.js\n\nAdd this file to the root of the app.\n\nReplace `appname` with your URL path-compatible application name.\n\n```js\nconst appRoot = '/appname/0.0.0';\n\n// eslint-disable-next-line no-undef\nmodule.exports = {\n target: 'serverless',\n webpack: (config, _options) => {\n return config;\n },\n basePath: appRoot,\n publicRuntimeConfig: {\n // Will be available on both server and client\n staticFolder: appRoot,\n },\n};\n```\n\n### deploy.json\n\nAdd this file to the root of the app.\n\nReplace `appname` with your URL path-compatible application name.\n\n```json\n{\n \"AppName\": \"appname\",\n \"SemVer\": \"0.0.0\",\n \"DefaultFile\": \"\",\n \"StaticAssetsPath\": \"./.serverless_nextjs/assets/appname/0.0.0/\",\n \"LambdaARN\": \"arn:aws:lambda:us-east-1:123456789012:function:appname:v0_0_0\",\n \"AWSAccountID\": \"123456789012\",\n \"AWSRegion\": \"us-east-2\",\n \"ServerlessNextRouterPath\": \"./node_modules/@pwrdrvr/serverless-nextjs-router/dist/index.js\"\n}\n```\n\n### serverless.yaml\n\nAdd this file to the root of the app.\n\n```yaml\nnextApp:\n component: './node_modules/@sls-next/serverless-component'\n inputs:\n deploy: false\n uploadStaticAssetsFromBuild: false\n```\n\n# Troubleshooting\n\n## CloudFront Requests to API Gateway are Rejected with 403 Forbidden\n\nRequests to the API Gateway origin can be rejected with a 403 Forbidden error if the signed request headers are not sent to the origin by CloudFront.\n\nThe error in the API Gateway CloudWatch logs will show up as:\n\n```log\n\"authorizerError\": \"The request for the IAM Authorizer doesn't match the format that API Gateway expects.\"\n```\n\nThis can be simulated by simply running `curl [api-gateway-url]`, with no headers.\n\nTo confirm that API Gateway is allowing signed requests when the IAM Authorizer is configured, establish credentials as a user that is allowed to execute the API Gateay, install `awscurl` with `pip3 install awscurl`, then then use `awscurl --service execute-api --region [api-gateway-region] [api-gateway-url]`.\n\nSignature headers will not be sent from CloudFront to API Gateway unless the `OriginRequestPolicy` is set to specifically include those headers on requests to the origin, or the `headersBehavior` is set to `cfront.OriginRequestHeaderBehavior.all()`.\n\nSimilarly, if `presign` is used, the `OriginRequestPolicy` must be set to `cfront.OriginRequestQueryStringBehavior.all()` or to specifically forward the query string parameters used by the presigned URL.\n\n### SignatureV4 Headers\n- `authorization`\n- `x-amz-date`\n- `x-amz-security-token`\n- `x-amz-content-sha256`"
|
|
3103
|
+
"markdown": "  \n\n# Overview\n\nThe 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.\n\nMicroApps 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).\n\n2023-01-01 NOTE: The next paragraph is dated as the `iframe` is no longer required for frameworks that write absolute URLs for their static resources and API requests.\n\nUsers 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.\n\nFor 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.\n\n# Table of Contents <!-- omit in toc -->\n\n- [Overview](#overview)\n- [Video Preview of the Deploying CDK Construct](#video-preview-of-the-deploying-cdk-construct)\n- [Installation / CDK Constructs](#installation--cdk-constructs)\n- [Tutorial - Bootstrapping a Deploy](#tutorial---bootstrapping-a-deploy)\n- [Why MicroApps](#why-microapps)\n- [Limitations / Future Development](#limitations--future-development)\n- [Related Projects / Components](#related-projects--components)\n- [Architecure Diagram](#architecure-diagram)\n- [Project Layout](#project-layout)\n- [Creating a MicroApp Using Zip Lambda Functions](#creating-a-microapp-using-zip-lambda-functions)\n- [Creating a MicroApp Using Docker Lambda Functions](#creating-a-microapp-using-docker-lambda-functions)\n - [Next.js Apps](#nextjs-apps)\n - [Modify package.json](#modify-packagejson)\n - [Install Dependencies](#install-dependencies)\n - [Dockerfile](#dockerfile)\n - [next.config.js](#nextconfigjs)\n - [deploy.json](#deployjson)\n - [serverless.yaml](#serverlessyaml)\n- [Troubleshooting](#troubleshooting)\n - [CloudFront Requests to API Gateway are Rejected with 403 Forbidden](#cloudfront-requests-to-api-gateway-are-rejected-with-403-forbidden)\n - [SignatureV4 Headers](#signaturev4-headers)\n\n# Video Preview of the Deploying CDK Construct\n\n\n\n# Installation / CDK Constructs\n\n- `npm i --save-dev @pwrdrvr/microapps-cdk`\n- Add `MicroApps` construct to your stack\n- The `MicroApps` construct does a \"turn-key\" deployment complete with the Release app\n- [Construct Hub](https://constructs.dev/packages/@pwrdrvr/microapps-cdk/)\n - CDK API docs\n - Python, DotNet, Java, JS/TS installation instructions\n\n# Tutorial - Bootstrapping a Deploy\n\n- `git clone https://github.com/pwrdrvr/microapps-core.git`\n - Note: the repo is only being for the example CDK Stack, it is not necessary to clone the repo when used in a custom CDK Stack\n- `cd microapps-core`\n- `npm i -g aws-cdk`\n - Install AWS CDK v2 CLI\n- `asp [my-sso-profile-name]`\n - Using the `aws` plugin from `oh-my-zsh` for AWS SSO\n - Of course, there are other methods of setting env vars\n- `aws sso login`\n - Establish an AWS SSO session\n- `cdk-sso-sync`\n - Using `npm i -g cdk-sso-sync`\n - Sets AWS SSO credentials in a way that CDK can use them\n - Not necessary if not using AWS SSO\n- `export AWS_REGION=us-east-2`\n - Region needs to be set for the Lambda invoke - This can be done other ways in `~/.aws/config` as well\n- `./deploy.sh`\n - Deploys the CDK Stack\n - Essentially runs two commands along with extraction of outputs:\n - `npx cdk deploy --context @pwrdrvr/microapps:deployReleaseApp=true microapps-basic`\n - `npx microapps-publish publish -a release -n ${RELEASE_APP_PACKAGE_VERSION} -d ${DEPLOYER_LAMBDA_NAME} -l ${RELEASE_APP_LAMBDA_NAME} -s node_modules/@pwrdrvr/microapps-app-release-cdk/lib/.static_files/release/${RELEASE_APP_PACKAGE_VERSION}/ --overwrite --noCache`\n - URL will be printed as last output\n\n# Why MicroApps\n\nMicroApps 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.\n\nTeams 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).\n\nMicroApps 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.\n\nFor 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.\n\n# Limitations / Future Development\n\n- `iframes`\n - Yeah, yeah: `iframes` are not framesets and most of the hate about iframes is probably better directed at framesets\n - The iframe serves a purpose but it stinks that it is there, primarily because it will cause issues with search bot indexing (SEO)\n - There are other options available to implement that have their own drabacks:\n - 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\n - Works only with frameworks that support hashing filenams for each deploy to unique names\n - This page would need to be marked as non-cachable\n - 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)\n - 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}`\n - 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\n - HTML5 added features to allow setting the relative path of all subsequent requests to be different than that displayed in the address bar\n - Gotta see if this works in modern browsers\n - Option to ditch the multiple-versions feature\n - Works only with frameworks that support hashing filenams for each deploy to unique names\n - Allows usage of the deploy and routing tooling without advantages and disadvantages of multiple-versions support\n- AWS Only\n - For the time being this has only been implemented for AWS technologies and APIs\n - It is possible that Azure and GCP have sufficient support to enable porting the framework\n - CDK would have to be replaced as well (unless it's made available for Azure and GCP in the near future)\n- `microapps-publish` only supports Lambda function apps\n - There is no technical reason for the apps to only run as Lambda functions\n - Web apps could just as easily run on EC2, Kubernetes, EKS, ECS, etc\n - Anything that API Gateway can route to can work for serving a MicroApp\n - The publish tool needs to provide additional options for setting up the API Gateway route to the app\n- Authentication\n - Authentication requires rolling your own API Gateway and CloudFront deployment at the moment\n - The \"turn key\" CDK Construct should provide options to show an example of how authentication can be integrated\n- Release Rules\n - Currently only a Default rule is supported\n - Need to evaluate if a generic implementation can be made, possibly allowing plugins or webhooks to support arbitrary rules\n - If not possible to make it perfectly generic, consider providing a more complete reference implementation of examples\n\n# Related Projects / Components\n\n- Release App\n - The Release app is an initial, rudimentary, release control console for setting the default version of an application\n - Built with Next.js\n - [pwrdrvr/microapps-app-release](https://github.com/pwrdrvr/microapps-app-release)\n- Next.js Demo App\n - The Next.js Tutorial application deployed as a MicroApp\n - [pwrdrvr/serverless-nextjs-demo](https://github.com/pwrdrvr/serverless-nextjs-demo)\n- Serverless Next.js Router\n - [pwrdrvr/serverless-nextjs-router](https://github.com/pwrdrvr/serverless-nextjs-router)\n - Complementary to [@sls-next/serverless-component](https://github.com/serverless-nextjs/serverless-next.js)\n - Allows Next.js apps to run as Lambda @ Origin for speed and cost improvements vs Lambda@Edge\n - Essentially the router translates CloudFront Lambda events to API Gateway Lambda events and vice versa for responses\n - 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)\n - Lambda@Edge is _at least_ 3x more expensive than Lambda at the origin:\n - In US East 1, the price per GB-Second is $0.00005001 for Lambda@Edge vs $0.0000166667 for Lambda at the origin\n - 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:\n - Lambda@Edge\n - 0.250s Round Trip Time (RTT) for EU-zone edge request to hit US-East 1 Origin\n - 0.200s DB lookup time\n - 0.050s CPU usage to process the DB response\n - 0.500s total billed time @ $0.00005001 @ 128 MB\n - $0.000003125625 total charge\n - Lambda at Origin\n - RTT does not apply (it's effectively 1-2 ms to hit a DB in the same region)\n - 0.200s DB lookup time\n - 0.050s CPU usage to process the DB response\n - 0.250s total billed time @ $0.0000166667 @ 128 MB\n - Half the billed time of running on Lambda@Edge\n - 1/6th the cost of running on Lambda@Edge:\n - $0.000000520834375 total charge (assuming no CPU time to process the response)\n - $0.000003125625 / $0.000000520834375 = 6x more expensive in Lambda@Edge\n\n# Architecure Diagram\n\n\n\n# Project Layout\n\n- [packages/cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/cdk)\n - Example CDK Stack\n - Deploys MicroApps CDK stack for the GitHub Workflows\n - Can be used as an example of how to use the MicroApps CDK Construct\n- [packages/demo-app](https://github.com/pwrdrvr/microapps-core/tree/main/packages/demo-app)\n - Example app with static resources and a Lambda function\n - Does not use any Web UI framework at all\n- [packages/microapps-cdk](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-cdk)\n - MicroApps\n - \"Turn key\" CDK Construct that creates all assets needed for a working MicroApps deployment\n - MicroAppsAPIGwy\n - Create APIGateway HTTP API\n - Creates domain names to point to the edge (Cloudfront) and origin (API Gateway)\n - MicroAppsCF\n - Creates Cloudfront distribution\n - MicroAppsS3\n - Creates S3 buckets\n - MicroAppsSvcs\n - Create DynamoDB table\n - Create Deployer Lambda function\n - Create Router Lambda function\n- [packages/microapps-datalib](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-datalib)\n - Installed from `npm`:\n - `npm i -g @pwrdrvr/microapps-datalib`\n - APIs for access to the DynamoDB Table used by `microapps-publish`, `microapps-deployer`, and `@pwrdrvr/microapps-app-release-cdk`\n- [packages/microapps-deployer](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-deployer)\n - 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.\n - Returns a temporary S3 token with restricted access to the staging S3 bucket for upload of the static files for one app/semver\n- [packages/microapps-publish](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-publish)\n - Installed from `npm`:\n - `npm i -g @pwrdrvr/microapps-publish`\n - 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`\n - AWS IAM permissions required:\n - `lambda:InvokeFunction`\n- [packages/microapps-router](https://github.com/pwrdrvr/microapps-core/tree/main/packages/microapps-router)\n - Lambda function that determines which version of an app to point a user to on a particular invocation\n\n# Creating a MicroApp Using Zip Lambda Functions\n\n[TBC]\n\n# Creating a MicroApp Using Docker Lambda Functions\n\nNote: semi-deprecated as of 2022-01-27. Zip Lambda functions are better supported.\n\n## Next.js Apps\n\nCreate 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.\n\n### Modify package.json\n\nReplace the version with `0.0.0` so it can be modified by the `microapps-publish` tool.\n\n### Install Dependencies\n\n```\nnpm i --save-dev @sls-next/serverless-component@1.19.0 @pwrdrvr/serverless-nextjs-router @pwrdrvr/microapps-publish\n```\n\n### Dockerfile\n\nAdd this file to the root of the app.\n\n```Dockerfile\nFROM node:15-slim as base\n\nWORKDIR /app\n\n# Download the sharp libs once to save time\n# Do this before copying anything else in\nRUN mkdir -p image-lambda-npms && \\\n cd image-lambda-npms && npm i sharp && \\\n rm -rf node_modules/sharp/vendor/*/include/\n\n# Copy in the build output from `npx serverless`\nCOPY .serverless_nextjs .\nCOPY config.json .\n\n# Move the sharp libs into place\nRUN rm -rf image-lambda/node_modules/ && \\\n mv image-lambda-npms/node_modules image-labmda/ && \\\n rm -rf image-lambda-npms\n\nFROM public.ecr.aws/lambda/nodejs:14 AS final\n\n# Copy in the munged code\nCOPY --from=base /app .\n\nCMD [ \"./index.handler\" ]\n```\n\n### next.config.js\n\nAdd this file to the root of the app.\n\nReplace `appname` with your URL path-compatible application name.\n\n```js\nconst appRoot = '/appname/0.0.0';\n\n// eslint-disable-next-line no-undef\nmodule.exports = {\n target: 'serverless',\n webpack: (config, _options) => {\n return config;\n },\n basePath: appRoot,\n publicRuntimeConfig: {\n // Will be available on both server and client\n staticFolder: appRoot,\n },\n};\n```\n\n### deploy.json\n\nAdd this file to the root of the app.\n\nReplace `appname` with your URL path-compatible application name.\n\n```json\n{\n \"AppName\": \"appname\",\n \"SemVer\": \"0.0.0\",\n \"DefaultFile\": \"\",\n \"StaticAssetsPath\": \"./.serverless_nextjs/assets/appname/0.0.0/\",\n \"LambdaARN\": \"arn:aws:lambda:us-east-1:123456789012:function:appname:v0_0_0\",\n \"AWSAccountID\": \"123456789012\",\n \"AWSRegion\": \"us-east-2\",\n \"ServerlessNextRouterPath\": \"./node_modules/@pwrdrvr/serverless-nextjs-router/dist/index.js\"\n}\n```\n\n### serverless.yaml\n\nAdd this file to the root of the app.\n\n```yaml\nnextApp:\n component: './node_modules/@sls-next/serverless-component'\n inputs:\n deploy: false\n uploadStaticAssetsFromBuild: false\n```\n\n# Troubleshooting\n\n## CloudFront Requests to API Gateway are Rejected with 403 Forbidden\n\nRequests to the API Gateway origin can be rejected with a 403 Forbidden error if the signed request headers are not sent to the origin by CloudFront.\n\nThe error in the API Gateway CloudWatch logs will show up as:\n\n```log\n\"authorizerError\": \"The request for the IAM Authorizer doesn't match the format that API Gateway expects.\"\n```\n\nThis can be simulated by simply running `curl [api-gateway-url]`, with no headers.\n\nTo confirm that API Gateway is allowing signed requests when the IAM Authorizer is configured, establish credentials as a user that is allowed to execute the API Gateay, install `awscurl` with `pip3 install awscurl`, then then use `awscurl --service execute-api --region [api-gateway-region] [api-gateway-url]`.\n\nSignature headers will not be sent from CloudFront to API Gateway unless the `OriginRequestPolicy` is set to specifically include those headers on requests to the origin, or the `headersBehavior` is set to `cfront.OriginRequestHeaderBehavior.all()`.\n\nSimilarly, if `presign` is used, the `OriginRequestPolicy` must be set to `cfront.OriginRequestQueryStringBehavior.all()` or to specifically forward the query string parameters used by the presigned URL.\n\n### SignatureV4 Headers\n- `authorization`\n- `x-amz-date`\n- `x-amz-security-token`\n- `x-amz-content-sha256`"
|
|
3104
3104
|
},
|
|
3105
3105
|
"repository": {
|
|
3106
3106
|
"type": "git",
|
|
@@ -3139,22 +3139,23 @@
|
|
|
3139
3139
|
"kind": "interface",
|
|
3140
3140
|
"locationInModule": {
|
|
3141
3141
|
"filename": "src/MicroAppsCF.ts",
|
|
3142
|
-
"line":
|
|
3142
|
+
"line": 177
|
|
3143
3143
|
},
|
|
3144
3144
|
"name": "AddRoutesOptions",
|
|
3145
3145
|
"properties": [
|
|
3146
3146
|
{
|
|
3147
3147
|
"abstract": true,
|
|
3148
3148
|
"docs": {
|
|
3149
|
+
"default": "invalid URL (never used)",
|
|
3149
3150
|
"stability": "experimental",
|
|
3150
|
-
"summary": "
|
|
3151
|
+
"summary": "Default origin (invalid URL or API Gateway)."
|
|
3151
3152
|
},
|
|
3152
3153
|
"immutable": true,
|
|
3153
3154
|
"locationInModule": {
|
|
3154
3155
|
"filename": "src/MicroAppsCF.ts",
|
|
3155
|
-
"line":
|
|
3156
|
+
"line": 183
|
|
3156
3157
|
},
|
|
3157
|
-
"name": "
|
|
3158
|
+
"name": "appOrigin",
|
|
3158
3159
|
"type": {
|
|
3159
3160
|
"fqn": "aws-cdk-lib.aws_cloudfront.IOrigin"
|
|
3160
3161
|
}
|
|
@@ -3168,9 +3169,9 @@
|
|
|
3168
3169
|
"immutable": true,
|
|
3169
3170
|
"locationInModule": {
|
|
3170
3171
|
"filename": "src/MicroAppsCF.ts",
|
|
3171
|
-
"line":
|
|
3172
|
+
"line": 198
|
|
3172
3173
|
},
|
|
3173
|
-
"name": "
|
|
3174
|
+
"name": "appOriginRequestPolicy",
|
|
3174
3175
|
"type": {
|
|
3175
3176
|
"fqn": "aws-cdk-lib.aws_cloudfront.IOriginRequestPolicy"
|
|
3176
3177
|
}
|
|
@@ -3184,7 +3185,7 @@
|
|
|
3184
3185
|
"immutable": true,
|
|
3185
3186
|
"locationInModule": {
|
|
3186
3187
|
"filename": "src/MicroAppsCF.ts",
|
|
3187
|
-
"line":
|
|
3188
|
+
"line": 188
|
|
3188
3189
|
},
|
|
3189
3190
|
"name": "bucketAppsOrigin",
|
|
3190
3191
|
"type": {
|
|
@@ -3200,7 +3201,7 @@
|
|
|
3200
3201
|
"immutable": true,
|
|
3201
3202
|
"locationInModule": {
|
|
3202
3203
|
"filename": "src/MicroAppsCF.ts",
|
|
3203
|
-
"line":
|
|
3204
|
+
"line": 193
|
|
3204
3205
|
},
|
|
3205
3206
|
"name": "distro",
|
|
3206
3207
|
"type": {
|
|
@@ -3210,39 +3211,36 @@
|
|
|
3210
3211
|
{
|
|
3211
3212
|
"abstract": true,
|
|
3212
3213
|
"docs": {
|
|
3214
|
+
"default": "false",
|
|
3215
|
+
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /api/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
3213
3216
|
"stability": "experimental",
|
|
3214
|
-
"summary": "
|
|
3217
|
+
"summary": "Create an extra Behavior (Route) for /api/ that allows API routes to have a period in them."
|
|
3215
3218
|
},
|
|
3216
3219
|
"immutable": true,
|
|
3217
3220
|
"locationInModule": {
|
|
3218
3221
|
"filename": "src/MicroAppsCF.ts",
|
|
3219
|
-
"line":
|
|
3222
|
+
"line": 218
|
|
3220
3223
|
},
|
|
3221
|
-
"name": "
|
|
3224
|
+
"name": "createAPIPathRoute",
|
|
3222
3225
|
"optional": true,
|
|
3223
3226
|
"type": {
|
|
3224
|
-
"
|
|
3225
|
-
"elementtype": {
|
|
3226
|
-
"fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
|
|
3227
|
-
},
|
|
3228
|
-
"kind": "array"
|
|
3229
|
-
}
|
|
3227
|
+
"primitive": "boolean"
|
|
3230
3228
|
}
|
|
3231
3229
|
},
|
|
3232
3230
|
{
|
|
3233
3231
|
"abstract": true,
|
|
3234
3232
|
"docs": {
|
|
3235
|
-
"default": "
|
|
3236
|
-
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /
|
|
3233
|
+
"default": "false",
|
|
3234
|
+
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /_next/data/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
3237
3235
|
"stability": "experimental",
|
|
3238
|
-
"summary": "Create an extra Behavior (Route) for /
|
|
3236
|
+
"summary": "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."
|
|
3239
3237
|
},
|
|
3240
3238
|
"immutable": true,
|
|
3241
3239
|
"locationInModule": {
|
|
3242
3240
|
"filename": "src/MicroAppsCF.ts",
|
|
3243
|
-
"line":
|
|
3241
|
+
"line": 233
|
|
3244
3242
|
},
|
|
3245
|
-
"name": "
|
|
3243
|
+
"name": "createNextDataPathRoute",
|
|
3246
3244
|
"optional": true,
|
|
3247
3245
|
"type": {
|
|
3248
3246
|
"primitive": "boolean"
|
|
@@ -3251,20 +3249,23 @@
|
|
|
3251
3249
|
{
|
|
3252
3250
|
"abstract": true,
|
|
3253
3251
|
"docs": {
|
|
3254
|
-
"default": "true",
|
|
3255
|
-
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /_next/data/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
3256
3252
|
"stability": "experimental",
|
|
3257
|
-
"summary": "
|
|
3253
|
+
"summary": "Edge lambdas to associate with the API Gateway routes."
|
|
3258
3254
|
},
|
|
3259
3255
|
"immutable": true,
|
|
3260
3256
|
"locationInModule": {
|
|
3261
3257
|
"filename": "src/MicroAppsCF.ts",
|
|
3262
|
-
"line":
|
|
3258
|
+
"line": 238
|
|
3263
3259
|
},
|
|
3264
|
-
"name": "
|
|
3260
|
+
"name": "edgeLambdas",
|
|
3265
3261
|
"optional": true,
|
|
3266
3262
|
"type": {
|
|
3267
|
-
"
|
|
3263
|
+
"collection": {
|
|
3264
|
+
"elementtype": {
|
|
3265
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
|
|
3266
|
+
},
|
|
3267
|
+
"kind": "array"
|
|
3268
|
+
}
|
|
3268
3269
|
}
|
|
3269
3270
|
},
|
|
3270
3271
|
{
|
|
@@ -3277,7 +3278,7 @@
|
|
|
3277
3278
|
"immutable": true,
|
|
3278
3279
|
"locationInModule": {
|
|
3279
3280
|
"filename": "src/MicroAppsCF.ts",
|
|
3280
|
-
"line":
|
|
3281
|
+
"line": 205
|
|
3281
3282
|
},
|
|
3282
3283
|
"name": "rootPathPrefix",
|
|
3283
3284
|
"optional": true,
|
|
@@ -3299,7 +3300,7 @@
|
|
|
3299
3300
|
"kind": "interface",
|
|
3300
3301
|
"locationInModule": {
|
|
3301
3302
|
"filename": "src/MicroAppsCF.ts",
|
|
3302
|
-
"line":
|
|
3303
|
+
"line": 149
|
|
3303
3304
|
},
|
|
3304
3305
|
"name": "CreateAPIOriginPolicyOptions",
|
|
3305
3306
|
"properties": [
|
|
@@ -3314,7 +3315,7 @@
|
|
|
3314
3315
|
"immutable": true,
|
|
3315
3316
|
"locationInModule": {
|
|
3316
3317
|
"filename": "src/MicroAppsCF.ts",
|
|
3317
|
-
"line":
|
|
3318
|
+
"line": 156
|
|
3318
3319
|
},
|
|
3319
3320
|
"name": "assetNameRoot",
|
|
3320
3321
|
"optional": true,
|
|
@@ -3333,7 +3334,7 @@
|
|
|
3333
3334
|
"immutable": true,
|
|
3334
3335
|
"locationInModule": {
|
|
3335
3336
|
"filename": "src/MicroAppsCF.ts",
|
|
3336
|
-
"line":
|
|
3337
|
+
"line": 164
|
|
3337
3338
|
},
|
|
3338
3339
|
"name": "assetNameSuffix",
|
|
3339
3340
|
"optional": true,
|
|
@@ -3350,7 +3351,7 @@
|
|
|
3350
3351
|
"immutable": true,
|
|
3351
3352
|
"locationInModule": {
|
|
3352
3353
|
"filename": "src/MicroAppsCF.ts",
|
|
3353
|
-
"line":
|
|
3354
|
+
"line": 171
|
|
3354
3355
|
},
|
|
3355
3356
|
"name": "domainNameEdge",
|
|
3356
3357
|
"optional": true,
|
|
@@ -3371,7 +3372,7 @@
|
|
|
3371
3372
|
"kind": "interface",
|
|
3372
3373
|
"locationInModule": {
|
|
3373
3374
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3374
|
-
"line":
|
|
3375
|
+
"line": 129
|
|
3375
3376
|
},
|
|
3376
3377
|
"name": "GenerateEdgeToOriginConfigOptions",
|
|
3377
3378
|
"properties": [
|
|
@@ -3383,7 +3384,7 @@
|
|
|
3383
3384
|
"immutable": true,
|
|
3384
3385
|
"locationInModule": {
|
|
3385
3386
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3386
|
-
"line":
|
|
3387
|
+
"line": 132
|
|
3387
3388
|
},
|
|
3388
3389
|
"name": "addXForwardedHostHeader",
|
|
3389
3390
|
"type": {
|
|
@@ -3398,7 +3399,7 @@
|
|
|
3398
3399
|
"immutable": true,
|
|
3399
3400
|
"locationInModule": {
|
|
3400
3401
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3401
|
-
"line":
|
|
3402
|
+
"line": 130
|
|
3402
3403
|
},
|
|
3403
3404
|
"name": "originRegion",
|
|
3404
3405
|
"type": {
|
|
@@ -3413,7 +3414,7 @@
|
|
|
3413
3414
|
"immutable": true,
|
|
3414
3415
|
"locationInModule": {
|
|
3415
3416
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3416
|
-
"line":
|
|
3417
|
+
"line": 133
|
|
3417
3418
|
},
|
|
3418
3419
|
"name": "replaceHostHeader",
|
|
3419
3420
|
"type": {
|
|
@@ -3428,7 +3429,7 @@
|
|
|
3428
3429
|
"immutable": true,
|
|
3429
3430
|
"locationInModule": {
|
|
3430
3431
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3431
|
-
"line":
|
|
3432
|
+
"line": 131
|
|
3432
3433
|
},
|
|
3433
3434
|
"name": "signingMode",
|
|
3434
3435
|
"type": {
|
|
@@ -3443,7 +3444,7 @@
|
|
|
3443
3444
|
"immutable": true,
|
|
3444
3445
|
"locationInModule": {
|
|
3445
3446
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3446
|
-
"line":
|
|
3447
|
+
"line": 135
|
|
3447
3448
|
},
|
|
3448
3449
|
"name": "rootPathPrefix",
|
|
3449
3450
|
"optional": true,
|
|
@@ -3459,7 +3460,7 @@
|
|
|
3459
3460
|
"immutable": true,
|
|
3460
3461
|
"locationInModule": {
|
|
3461
3462
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
3462
|
-
"line":
|
|
3463
|
+
"line": 134
|
|
3463
3464
|
},
|
|
3464
3465
|
"name": "tableName",
|
|
3465
3466
|
"optional": true,
|
|
@@ -3480,7 +3481,7 @@
|
|
|
3480
3481
|
"kind": "interface",
|
|
3481
3482
|
"locationInModule": {
|
|
3482
3483
|
"filename": "src/MicroApps.ts",
|
|
3483
|
-
"line":
|
|
3484
|
+
"line": 303
|
|
3484
3485
|
},
|
|
3485
3486
|
"name": "IMicroApps",
|
|
3486
3487
|
"properties": [
|
|
@@ -3488,64 +3489,65 @@
|
|
|
3488
3489
|
"abstract": true,
|
|
3489
3490
|
"docs": {
|
|
3490
3491
|
"stability": "experimental",
|
|
3491
|
-
"summary": "{@inheritdoc
|
|
3492
|
+
"summary": "{@inheritdoc IMicroAppsCF}."
|
|
3492
3493
|
},
|
|
3493
3494
|
"immutable": true,
|
|
3494
3495
|
"locationInModule": {
|
|
3495
3496
|
"filename": "src/MicroApps.ts",
|
|
3496
|
-
"line":
|
|
3497
|
+
"line": 305
|
|
3497
3498
|
},
|
|
3498
|
-
"name": "
|
|
3499
|
+
"name": "cf",
|
|
3499
3500
|
"type": {
|
|
3500
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3501
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsCF"
|
|
3501
3502
|
}
|
|
3502
3503
|
},
|
|
3503
3504
|
{
|
|
3504
3505
|
"abstract": true,
|
|
3505
3506
|
"docs": {
|
|
3506
3507
|
"stability": "experimental",
|
|
3507
|
-
"summary": "{@inheritdoc
|
|
3508
|
+
"summary": "{@inheritdoc IMicroAppsS3}."
|
|
3508
3509
|
},
|
|
3509
3510
|
"immutable": true,
|
|
3510
3511
|
"locationInModule": {
|
|
3511
3512
|
"filename": "src/MicroApps.ts",
|
|
3512
|
-
"line":
|
|
3513
|
+
"line": 311
|
|
3513
3514
|
},
|
|
3514
|
-
"name": "
|
|
3515
|
+
"name": "s3",
|
|
3515
3516
|
"type": {
|
|
3516
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3517
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsS3"
|
|
3517
3518
|
}
|
|
3518
3519
|
},
|
|
3519
3520
|
{
|
|
3520
3521
|
"abstract": true,
|
|
3521
3522
|
"docs": {
|
|
3522
3523
|
"stability": "experimental",
|
|
3523
|
-
"summary": "{@inheritdoc
|
|
3524
|
+
"summary": "{@inheritdoc IMicroAppsSvcs}."
|
|
3524
3525
|
},
|
|
3525
3526
|
"immutable": true,
|
|
3526
3527
|
"locationInModule": {
|
|
3527
3528
|
"filename": "src/MicroApps.ts",
|
|
3528
|
-
"line":
|
|
3529
|
+
"line": 314
|
|
3529
3530
|
},
|
|
3530
|
-
"name": "
|
|
3531
|
+
"name": "svcs",
|
|
3531
3532
|
"type": {
|
|
3532
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3533
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs"
|
|
3533
3534
|
}
|
|
3534
3535
|
},
|
|
3535
3536
|
{
|
|
3536
3537
|
"abstract": true,
|
|
3537
3538
|
"docs": {
|
|
3538
3539
|
"stability": "experimental",
|
|
3539
|
-
"summary": "{@inheritdoc
|
|
3540
|
+
"summary": "{@inheritdoc IMicroAppsAPIGwy}."
|
|
3540
3541
|
},
|
|
3541
3542
|
"immutable": true,
|
|
3542
3543
|
"locationInModule": {
|
|
3543
3544
|
"filename": "src/MicroApps.ts",
|
|
3544
|
-
"line":
|
|
3545
|
+
"line": 317
|
|
3545
3546
|
},
|
|
3546
|
-
"name": "
|
|
3547
|
+
"name": "apigwy",
|
|
3548
|
+
"optional": true,
|
|
3547
3549
|
"type": {
|
|
3548
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3550
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy"
|
|
3549
3551
|
}
|
|
3550
3552
|
},
|
|
3551
3553
|
{
|
|
@@ -3557,7 +3559,7 @@
|
|
|
3557
3559
|
"immutable": true,
|
|
3558
3560
|
"locationInModule": {
|
|
3559
3561
|
"filename": "src/MicroApps.ts",
|
|
3560
|
-
"line":
|
|
3562
|
+
"line": 308
|
|
3561
3563
|
},
|
|
3562
3564
|
"name": "edgeToOrigin",
|
|
3563
3565
|
"optional": true,
|
|
@@ -3929,7 +3931,7 @@
|
|
|
3929
3931
|
},
|
|
3930
3932
|
"locationInModule": {
|
|
3931
3933
|
"filename": "src/MicroApps.ts",
|
|
3932
|
-
"line":
|
|
3934
|
+
"line": 366
|
|
3933
3935
|
},
|
|
3934
3936
|
"parameters": [
|
|
3935
3937
|
{
|
|
@@ -3959,72 +3961,73 @@
|
|
|
3959
3961
|
"kind": "class",
|
|
3960
3962
|
"locationInModule": {
|
|
3961
3963
|
"filename": "src/MicroApps.ts",
|
|
3962
|
-
"line":
|
|
3964
|
+
"line": 340
|
|
3963
3965
|
},
|
|
3964
3966
|
"name": "MicroApps",
|
|
3965
3967
|
"properties": [
|
|
3966
3968
|
{
|
|
3967
3969
|
"docs": {
|
|
3968
3970
|
"stability": "experimental",
|
|
3969
|
-
"summary": "{@inheritdoc
|
|
3971
|
+
"summary": "{@inheritdoc IMicroAppsCF}."
|
|
3970
3972
|
},
|
|
3971
3973
|
"immutable": true,
|
|
3972
3974
|
"locationInModule": {
|
|
3973
3975
|
"filename": "src/MicroApps.ts",
|
|
3974
|
-
"line":
|
|
3976
|
+
"line": 342
|
|
3975
3977
|
},
|
|
3976
|
-
"name": "
|
|
3978
|
+
"name": "cf",
|
|
3977
3979
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
|
|
3978
3980
|
"type": {
|
|
3979
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3981
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsCF"
|
|
3980
3982
|
}
|
|
3981
3983
|
},
|
|
3982
3984
|
{
|
|
3983
3985
|
"docs": {
|
|
3984
3986
|
"stability": "experimental",
|
|
3985
|
-
"summary": "{@inheritdoc
|
|
3987
|
+
"summary": "{@inheritdoc IMicroAppsS3}."
|
|
3986
3988
|
},
|
|
3987
3989
|
"immutable": true,
|
|
3988
3990
|
"locationInModule": {
|
|
3989
3991
|
"filename": "src/MicroApps.ts",
|
|
3990
|
-
"line":
|
|
3992
|
+
"line": 352
|
|
3991
3993
|
},
|
|
3992
|
-
"name": "
|
|
3994
|
+
"name": "s3",
|
|
3993
3995
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
|
|
3994
3996
|
"type": {
|
|
3995
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
3997
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsS3"
|
|
3996
3998
|
}
|
|
3997
3999
|
},
|
|
3998
4000
|
{
|
|
3999
4001
|
"docs": {
|
|
4000
4002
|
"stability": "experimental",
|
|
4001
|
-
"summary": "{@inheritdoc
|
|
4003
|
+
"summary": "{@inheritdoc IMicroAppsSvcs}."
|
|
4002
4004
|
},
|
|
4003
4005
|
"immutable": true,
|
|
4004
4006
|
"locationInModule": {
|
|
4005
4007
|
"filename": "src/MicroApps.ts",
|
|
4006
|
-
"line":
|
|
4008
|
+
"line": 362
|
|
4007
4009
|
},
|
|
4008
|
-
"name": "
|
|
4010
|
+
"name": "svcs",
|
|
4009
4011
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
|
|
4010
4012
|
"type": {
|
|
4011
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
4013
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs"
|
|
4012
4014
|
}
|
|
4013
4015
|
},
|
|
4014
4016
|
{
|
|
4015
4017
|
"docs": {
|
|
4016
4018
|
"stability": "experimental",
|
|
4017
|
-
"summary": "{@inheritdoc
|
|
4019
|
+
"summary": "{@inheritdoc IMicroAppsAPIGwy}."
|
|
4018
4020
|
},
|
|
4019
4021
|
"immutable": true,
|
|
4020
4022
|
"locationInModule": {
|
|
4021
4023
|
"filename": "src/MicroApps.ts",
|
|
4022
|
-
"line":
|
|
4024
|
+
"line": 357
|
|
4023
4025
|
},
|
|
4024
|
-
"name": "
|
|
4026
|
+
"name": "apigwy",
|
|
4027
|
+
"optional": true,
|
|
4025
4028
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
|
|
4026
4029
|
"type": {
|
|
4027
|
-
"fqn": "@pwrdrvr/microapps-cdk.
|
|
4030
|
+
"fqn": "@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy"
|
|
4028
4031
|
}
|
|
4029
4032
|
},
|
|
4030
4033
|
{
|
|
@@ -4035,7 +4038,7 @@
|
|
|
4035
4038
|
"immutable": true,
|
|
4036
4039
|
"locationInModule": {
|
|
4037
4040
|
"filename": "src/MicroApps.ts",
|
|
4038
|
-
"line":
|
|
4041
|
+
"line": 347
|
|
4039
4042
|
},
|
|
4040
4043
|
"name": "edgeToOrigin",
|
|
4041
4044
|
"optional": true,
|
|
@@ -4329,7 +4332,7 @@
|
|
|
4329
4332
|
},
|
|
4330
4333
|
"locationInModule": {
|
|
4331
4334
|
"filename": "src/MicroAppsCF.ts",
|
|
4332
|
-
"line":
|
|
4335
|
+
"line": 409
|
|
4333
4336
|
},
|
|
4334
4337
|
"parameters": [
|
|
4335
4338
|
{
|
|
@@ -4358,7 +4361,7 @@
|
|
|
4358
4361
|
"kind": "class",
|
|
4359
4362
|
"locationInModule": {
|
|
4360
4363
|
"filename": "src/MicroAppsCF.ts",
|
|
4361
|
-
"line":
|
|
4364
|
+
"line": 244
|
|
4362
4365
|
},
|
|
4363
4366
|
"methods": [
|
|
4364
4367
|
{
|
|
@@ -4368,7 +4371,7 @@
|
|
|
4368
4371
|
},
|
|
4369
4372
|
"locationInModule": {
|
|
4370
4373
|
"filename": "src/MicroAppsCF.ts",
|
|
4371
|
-
"line":
|
|
4374
|
+
"line": 303
|
|
4372
4375
|
},
|
|
4373
4376
|
"name": "addRoutes",
|
|
4374
4377
|
"parameters": [
|
|
@@ -4395,7 +4398,7 @@
|
|
|
4395
4398
|
},
|
|
4396
4399
|
"locationInModule": {
|
|
4397
4400
|
"filename": "src/MicroAppsCF.ts",
|
|
4398
|
-
"line":
|
|
4401
|
+
"line": 258
|
|
4399
4402
|
},
|
|
4400
4403
|
"name": "createAPIOriginPolicy",
|
|
4401
4404
|
"parameters": [
|
|
@@ -4430,7 +4433,7 @@
|
|
|
4430
4433
|
"immutable": true,
|
|
4431
4434
|
"locationInModule": {
|
|
4432
4435
|
"filename": "src/MicroAppsCF.ts",
|
|
4433
|
-
"line":
|
|
4436
|
+
"line": 405
|
|
4434
4437
|
},
|
|
4435
4438
|
"name": "cloudFrontDistro",
|
|
4436
4439
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsCF",
|
|
@@ -4472,22 +4475,6 @@
|
|
|
4472
4475
|
"fqn": "aws-cdk-lib.aws_cloudfront_origins.S3Origin"
|
|
4473
4476
|
}
|
|
4474
4477
|
},
|
|
4475
|
-
{
|
|
4476
|
-
"abstract": true,
|
|
4477
|
-
"docs": {
|
|
4478
|
-
"stability": "experimental",
|
|
4479
|
-
"summary": "API Gateway v2 HTTP API for apps."
|
|
4480
|
-
},
|
|
4481
|
-
"immutable": true,
|
|
4482
|
-
"locationInModule": {
|
|
4483
|
-
"filename": "src/MicroAppsCF.ts",
|
|
4484
|
-
"line": 65
|
|
4485
|
-
},
|
|
4486
|
-
"name": "httpApi",
|
|
4487
|
-
"type": {
|
|
4488
|
-
"fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi"
|
|
4489
|
-
}
|
|
4490
|
-
},
|
|
4491
4478
|
{
|
|
4492
4479
|
"abstract": true,
|
|
4493
4480
|
"docs": {
|
|
@@ -4563,7 +4550,7 @@
|
|
|
4563
4550
|
{
|
|
4564
4551
|
"abstract": true,
|
|
4565
4552
|
"docs": {
|
|
4566
|
-
"default": "true",
|
|
4553
|
+
"default": "true if httpApi is provided",
|
|
4567
4554
|
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /api/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
4568
4555
|
"stability": "experimental",
|
|
4569
4556
|
"summary": "Create an extra Behavior (Route) for /api/ that allows API routes to have a period in them."
|
|
@@ -4582,7 +4569,7 @@
|
|
|
4582
4569
|
{
|
|
4583
4570
|
"abstract": true,
|
|
4584
4571
|
"docs": {
|
|
4585
|
-
"default": "true",
|
|
4572
|
+
"default": "true if httpApi is provided",
|
|
4586
4573
|
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /_next/data/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
4587
4574
|
"stability": "experimental",
|
|
4588
4575
|
"summary": "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."
|
|
@@ -4639,9 +4626,7 @@
|
|
|
4639
4626
|
{
|
|
4640
4627
|
"abstract": true,
|
|
4641
4628
|
"docs": {
|
|
4642
|
-
"
|
|
4643
|
-
"defaunt": "- no edge to API Gateway origin functions added"
|
|
4644
|
-
},
|
|
4629
|
+
"default": "- no edge to API Gateway origin functions added",
|
|
4645
4630
|
"stability": "experimental",
|
|
4646
4631
|
"summary": "Configuration of the edge to origin lambda functions."
|
|
4647
4632
|
},
|
|
@@ -4650,7 +4635,7 @@
|
|
|
4650
4635
|
"filename": "src/MicroAppsCF.ts",
|
|
4651
4636
|
"line": 133
|
|
4652
4637
|
},
|
|
4653
|
-
"name": "
|
|
4638
|
+
"name": "edgeLambdas",
|
|
4654
4639
|
"optional": true,
|
|
4655
4640
|
"type": {
|
|
4656
4641
|
"collection": {
|
|
@@ -4661,6 +4646,42 @@
|
|
|
4661
4646
|
}
|
|
4662
4647
|
}
|
|
4663
4648
|
},
|
|
4649
|
+
{
|
|
4650
|
+
"abstract": true,
|
|
4651
|
+
"docs": {
|
|
4652
|
+
"stability": "experimental",
|
|
4653
|
+
"summary": "API Gateway v2 HTTP API for apps."
|
|
4654
|
+
},
|
|
4655
|
+
"immutable": true,
|
|
4656
|
+
"locationInModule": {
|
|
4657
|
+
"filename": "src/MicroAppsCF.ts",
|
|
4658
|
+
"line": 65
|
|
4659
|
+
},
|
|
4660
|
+
"name": "httpApi",
|
|
4661
|
+
"optional": true,
|
|
4662
|
+
"type": {
|
|
4663
|
+
"fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi"
|
|
4664
|
+
}
|
|
4665
|
+
},
|
|
4666
|
+
{
|
|
4667
|
+
"abstract": true,
|
|
4668
|
+
"docs": {
|
|
4669
|
+
"default": "- none",
|
|
4670
|
+
"remarks": "This should be the region where the DynamoDB is located so the\nEdgeToOrigin calls have the lowest latency (~1 ms).",
|
|
4671
|
+
"stability": "experimental",
|
|
4672
|
+
"summary": "Optional Origin Shield Region."
|
|
4673
|
+
},
|
|
4674
|
+
"immutable": true,
|
|
4675
|
+
"locationInModule": {
|
|
4676
|
+
"filename": "src/MicroAppsCF.ts",
|
|
4677
|
+
"line": 143
|
|
4678
|
+
},
|
|
4679
|
+
"name": "originShieldRegion",
|
|
4680
|
+
"optional": true,
|
|
4681
|
+
"type": {
|
|
4682
|
+
"primitive": "string"
|
|
4683
|
+
}
|
|
4684
|
+
},
|
|
4664
4685
|
{
|
|
4665
4686
|
"abstract": true,
|
|
4666
4687
|
"docs": {
|
|
@@ -4732,7 +4753,7 @@
|
|
|
4732
4753
|
},
|
|
4733
4754
|
"locationInModule": {
|
|
4734
4755
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
4735
|
-
"line":
|
|
4756
|
+
"line": 166
|
|
4736
4757
|
},
|
|
4737
4758
|
"parameters": [
|
|
4738
4759
|
{
|
|
@@ -4761,7 +4782,7 @@
|
|
|
4761
4782
|
"kind": "class",
|
|
4762
4783
|
"locationInModule": {
|
|
4763
4784
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
4764
|
-
"line":
|
|
4785
|
+
"line": 141
|
|
4765
4786
|
},
|
|
4766
4787
|
"methods": [
|
|
4767
4788
|
{
|
|
@@ -4772,7 +4793,7 @@
|
|
|
4772
4793
|
},
|
|
4773
4794
|
"locationInModule": {
|
|
4774
4795
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
4775
|
-
"line":
|
|
4796
|
+
"line": 147
|
|
4776
4797
|
},
|
|
4777
4798
|
"name": "generateEdgeToOriginConfig",
|
|
4778
4799
|
"parameters": [
|
|
@@ -4802,7 +4823,7 @@
|
|
|
4802
4823
|
"immutable": true,
|
|
4803
4824
|
"locationInModule": {
|
|
4804
4825
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
4805
|
-
"line":
|
|
4826
|
+
"line": 157
|
|
4806
4827
|
},
|
|
4807
4828
|
"name": "edgeToOriginFunction",
|
|
4808
4829
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
|
|
@@ -4827,7 +4848,7 @@
|
|
|
4827
4848
|
"immutable": true,
|
|
4828
4849
|
"locationInModule": {
|
|
4829
4850
|
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
4830
|
-
"line":
|
|
4851
|
+
"line": 162
|
|
4831
4852
|
},
|
|
4832
4853
|
"name": "edgeToOriginLambdas",
|
|
4833
4854
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
|
|
@@ -4989,6 +5010,24 @@
|
|
|
4989
5010
|
"primitive": "string"
|
|
4990
5011
|
}
|
|
4991
5012
|
},
|
|
5013
|
+
{
|
|
5014
|
+
"abstract": true,
|
|
5015
|
+
"docs": {
|
|
5016
|
+
"default": "false",
|
|
5017
|
+
"stability": "experimental",
|
|
5018
|
+
"summary": "Enable invoking API Gateway from the Edge Lambda."
|
|
5019
|
+
},
|
|
5020
|
+
"immutable": true,
|
|
5021
|
+
"locationInModule": {
|
|
5022
|
+
"filename": "src/MicroAppsEdgeToOrigin.ts",
|
|
5023
|
+
"line": 126
|
|
5024
|
+
},
|
|
5025
|
+
"name": "setupApiGatewayPermissions",
|
|
5026
|
+
"optional": true,
|
|
5027
|
+
"type": {
|
|
5028
|
+
"primitive": "boolean"
|
|
5029
|
+
}
|
|
5030
|
+
},
|
|
4992
5031
|
{
|
|
4993
5032
|
"abstract": true,
|
|
4994
5033
|
"docs": {
|
|
@@ -5040,7 +5079,7 @@
|
|
|
5040
5079
|
"kind": "interface",
|
|
5041
5080
|
"locationInModule": {
|
|
5042
5081
|
"filename": "src/MicroApps.ts",
|
|
5043
|
-
"line":
|
|
5082
|
+
"line": 39
|
|
5044
5083
|
},
|
|
5045
5084
|
"name": "MicroAppsProps",
|
|
5046
5085
|
"properties": [
|
|
@@ -5054,7 +5093,7 @@
|
|
|
5054
5093
|
"immutable": true,
|
|
5055
5094
|
"locationInModule": {
|
|
5056
5095
|
"filename": "src/MicroApps.ts",
|
|
5057
|
-
"line":
|
|
5096
|
+
"line": 54
|
|
5058
5097
|
},
|
|
5059
5098
|
"name": "appEnv",
|
|
5060
5099
|
"type": {
|
|
@@ -5072,7 +5111,7 @@
|
|
|
5072
5111
|
"immutable": true,
|
|
5073
5112
|
"locationInModule": {
|
|
5074
5113
|
"filename": "src/MicroApps.ts",
|
|
5075
|
-
"line":
|
|
5114
|
+
"line": 225
|
|
5076
5115
|
},
|
|
5077
5116
|
"name": "addXForwardedHostHeader",
|
|
5078
5117
|
"optional": true,
|
|
@@ -5091,7 +5130,7 @@
|
|
|
5091
5130
|
"immutable": true,
|
|
5092
5131
|
"locationInModule": {
|
|
5093
5132
|
"filename": "src/MicroApps.ts",
|
|
5094
|
-
"line":
|
|
5133
|
+
"line": 62
|
|
5095
5134
|
},
|
|
5096
5135
|
"name": "assetNameRoot",
|
|
5097
5136
|
"optional": true,
|
|
@@ -5110,7 +5149,7 @@
|
|
|
5110
5149
|
"immutable": true,
|
|
5111
5150
|
"locationInModule": {
|
|
5112
5151
|
"filename": "src/MicroApps.ts",
|
|
5113
|
-
"line":
|
|
5152
|
+
"line": 70
|
|
5114
5153
|
},
|
|
5115
5154
|
"name": "assetNameSuffix",
|
|
5116
5155
|
"optional": true,
|
|
@@ -5127,7 +5166,7 @@
|
|
|
5127
5166
|
"immutable": true,
|
|
5128
5167
|
"locationInModule": {
|
|
5129
5168
|
"filename": "src/MicroApps.ts",
|
|
5130
|
-
"line":
|
|
5169
|
+
"line": 80
|
|
5131
5170
|
},
|
|
5132
5171
|
"name": "certEdge",
|
|
5133
5172
|
"optional": true,
|
|
@@ -5144,7 +5183,7 @@
|
|
|
5144
5183
|
"immutable": true,
|
|
5145
5184
|
"locationInModule": {
|
|
5146
5185
|
"filename": "src/MicroApps.ts",
|
|
5147
|
-
"line":
|
|
5186
|
+
"line": 85
|
|
5148
5187
|
},
|
|
5149
5188
|
"name": "certOrigin",
|
|
5150
5189
|
"optional": true,
|
|
@@ -5152,6 +5191,24 @@
|
|
|
5152
5191
|
"fqn": "aws-cdk-lib.aws_certificatemanager.ICertificate"
|
|
5153
5192
|
}
|
|
5154
5193
|
},
|
|
5194
|
+
{
|
|
5195
|
+
"abstract": true,
|
|
5196
|
+
"docs": {
|
|
5197
|
+
"default": "false",
|
|
5198
|
+
"stability": "experimental",
|
|
5199
|
+
"summary": "Create API Gateway for non-edge invocation."
|
|
5200
|
+
},
|
|
5201
|
+
"immutable": true,
|
|
5202
|
+
"locationInModule": {
|
|
5203
|
+
"filename": "src/MicroApps.ts",
|
|
5204
|
+
"line": 186
|
|
5205
|
+
},
|
|
5206
|
+
"name": "createAPIGateway",
|
|
5207
|
+
"optional": true,
|
|
5208
|
+
"type": {
|
|
5209
|
+
"primitive": "boolean"
|
|
5210
|
+
}
|
|
5211
|
+
},
|
|
5155
5212
|
{
|
|
5156
5213
|
"abstract": true,
|
|
5157
5214
|
"docs": {
|
|
@@ -5163,7 +5220,7 @@
|
|
|
5163
5220
|
"immutable": true,
|
|
5164
5221
|
"locationInModule": {
|
|
5165
5222
|
"filename": "src/MicroApps.ts",
|
|
5166
|
-
"line":
|
|
5223
|
+
"line": 199
|
|
5167
5224
|
},
|
|
5168
5225
|
"name": "createAPIPathRoute",
|
|
5169
5226
|
"optional": true,
|
|
@@ -5171,6 +5228,25 @@
|
|
|
5171
5228
|
"primitive": "boolean"
|
|
5172
5229
|
}
|
|
5173
5230
|
},
|
|
5231
|
+
{
|
|
5232
|
+
"abstract": true,
|
|
5233
|
+
"docs": {
|
|
5234
|
+
"default": "true",
|
|
5235
|
+
"remarks": "When false API routes with a period in the path will get routed to S3.\n\nWhen true API routes that contain /_next/data/ in the path will get routed to API Gateway\neven if they have a period in the path.",
|
|
5236
|
+
"stability": "experimental",
|
|
5237
|
+
"summary": "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."
|
|
5238
|
+
},
|
|
5239
|
+
"immutable": true,
|
|
5240
|
+
"locationInModule": {
|
|
5241
|
+
"filename": "src/MicroApps.ts",
|
|
5242
|
+
"line": 214
|
|
5243
|
+
},
|
|
5244
|
+
"name": "createNextDataPathRoute",
|
|
5245
|
+
"optional": true,
|
|
5246
|
+
"type": {
|
|
5247
|
+
"primitive": "boolean"
|
|
5248
|
+
}
|
|
5249
|
+
},
|
|
5174
5250
|
{
|
|
5175
5251
|
"abstract": true,
|
|
5176
5252
|
"docs": {
|
|
@@ -5182,7 +5258,7 @@
|
|
|
5182
5258
|
"immutable": true,
|
|
5183
5259
|
"locationInModule": {
|
|
5184
5260
|
"filename": "src/MicroApps.ts",
|
|
5185
|
-
"line":
|
|
5261
|
+
"line": 164
|
|
5186
5262
|
},
|
|
5187
5263
|
"name": "domainNameEdge",
|
|
5188
5264
|
"optional": true,
|
|
@@ -5201,7 +5277,7 @@
|
|
|
5201
5277
|
"immutable": true,
|
|
5202
5278
|
"locationInModule": {
|
|
5203
5279
|
"filename": "src/MicroApps.ts",
|
|
5204
|
-
"line":
|
|
5280
|
+
"line": 172
|
|
5205
5281
|
},
|
|
5206
5282
|
"name": "domainNameOrigin",
|
|
5207
5283
|
"optional": true,
|
|
@@ -5209,17 +5285,39 @@
|
|
|
5209
5285
|
"primitive": "string"
|
|
5210
5286
|
}
|
|
5211
5287
|
},
|
|
5288
|
+
{
|
|
5289
|
+
"abstract": true,
|
|
5290
|
+
"docs": {
|
|
5291
|
+
"stability": "experimental",
|
|
5292
|
+
"summary": "Additional edge lambda functions."
|
|
5293
|
+
},
|
|
5294
|
+
"immutable": true,
|
|
5295
|
+
"locationInModule": {
|
|
5296
|
+
"filename": "src/MicroApps.ts",
|
|
5297
|
+
"line": 297
|
|
5298
|
+
},
|
|
5299
|
+
"name": "edgeLambdas",
|
|
5300
|
+
"optional": true,
|
|
5301
|
+
"type": {
|
|
5302
|
+
"collection": {
|
|
5303
|
+
"elementtype": {
|
|
5304
|
+
"fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
|
|
5305
|
+
},
|
|
5306
|
+
"kind": "array"
|
|
5307
|
+
}
|
|
5308
|
+
}
|
|
5309
|
+
},
|
|
5212
5310
|
{
|
|
5213
5311
|
"abstract": true,
|
|
5214
5312
|
"docs": {
|
|
5215
5313
|
"default": "undefined",
|
|
5216
5314
|
"stability": "experimental",
|
|
5217
|
-
"summary": "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."
|
|
5315
|
+
"summary": "Origin region that API Gateway or Lambda function will be deployed to, used for the config.yml on the Edge function to sign requests for the correct region."
|
|
5218
5316
|
},
|
|
5219
5317
|
"immutable": true,
|
|
5220
5318
|
"locationInModule": {
|
|
5221
5319
|
"filename": "src/MicroApps.ts",
|
|
5222
|
-
"line":
|
|
5320
|
+
"line": 259
|
|
5223
5321
|
},
|
|
5224
5322
|
"name": "originRegion",
|
|
5225
5323
|
"optional": true,
|
|
@@ -5227,6 +5325,25 @@
|
|
|
5227
5325
|
"primitive": "string"
|
|
5228
5326
|
}
|
|
5229
5327
|
},
|
|
5328
|
+
{
|
|
5329
|
+
"abstract": true,
|
|
5330
|
+
"docs": {
|
|
5331
|
+
"default": "originRegion if specified, otherwise undefined",
|
|
5332
|
+
"remarks": "This should be the region where the DynamoDB is located so the\nEdgeToOrigin calls have the lowest latency (~1 ms).",
|
|
5333
|
+
"stability": "experimental",
|
|
5334
|
+
"summary": "Optional Origin Shield Region."
|
|
5335
|
+
},
|
|
5336
|
+
"immutable": true,
|
|
5337
|
+
"locationInModule": {
|
|
5338
|
+
"filename": "src/MicroApps.ts",
|
|
5339
|
+
"line": 269
|
|
5340
|
+
},
|
|
5341
|
+
"name": "originShieldRegion",
|
|
5342
|
+
"optional": true,
|
|
5343
|
+
"type": {
|
|
5344
|
+
"primitive": "string"
|
|
5345
|
+
}
|
|
5346
|
+
},
|
|
5230
5347
|
{
|
|
5231
5348
|
"abstract": true,
|
|
5232
5349
|
"docs": {
|
|
@@ -5236,7 +5353,7 @@
|
|
|
5236
5353
|
"immutable": true,
|
|
5237
5354
|
"locationInModule": {
|
|
5238
5355
|
"filename": "src/MicroApps.ts",
|
|
5239
|
-
"line":
|
|
5356
|
+
"line": 75
|
|
5240
5357
|
},
|
|
5241
5358
|
"name": "r53Zone",
|
|
5242
5359
|
"optional": true,
|
|
@@ -5255,7 +5372,7 @@
|
|
|
5255
5372
|
"immutable": true,
|
|
5256
5373
|
"locationInModule": {
|
|
5257
5374
|
"filename": "src/MicroApps.ts",
|
|
5258
|
-
"line":
|
|
5375
|
+
"line": 47
|
|
5259
5376
|
},
|
|
5260
5377
|
"name": "removalPolicy",
|
|
5261
5378
|
"optional": true,
|
|
@@ -5274,7 +5391,7 @@
|
|
|
5274
5391
|
"immutable": true,
|
|
5275
5392
|
"locationInModule": {
|
|
5276
5393
|
"filename": "src/MicroApps.ts",
|
|
5277
|
-
"line":
|
|
5394
|
+
"line": 237
|
|
5278
5395
|
},
|
|
5279
5396
|
"name": "replaceHostHeader",
|
|
5280
5397
|
"optional": true,
|
|
@@ -5292,7 +5409,7 @@
|
|
|
5292
5409
|
"immutable": true,
|
|
5293
5410
|
"locationInModule": {
|
|
5294
5411
|
"filename": "src/MicroApps.ts",
|
|
5295
|
-
"line":
|
|
5412
|
+
"line": 179
|
|
5296
5413
|
},
|
|
5297
5414
|
"name": "rootPathPrefix",
|
|
5298
5415
|
"optional": true,
|
|
@@ -5312,7 +5429,7 @@
|
|
|
5312
5429
|
"immutable": true,
|
|
5313
5430
|
"locationInModule": {
|
|
5314
5431
|
"filename": "src/MicroApps.ts",
|
|
5315
|
-
"line":
|
|
5432
|
+
"line": 156
|
|
5316
5433
|
},
|
|
5317
5434
|
"name": "s3PolicyBypassAROAs",
|
|
5318
5435
|
"optional": true,
|
|
@@ -5337,7 +5454,7 @@
|
|
|
5337
5454
|
"immutable": true,
|
|
5338
5455
|
"locationInModule": {
|
|
5339
5456
|
"filename": "src/MicroApps.ts",
|
|
5340
|
-
"line":
|
|
5457
|
+
"line": 113
|
|
5341
5458
|
},
|
|
5342
5459
|
"name": "s3PolicyBypassPrincipalARNs",
|
|
5343
5460
|
"optional": true,
|
|
@@ -5361,7 +5478,7 @@
|
|
|
5361
5478
|
"immutable": true,
|
|
5362
5479
|
"locationInModule": {
|
|
5363
5480
|
"filename": "src/MicroApps.ts",
|
|
5364
|
-
"line":
|
|
5481
|
+
"line": 97
|
|
5365
5482
|
},
|
|
5366
5483
|
"name": "s3StrictBucketPolicy",
|
|
5367
5484
|
"optional": true,
|
|
@@ -5380,7 +5497,7 @@
|
|
|
5380
5497
|
"immutable": true,
|
|
5381
5498
|
"locationInModule": {
|
|
5382
5499
|
"filename": "src/MicroApps.ts",
|
|
5383
|
-
"line":
|
|
5500
|
+
"line": 250
|
|
5384
5501
|
},
|
|
5385
5502
|
"name": "signingMode",
|
|
5386
5503
|
"optional": true,
|
|
@@ -5401,7 +5518,7 @@
|
|
|
5401
5518
|
"immutable": true,
|
|
5402
5519
|
"locationInModule": {
|
|
5403
5520
|
"filename": "src/MicroApps.ts",
|
|
5404
|
-
"line":
|
|
5521
|
+
"line": 285
|
|
5405
5522
|
},
|
|
5406
5523
|
"name": "table",
|
|
5407
5524
|
"optional": true,
|
|
@@ -5419,7 +5536,7 @@
|
|
|
5419
5536
|
"immutable": true,
|
|
5420
5537
|
"locationInModule": {
|
|
5421
5538
|
"filename": "src/MicroApps.ts",
|
|
5422
|
-
"line":
|
|
5539
|
+
"line": 292
|
|
5423
5540
|
},
|
|
5424
5541
|
"name": "tableNameForEdgeToOrigin",
|
|
5425
5542
|
"optional": true,
|
|
@@ -5445,7 +5562,7 @@
|
|
|
5445
5562
|
},
|
|
5446
5563
|
"locationInModule": {
|
|
5447
5564
|
"filename": "src/MicroAppsS3.ts",
|
|
5448
|
-
"line":
|
|
5565
|
+
"line": 130
|
|
5449
5566
|
},
|
|
5450
5567
|
"parameters": [
|
|
5451
5568
|
{
|
|
@@ -5475,7 +5592,7 @@
|
|
|
5475
5592
|
"kind": "class",
|
|
5476
5593
|
"locationInModule": {
|
|
5477
5594
|
"filename": "src/MicroAppsS3.ts",
|
|
5478
|
-
"line":
|
|
5595
|
+
"line": 104
|
|
5479
5596
|
},
|
|
5480
5597
|
"name": "MicroAppsS3",
|
|
5481
5598
|
"properties": [
|
|
@@ -5487,7 +5604,7 @@
|
|
|
5487
5604
|
"immutable": true,
|
|
5488
5605
|
"locationInModule": {
|
|
5489
5606
|
"filename": "src/MicroAppsS3.ts",
|
|
5490
|
-
"line":
|
|
5607
|
+
"line": 106
|
|
5491
5608
|
},
|
|
5492
5609
|
"name": "bucketApps",
|
|
5493
5610
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
|
|
@@ -5503,7 +5620,7 @@
|
|
|
5503
5620
|
"immutable": true,
|
|
5504
5621
|
"locationInModule": {
|
|
5505
5622
|
"filename": "src/MicroAppsS3.ts",
|
|
5506
|
-
"line":
|
|
5623
|
+
"line": 111
|
|
5507
5624
|
},
|
|
5508
5625
|
"name": "bucketAppsOAI",
|
|
5509
5626
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
|
|
@@ -5519,7 +5636,7 @@
|
|
|
5519
5636
|
"immutable": true,
|
|
5520
5637
|
"locationInModule": {
|
|
5521
5638
|
"filename": "src/MicroAppsS3.ts",
|
|
5522
|
-
"line":
|
|
5639
|
+
"line": 116
|
|
5523
5640
|
},
|
|
5524
5641
|
"name": "bucketAppsOrigin",
|
|
5525
5642
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
|
|
@@ -5535,7 +5652,7 @@
|
|
|
5535
5652
|
"immutable": true,
|
|
5536
5653
|
"locationInModule": {
|
|
5537
5654
|
"filename": "src/MicroAppsS3.ts",
|
|
5538
|
-
"line":
|
|
5655
|
+
"line": 121
|
|
5539
5656
|
},
|
|
5540
5657
|
"name": "bucketAppsStaging",
|
|
5541
5658
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
|
|
@@ -5551,7 +5668,7 @@
|
|
|
5551
5668
|
"immutable": true,
|
|
5552
5669
|
"locationInModule": {
|
|
5553
5670
|
"filename": "src/MicroAppsS3.ts",
|
|
5554
|
-
"line":
|
|
5671
|
+
"line": 126
|
|
5555
5672
|
},
|
|
5556
5673
|
"name": "bucketLogs",
|
|
5557
5674
|
"overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
|
|
@@ -5669,6 +5786,25 @@
|
|
|
5669
5786
|
"primitive": "string"
|
|
5670
5787
|
}
|
|
5671
5788
|
},
|
|
5789
|
+
{
|
|
5790
|
+
"abstract": true,
|
|
5791
|
+
"docs": {
|
|
5792
|
+
"default": "- none",
|
|
5793
|
+
"remarks": "This should be the region where the DynamoDB is located so the\nEdgeToOrigin calls have the lowest latency (~1 ms).",
|
|
5794
|
+
"stability": "experimental",
|
|
5795
|
+
"summary": "Optional Origin Shield Region."
|
|
5796
|
+
},
|
|
5797
|
+
"immutable": true,
|
|
5798
|
+
"locationInModule": {
|
|
5799
|
+
"filename": "src/MicroAppsS3.ts",
|
|
5800
|
+
"line": 95
|
|
5801
|
+
},
|
|
5802
|
+
"name": "originShieldRegion",
|
|
5803
|
+
"optional": true,
|
|
5804
|
+
"type": {
|
|
5805
|
+
"primitive": "string"
|
|
5806
|
+
}
|
|
5807
|
+
},
|
|
5672
5808
|
{
|
|
5673
5809
|
"abstract": true,
|
|
5674
5810
|
"docs": {
|
|
@@ -5872,33 +6008,36 @@
|
|
|
5872
6008
|
{
|
|
5873
6009
|
"abstract": true,
|
|
5874
6010
|
"docs": {
|
|
6011
|
+
"default": "- resource names auto assigned",
|
|
6012
|
+
"example": "microapps",
|
|
5875
6013
|
"stability": "experimental",
|
|
5876
|
-
"summary": "
|
|
6014
|
+
"summary": "Optional asset name root."
|
|
5877
6015
|
},
|
|
5878
6016
|
"immutable": true,
|
|
5879
6017
|
"locationInModule": {
|
|
5880
6018
|
"filename": "src/MicroAppsSvcs.ts",
|
|
5881
|
-
"line":
|
|
6019
|
+
"line": 61
|
|
5882
6020
|
},
|
|
5883
|
-
"name": "
|
|
6021
|
+
"name": "assetNameRoot",
|
|
6022
|
+
"optional": true,
|
|
5884
6023
|
"type": {
|
|
5885
|
-
"
|
|
6024
|
+
"primitive": "string"
|
|
5886
6025
|
}
|
|
5887
6026
|
},
|
|
5888
6027
|
{
|
|
5889
6028
|
"abstract": true,
|
|
5890
6029
|
"docs": {
|
|
5891
|
-
"default": "
|
|
5892
|
-
"example": "
|
|
6030
|
+
"default": "none",
|
|
6031
|
+
"example": "-dev-pr-12",
|
|
5893
6032
|
"stability": "experimental",
|
|
5894
|
-
"summary": "Optional asset name
|
|
6033
|
+
"summary": "Optional asset name suffix."
|
|
5895
6034
|
},
|
|
5896
6035
|
"immutable": true,
|
|
5897
6036
|
"locationInModule": {
|
|
5898
6037
|
"filename": "src/MicroAppsSvcs.ts",
|
|
5899
|
-
"line":
|
|
6038
|
+
"line": 69
|
|
5900
6039
|
},
|
|
5901
|
-
"name": "
|
|
6040
|
+
"name": "assetNameSuffix",
|
|
5902
6041
|
"optional": true,
|
|
5903
6042
|
"type": {
|
|
5904
6043
|
"primitive": "string"
|
|
@@ -5907,20 +6046,18 @@
|
|
|
5907
6046
|
{
|
|
5908
6047
|
"abstract": true,
|
|
5909
6048
|
"docs": {
|
|
5910
|
-
"default": "none",
|
|
5911
|
-
"example": "-dev-pr-12",
|
|
5912
6049
|
"stability": "experimental",
|
|
5913
|
-
"summary": "
|
|
6050
|
+
"summary": "API Gateway v2 HTTP for Router and app."
|
|
5914
6051
|
},
|
|
5915
6052
|
"immutable": true,
|
|
5916
6053
|
"locationInModule": {
|
|
5917
6054
|
"filename": "src/MicroAppsSvcs.ts",
|
|
5918
|
-
"line":
|
|
6055
|
+
"line": 47
|
|
5919
6056
|
},
|
|
5920
|
-
"name": "
|
|
6057
|
+
"name": "httpApi",
|
|
5921
6058
|
"optional": true,
|
|
5922
6059
|
"type": {
|
|
5923
|
-
"
|
|
6060
|
+
"fqn": "@aws-cdk/aws-apigatewayv2-alpha.HttpApi"
|
|
5924
6061
|
}
|
|
5925
6062
|
},
|
|
5926
6063
|
{
|
|
@@ -6218,6 +6355,6 @@
|
|
|
6218
6355
|
"symbolId": "src/MicroAppsTable:MicroAppsTableProps"
|
|
6219
6356
|
}
|
|
6220
6357
|
},
|
|
6221
|
-
"version": "0.3.
|
|
6222
|
-
"fingerprint": "
|
|
6358
|
+
"version": "0.3.4-rc1",
|
|
6359
|
+
"fingerprint": "iaLk6f3pe0Noc6NDBmtdrbmIG2QFx/GfdCK9G1P/kb8="
|
|
6223
6360
|
}
|