@pwrdrvr/microapps-cdk 0.3.5-alpha.4 → 0.3.5

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 CHANGED
@@ -3100,7 +3100,7 @@
3100
3100
  },
3101
3101
  "name": "@pwrdrvr/microapps-cdk",
3102
3102
  "readme": {
3103
- "markdown": "![Build/Deploy CI](https://github.com/pwrdrvr/microapps-core/actions/workflows/ci.yml/badge.svg) ![Main Build](https://github.com/pwrdrvr/microapps-core/actions/workflows/main-build.yml/badge.svg) ![Release](https://github.com/pwrdrvr/microapps-core/actions/workflows/release.yml/badge.svg)\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![Video Preview of Deploying](https://raw.githubusercontent.com/pwrdrvr/microapps-core/main/assets/videos/microapps-core-demo-deploy.gif)\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![Architecure Diagram](https://raw.githubusercontent.com/pwrdrvr/microapps-core/main/assets/images/architecture-diagram.png)\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": "![Build/Deploy CI](https://github.com/pwrdrvr/microapps-core/actions/workflows/ci.yml/badge.svg) ![Main Build](https://github.com/pwrdrvr/microapps-core/actions/workflows/main-build.yml/badge.svg) ![Release](https://github.com/pwrdrvr/microapps-core/actions/workflows/release.yml/badge.svg)\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# Request Dispatch Model for Multi-Account Deployments\n\nNote: requests can also be dispatched into the same account, but this model is more likely to be used by organizations with many AWS accounts.\n\n![211132720-604510fa-de44-4ac6-a79b-c28c829d2490](https://user-images.githubusercontent.com/5617868/218237120-65b3ae44-31ba-4b6d-8722-4d3fb7da5577.png)\n\n# Video Preview of the Deploying CDK Construct\n\n![Video Preview of Deploying](https://raw.githubusercontent.com/pwrdrvr/microapps-core/main/assets/videos/microapps-core-demo-deploy.gif)\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![Architecure Diagram](https://raw.githubusercontent.com/pwrdrvr/microapps-core/main/assets/images/architecture-diagram.png)\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`\n"
3104
3104
  },
3105
3105
  "repository": {
3106
3106
  "type": "git",
@@ -3372,7 +3372,7 @@
3372
3372
  "kind": "interface",
3373
3373
  "locationInModule": {
3374
3374
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3375
- "line": 129
3375
+ "line": 153
3376
3376
  },
3377
3377
  "name": "GenerateEdgeToOriginConfigOptions",
3378
3378
  "properties": [
@@ -3384,7 +3384,7 @@
3384
3384
  "immutable": true,
3385
3385
  "locationInModule": {
3386
3386
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3387
- "line": 132
3387
+ "line": 156
3388
3388
  },
3389
3389
  "name": "addXForwardedHostHeader",
3390
3390
  "type": {
@@ -3399,7 +3399,7 @@
3399
3399
  "immutable": true,
3400
3400
  "locationInModule": {
3401
3401
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3402
- "line": 130
3402
+ "line": 154
3403
3403
  },
3404
3404
  "name": "originRegion",
3405
3405
  "type": {
@@ -3414,7 +3414,7 @@
3414
3414
  "immutable": true,
3415
3415
  "locationInModule": {
3416
3416
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3417
- "line": 133
3417
+ "line": 157
3418
3418
  },
3419
3419
  "name": "replaceHostHeader",
3420
3420
  "type": {
@@ -3429,7 +3429,7 @@
3429
3429
  "immutable": true,
3430
3430
  "locationInModule": {
3431
3431
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3432
- "line": 131
3432
+ "line": 155
3433
3433
  },
3434
3434
  "name": "signingMode",
3435
3435
  "type": {
@@ -3444,7 +3444,7 @@
3444
3444
  "immutable": true,
3445
3445
  "locationInModule": {
3446
3446
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3447
- "line": 135
3447
+ "line": 159
3448
3448
  },
3449
3449
  "name": "rootPathPrefix",
3450
3450
  "optional": true,
@@ -3460,7 +3460,7 @@
3460
3460
  "immutable": true,
3461
3461
  "locationInModule": {
3462
3462
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3463
- "line": 134
3463
+ "line": 158
3464
3464
  },
3465
3465
  "name": "tableName",
3466
3466
  "optional": true,
@@ -3481,7 +3481,7 @@
3481
3481
  "kind": "interface",
3482
3482
  "locationInModule": {
3483
3483
  "filename": "src/MicroApps.ts",
3484
- "line": 303
3484
+ "line": 310
3485
3485
  },
3486
3486
  "name": "IMicroApps",
3487
3487
  "properties": [
@@ -3494,7 +3494,7 @@
3494
3494
  "immutable": true,
3495
3495
  "locationInModule": {
3496
3496
  "filename": "src/MicroApps.ts",
3497
- "line": 305
3497
+ "line": 312
3498
3498
  },
3499
3499
  "name": "cf",
3500
3500
  "type": {
@@ -3510,7 +3510,7 @@
3510
3510
  "immutable": true,
3511
3511
  "locationInModule": {
3512
3512
  "filename": "src/MicroApps.ts",
3513
- "line": 311
3513
+ "line": 318
3514
3514
  },
3515
3515
  "name": "s3",
3516
3516
  "type": {
@@ -3526,7 +3526,7 @@
3526
3526
  "immutable": true,
3527
3527
  "locationInModule": {
3528
3528
  "filename": "src/MicroApps.ts",
3529
- "line": 314
3529
+ "line": 321
3530
3530
  },
3531
3531
  "name": "svcs",
3532
3532
  "type": {
@@ -3542,7 +3542,7 @@
3542
3542
  "immutable": true,
3543
3543
  "locationInModule": {
3544
3544
  "filename": "src/MicroApps.ts",
3545
- "line": 317
3545
+ "line": 324
3546
3546
  },
3547
3547
  "name": "apigwy",
3548
3548
  "optional": true,
@@ -3559,7 +3559,7 @@
3559
3559
  "immutable": true,
3560
3560
  "locationInModule": {
3561
3561
  "filename": "src/MicroApps.ts",
3562
- "line": 308
3562
+ "line": 315
3563
3563
  },
3564
3564
  "name": "edgeToOrigin",
3565
3565
  "optional": true,
@@ -3653,6 +3653,39 @@
3653
3653
  ],
3654
3654
  "symbolId": "src/MicroAppsCF:IMicroAppsCF"
3655
3655
  },
3656
+ "@pwrdrvr/microapps-cdk.IMicroAppsChildDeployer": {
3657
+ "assembly": "@pwrdrvr/microapps-cdk",
3658
+ "docs": {
3659
+ "stability": "experimental",
3660
+ "summary": "Represents a MicroApps Child Deployer."
3661
+ },
3662
+ "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsChildDeployer",
3663
+ "kind": "interface",
3664
+ "locationInModule": {
3665
+ "filename": "src/MicroAppsChildDeployer.ts",
3666
+ "line": 68
3667
+ },
3668
+ "name": "IMicroAppsChildDeployer",
3669
+ "properties": [
3670
+ {
3671
+ "abstract": true,
3672
+ "docs": {
3673
+ "stability": "experimental",
3674
+ "summary": "Lambda function for the Deployer."
3675
+ },
3676
+ "immutable": true,
3677
+ "locationInModule": {
3678
+ "filename": "src/MicroAppsChildDeployer.ts",
3679
+ "line": 72
3680
+ },
3681
+ "name": "deployerFunc",
3682
+ "type": {
3683
+ "fqn": "aws-cdk-lib.aws_lambda.IFunction"
3684
+ }
3685
+ }
3686
+ ],
3687
+ "symbolId": "src/MicroAppsChildDeployer:IMicroAppsChildDeployer"
3688
+ },
3656
3689
  "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin": {
3657
3690
  "assembly": "@pwrdrvr/microapps-cdk",
3658
3691
  "docs": {
@@ -3663,7 +3696,7 @@
3663
3696
  "kind": "interface",
3664
3697
  "locationInModule": {
3665
3698
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3666
- "line": 18
3699
+ "line": 27
3667
3700
  },
3668
3701
  "name": "IMicroAppsEdgeToOrigin",
3669
3702
  "properties": [
@@ -3677,7 +3710,7 @@
3677
3710
  "immutable": true,
3678
3711
  "locationInModule": {
3679
3712
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3680
- "line": 24
3713
+ "line": 33
3681
3714
  },
3682
3715
  "name": "edgeToOriginFunction",
3683
3716
  "type": {
@@ -3702,7 +3735,7 @@
3702
3735
  "immutable": true,
3703
3736
  "locationInModule": {
3704
3737
  "filename": "src/MicroAppsEdgeToOrigin.ts",
3705
- "line": 29
3738
+ "line": 38
3706
3739
  },
3707
3740
  "name": "edgeToOriginLambdas",
3708
3741
  "type": {
@@ -3713,6 +3746,22 @@
3713
3746
  "kind": "array"
3714
3747
  }
3715
3748
  }
3749
+ },
3750
+ {
3751
+ "abstract": true,
3752
+ "docs": {
3753
+ "stability": "experimental",
3754
+ "summary": "The IAM Role for the edge to origin function."
3755
+ },
3756
+ "immutable": true,
3757
+ "locationInModule": {
3758
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3759
+ "line": 43
3760
+ },
3761
+ "name": "edgeToOriginRole",
3762
+ "type": {
3763
+ "fqn": "aws-cdk-lib.aws_iam.Role"
3764
+ }
3716
3765
  }
3717
3766
  ],
3718
3767
  "symbolId": "src/MicroAppsEdgeToOrigin:IMicroAppsEdgeToOrigin"
@@ -3841,7 +3890,7 @@
3841
3890
  },
3842
3891
  "name": "deployerFunc",
3843
3892
  "type": {
3844
- "fqn": "aws-cdk-lib.aws_lambda.IFunction"
3893
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
3845
3894
  }
3846
3895
  },
3847
3896
  {
@@ -3874,7 +3923,7 @@
3874
3923
  "name": "routerFunc",
3875
3924
  "optional": true,
3876
3925
  "type": {
3877
- "fqn": "aws-cdk-lib.aws_lambda.IFunction"
3926
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
3878
3927
  }
3879
3928
  }
3880
3929
  ],
@@ -3932,7 +3981,7 @@
3932
3981
  },
3933
3982
  "locationInModule": {
3934
3983
  "filename": "src/MicroApps.ts",
3935
- "line": 366
3984
+ "line": 373
3936
3985
  },
3937
3986
  "parameters": [
3938
3987
  {
@@ -3962,7 +4011,7 @@
3962
4011
  "kind": "class",
3963
4012
  "locationInModule": {
3964
4013
  "filename": "src/MicroApps.ts",
3965
- "line": 340
4014
+ "line": 347
3966
4015
  },
3967
4016
  "name": "MicroApps",
3968
4017
  "properties": [
@@ -3974,7 +4023,7 @@
3974
4023
  "immutable": true,
3975
4024
  "locationInModule": {
3976
4025
  "filename": "src/MicroApps.ts",
3977
- "line": 342
4026
+ "line": 349
3978
4027
  },
3979
4028
  "name": "cf",
3980
4029
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -3990,7 +4039,7 @@
3990
4039
  "immutable": true,
3991
4040
  "locationInModule": {
3992
4041
  "filename": "src/MicroApps.ts",
3993
- "line": 352
4042
+ "line": 359
3994
4043
  },
3995
4044
  "name": "s3",
3996
4045
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -4006,7 +4055,7 @@
4006
4055
  "immutable": true,
4007
4056
  "locationInModule": {
4008
4057
  "filename": "src/MicroApps.ts",
4009
- "line": 362
4058
+ "line": 369
4010
4059
  },
4011
4060
  "name": "svcs",
4012
4061
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -4022,7 +4071,7 @@
4022
4071
  "immutable": true,
4023
4072
  "locationInModule": {
4024
4073
  "filename": "src/MicroApps.ts",
4025
- "line": 357
4074
+ "line": 364
4026
4075
  },
4027
4076
  "name": "apigwy",
4028
4077
  "optional": true,
@@ -4039,7 +4088,7 @@
4039
4088
  "immutable": true,
4040
4089
  "locationInModule": {
4041
4090
  "filename": "src/MicroApps.ts",
4042
- "line": 347
4091
+ "line": 354
4043
4092
  },
4044
4093
  "name": "edgeToOrigin",
4045
4094
  "optional": true,
@@ -4740,6 +4789,215 @@
4740
4789
  ],
4741
4790
  "symbolId": "src/MicroAppsCF:MicroAppsCFProps"
4742
4791
  },
4792
+ "@pwrdrvr/microapps-cdk.MicroAppsChildDeployer": {
4793
+ "assembly": "@pwrdrvr/microapps-cdk",
4794
+ "base": "constructs.Construct",
4795
+ "docs": {
4796
+ "stability": "experimental",
4797
+ "summary": "Create a new MicroApps Child Deployer construct."
4798
+ },
4799
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsChildDeployer",
4800
+ "initializer": {
4801
+ "docs": {
4802
+ "stability": "experimental"
4803
+ },
4804
+ "locationInModule": {
4805
+ "filename": "src/MicroAppsChildDeployer.ts",
4806
+ "line": 84
4807
+ },
4808
+ "parameters": [
4809
+ {
4810
+ "name": "scope",
4811
+ "type": {
4812
+ "fqn": "constructs.Construct"
4813
+ }
4814
+ },
4815
+ {
4816
+ "name": "id",
4817
+ "type": {
4818
+ "primitive": "string"
4819
+ }
4820
+ },
4821
+ {
4822
+ "name": "props",
4823
+ "optional": true,
4824
+ "type": {
4825
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsChildDeployerProps"
4826
+ }
4827
+ }
4828
+ ]
4829
+ },
4830
+ "interfaces": [
4831
+ "@pwrdrvr/microapps-cdk.IMicroAppsChildDeployer"
4832
+ ],
4833
+ "kind": "class",
4834
+ "locationInModule": {
4835
+ "filename": "src/MicroAppsChildDeployer.ts",
4836
+ "line": 78
4837
+ },
4838
+ "name": "MicroAppsChildDeployer",
4839
+ "properties": [
4840
+ {
4841
+ "docs": {
4842
+ "stability": "experimental",
4843
+ "summary": "Lambda function for the Deployer."
4844
+ },
4845
+ "immutable": true,
4846
+ "locationInModule": {
4847
+ "filename": "src/MicroAppsChildDeployer.ts",
4848
+ "line": 80
4849
+ },
4850
+ "name": "deployerFunc",
4851
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsChildDeployer",
4852
+ "type": {
4853
+ "fqn": "aws-cdk-lib.aws_lambda.IFunction"
4854
+ }
4855
+ }
4856
+ ],
4857
+ "symbolId": "src/MicroAppsChildDeployer:MicroAppsChildDeployer"
4858
+ },
4859
+ "@pwrdrvr/microapps-cdk.MicroAppsChildDeployerProps": {
4860
+ "assembly": "@pwrdrvr/microapps-cdk",
4861
+ "datatype": true,
4862
+ "docs": {
4863
+ "stability": "experimental",
4864
+ "summary": "Properties to initialize an instance of `MicroAppsChildDeployer`."
4865
+ },
4866
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsChildDeployerProps",
4867
+ "kind": "interface",
4868
+ "locationInModule": {
4869
+ "filename": "src/MicroAppsChildDeployer.ts",
4870
+ "line": 13
4871
+ },
4872
+ "name": "MicroAppsChildDeployerProps",
4873
+ "properties": [
4874
+ {
4875
+ "abstract": true,
4876
+ "docs": {
4877
+ "stability": "experimental",
4878
+ "summary": "Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions."
4879
+ },
4880
+ "immutable": true,
4881
+ "locationInModule": {
4882
+ "filename": "src/MicroAppsChildDeployer.ts",
4883
+ "line": 37
4884
+ },
4885
+ "name": "appEnv",
4886
+ "type": {
4887
+ "primitive": "string"
4888
+ }
4889
+ },
4890
+ {
4891
+ "abstract": true,
4892
+ "docs": {
4893
+ "stability": "experimental",
4894
+ "summary": "ARN of the IAM Role for the Edge to Origin Lambda Function."
4895
+ },
4896
+ "immutable": true,
4897
+ "locationInModule": {
4898
+ "filename": "src/MicroAppsChildDeployer.ts",
4899
+ "line": 22
4900
+ },
4901
+ "name": "edgeToOriginRoleARN",
4902
+ "type": {
4903
+ "primitive": "string"
4904
+ }
4905
+ },
4906
+ {
4907
+ "abstract": true,
4908
+ "docs": {
4909
+ "stability": "experimental",
4910
+ "summary": "ARN of the parent Deployer Lambda Function."
4911
+ },
4912
+ "immutable": true,
4913
+ "locationInModule": {
4914
+ "filename": "src/MicroAppsChildDeployer.ts",
4915
+ "line": 17
4916
+ },
4917
+ "name": "parentDeployerLambdaARN",
4918
+ "type": {
4919
+ "primitive": "string"
4920
+ }
4921
+ },
4922
+ {
4923
+ "abstract": true,
4924
+ "docs": {
4925
+ "default": "- resource names auto assigned",
4926
+ "example": "microapps",
4927
+ "stability": "experimental",
4928
+ "summary": "Optional asset name root."
4929
+ },
4930
+ "immutable": true,
4931
+ "locationInModule": {
4932
+ "filename": "src/MicroAppsChildDeployer.ts",
4933
+ "line": 45
4934
+ },
4935
+ "name": "assetNameRoot",
4936
+ "optional": true,
4937
+ "type": {
4938
+ "primitive": "string"
4939
+ }
4940
+ },
4941
+ {
4942
+ "abstract": true,
4943
+ "docs": {
4944
+ "default": "none",
4945
+ "example": "-dev-pr-12",
4946
+ "stability": "experimental",
4947
+ "summary": "Optional asset name suffix."
4948
+ },
4949
+ "immutable": true,
4950
+ "locationInModule": {
4951
+ "filename": "src/MicroAppsChildDeployer.ts",
4952
+ "line": 53
4953
+ },
4954
+ "name": "assetNameSuffix",
4955
+ "optional": true,
4956
+ "type": {
4957
+ "primitive": "string"
4958
+ }
4959
+ },
4960
+ {
4961
+ "abstract": true,
4962
+ "docs": {
4963
+ "default": "2 minutes",
4964
+ "remarks": "For larger applications this needs to be set up to 2-5 minutes for the S3 copy",
4965
+ "stability": "experimental",
4966
+ "summary": "Deployer timeout."
4967
+ },
4968
+ "immutable": true,
4969
+ "locationInModule": {
4970
+ "filename": "src/MicroAppsChildDeployer.ts",
4971
+ "line": 62
4972
+ },
4973
+ "name": "deployerTimeout",
4974
+ "optional": true,
4975
+ "type": {
4976
+ "fqn": "aws-cdk-lib.Duration"
4977
+ }
4978
+ },
4979
+ {
4980
+ "abstract": true,
4981
+ "docs": {
4982
+ "default": "- per resource default",
4983
+ "remarks": "Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`",
4984
+ "stability": "experimental",
4985
+ "summary": "RemovalPolicy override for child resources."
4986
+ },
4987
+ "immutable": true,
4988
+ "locationInModule": {
4989
+ "filename": "src/MicroAppsChildDeployer.ts",
4990
+ "line": 31
4991
+ },
4992
+ "name": "removalPolicy",
4993
+ "optional": true,
4994
+ "type": {
4995
+ "fqn": "aws-cdk-lib.RemovalPolicy"
4996
+ }
4997
+ }
4998
+ ],
4999
+ "symbolId": "src/MicroAppsChildDeployer:MicroAppsChildDeployerProps"
5000
+ },
4743
5001
  "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin": {
4744
5002
  "assembly": "@pwrdrvr/microapps-cdk",
4745
5003
  "base": "constructs.Construct",
@@ -4754,7 +5012,7 @@
4754
5012
  },
4755
5013
  "locationInModule": {
4756
5014
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4757
- "line": 166
5015
+ "line": 304
4758
5016
  },
4759
5017
  "parameters": [
4760
5018
  {
@@ -4783,7 +5041,7 @@
4783
5041
  "kind": "class",
4784
5042
  "locationInModule": {
4785
5043
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4786
- "line": 141
5044
+ "line": 274
4787
5045
  },
4788
5046
  "methods": [
4789
5047
  {
@@ -4794,7 +5052,7 @@
4794
5052
  },
4795
5053
  "locationInModule": {
4796
5054
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4797
- "line": 147
5055
+ "line": 280
4798
5056
  },
4799
5057
  "name": "generateEdgeToOriginConfig",
4800
5058
  "parameters": [
@@ -4824,7 +5082,7 @@
4824
5082
  "immutable": true,
4825
5083
  "locationInModule": {
4826
5084
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4827
- "line": 157
5085
+ "line": 290
4828
5086
  },
4829
5087
  "name": "edgeToOriginFunction",
4830
5088
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
@@ -4849,7 +5107,7 @@
4849
5107
  "immutable": true,
4850
5108
  "locationInModule": {
4851
5109
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4852
- "line": 162
5110
+ "line": 295
4853
5111
  },
4854
5112
  "name": "edgeToOriginLambdas",
4855
5113
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
@@ -4861,6 +5119,22 @@
4861
5119
  "kind": "array"
4862
5120
  }
4863
5121
  }
5122
+ },
5123
+ {
5124
+ "docs": {
5125
+ "stability": "experimental",
5126
+ "summary": "The IAM Role for the edge to origin function."
5127
+ },
5128
+ "immutable": true,
5129
+ "locationInModule": {
5130
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
5131
+ "line": 300
5132
+ },
5133
+ "name": "edgeToOriginRole",
5134
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
5135
+ "type": {
5136
+ "fqn": "aws-cdk-lib.aws_iam.Role"
5137
+ }
4864
5138
  }
4865
5139
  ],
4866
5140
  "symbolId": "src/MicroAppsEdgeToOrigin:MicroAppsEdgeToOrigin"
@@ -4876,7 +5150,7 @@
4876
5150
  "kind": "interface",
4877
5151
  "locationInModule": {
4878
5152
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4879
- "line": 35
5153
+ "line": 49
4880
5154
  },
4881
5155
  "name": "MicroAppsEdgeToOriginProps",
4882
5156
  "properties": [
@@ -4891,7 +5165,7 @@
4891
5165
  "immutable": true,
4892
5166
  "locationInModule": {
4893
5167
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4894
- "line": 76
5168
+ "line": 90
4895
5169
  },
4896
5170
  "name": "addXForwardedHostHeader",
4897
5171
  "optional": true,
@@ -4899,6 +5173,29 @@
4899
5173
  "primitive": "boolean"
4900
5174
  }
4901
5175
  },
5176
+ {
5177
+ "abstract": true,
5178
+ "docs": {
5179
+ "default": "[]",
5180
+ "stability": "experimental",
5181
+ "summary": "Account IDs allowed for cross-account Function URL invocations."
5182
+ },
5183
+ "immutable": true,
5184
+ "locationInModule": {
5185
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
5186
+ "line": 150
5187
+ },
5188
+ "name": "allowedFunctionUrlAccounts",
5189
+ "optional": true,
5190
+ "type": {
5191
+ "collection": {
5192
+ "elementtype": {
5193
+ "primitive": "string"
5194
+ },
5195
+ "kind": "array"
5196
+ }
5197
+ }
5198
+ },
4902
5199
  {
4903
5200
  "abstract": true,
4904
5201
  "docs": {
@@ -4910,7 +5207,7 @@
4910
5207
  "immutable": true,
4911
5208
  "locationInModule": {
4912
5209
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4913
- "line": 49
5210
+ "line": 63
4914
5211
  },
4915
5212
  "name": "assetNameRoot",
4916
5213
  "optional": true,
@@ -4929,7 +5226,7 @@
4929
5226
  "immutable": true,
4930
5227
  "locationInModule": {
4931
5228
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4932
- "line": 57
5229
+ "line": 71
4933
5230
  },
4934
5231
  "name": "assetNameSuffix",
4935
5232
  "optional": true,
@@ -4941,13 +5238,14 @@
4941
5238
  "abstract": true,
4942
5239
  "docs": {
4943
5240
  "default": "undefined",
5241
+ "remarks": "Note that Lambda FunctionURLs get the region from the Lambda ARN\nand do not need this to be configured.",
4944
5242
  "stability": "experimental",
4945
5243
  "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."
4946
5244
  },
4947
5245
  "immutable": true,
4948
5246
  "locationInModule": {
4949
5247
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4950
- "line": 110
5248
+ "line": 127
4951
5249
  },
4952
5250
  "name": "originRegion",
4953
5251
  "optional": true,
@@ -4965,7 +5263,7 @@
4965
5263
  "immutable": true,
4966
5264
  "locationInModule": {
4967
5265
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4968
- "line": 41
5266
+ "line": 55
4969
5267
  },
4970
5268
  "name": "removalPolicy",
4971
5269
  "optional": true,
@@ -4984,7 +5282,7 @@
4984
5282
  "immutable": true,
4985
5283
  "locationInModule": {
4986
5284
  "filename": "src/MicroAppsEdgeToOrigin.ts",
4987
- "line": 88
5285
+ "line": 102
4988
5286
  },
4989
5287
  "name": "replaceHostHeader",
4990
5288
  "optional": true,
@@ -5003,7 +5301,7 @@
5003
5301
  "immutable": true,
5004
5302
  "locationInModule": {
5005
5303
  "filename": "src/MicroAppsEdgeToOrigin.ts",
5006
- "line": 65
5304
+ "line": 79
5007
5305
  },
5008
5306
  "name": "rootPathPrefix",
5009
5307
  "optional": true,
@@ -5021,7 +5319,7 @@
5021
5319
  "immutable": true,
5022
5320
  "locationInModule": {
5023
5321
  "filename": "src/MicroAppsEdgeToOrigin.ts",
5024
- "line": 126
5322
+ "line": 143
5025
5323
  },
5026
5324
  "name": "setupApiGatewayPermissions",
5027
5325
  "optional": true,
@@ -5040,7 +5338,7 @@
5040
5338
  "immutable": true,
5041
5339
  "locationInModule": {
5042
5340
  "filename": "src/MicroAppsEdgeToOrigin.ts",
5043
- "line": 101
5341
+ "line": 115
5044
5342
  },
5045
5343
  "name": "signingMode",
5046
5344
  "optional": true,
@@ -5058,7 +5356,7 @@
5058
5356
  "immutable": true,
5059
5357
  "locationInModule": {
5060
5358
  "filename": "src/MicroAppsEdgeToOrigin.ts",
5061
- "line": 119
5359
+ "line": 136
5062
5360
  },
5063
5361
  "name": "tableRulesArn",
5064
5362
  "optional": true,
@@ -5120,6 +5418,29 @@
5120
5418
  "primitive": "boolean"
5121
5419
  }
5122
5420
  },
5421
+ {
5422
+ "abstract": true,
5423
+ "docs": {
5424
+ "default": "[]",
5425
+ "stability": "experimental",
5426
+ "summary": "Account IDs allowed for cross-account Function URL invocations."
5427
+ },
5428
+ "immutable": true,
5429
+ "locationInModule": {
5430
+ "filename": "src/MicroApps.ts",
5431
+ "line": 304
5432
+ },
5433
+ "name": "allowedFunctionUrlAccounts",
5434
+ "optional": true,
5435
+ "type": {
5436
+ "collection": {
5437
+ "elementtype": {
5438
+ "primitive": "string"
5439
+ },
5440
+ "kind": "array"
5441
+ }
5442
+ }
5443
+ },
5123
5444
  {
5124
5445
  "abstract": true,
5125
5446
  "docs": {
@@ -5889,7 +6210,7 @@
5889
6210
  "name": "deployerFunc",
5890
6211
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs",
5891
6212
  "type": {
5892
- "fqn": "aws-cdk-lib.aws_lambda.IFunction"
6213
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
5893
6214
  }
5894
6215
  },
5895
6216
  {
@@ -5922,7 +6243,7 @@
5922
6243
  "optional": true,
5923
6244
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs",
5924
6245
  "type": {
5925
- "fqn": "aws-cdk-lib.aws_lambda.IFunction"
6246
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
5926
6247
  }
5927
6248
  }
5928
6249
  ],
@@ -6376,6 +6697,6 @@
6376
6697
  "symbolId": "src/MicroAppsTable:MicroAppsTableProps"
6377
6698
  }
6378
6699
  },
6379
- "version": "0.3.5-alpha.4",
6380
- "fingerprint": "LgfSXRwDGkg90srg0s3wArpaOGACHrqD0EA7IFbbigg="
6700
+ "version": "0.3.5",
6701
+ "fingerprint": "twpA5P8hfFgqhJ/HEjAY7tbWkl3TTR9ghwVp6z1AIiY="
6381
6702
  }