@pwrdrvr/microapps-cdk 0.2.10 → 0.2.11

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
@@ -9,6 +9,7 @@
9
9
  },
10
10
  "dependencies": {
11
11
  "@aws-cdk/aws-apigatewayv2-alpha": "^2.24.1-alpha.0",
12
+ "@aws-cdk/aws-apigatewayv2-authorizers-alpha": "^2.24.1-alpha.0",
12
13
  "@aws-cdk/aws-apigatewayv2-integrations-alpha": "^2.24.1-alpha.0",
13
14
  "aws-cdk-lib": "^2.24.1",
14
15
  "constructs": "^10.0.5"
@@ -45,6 +46,39 @@
45
46
  }
46
47
  }
47
48
  },
49
+ "@aws-cdk/aws-apigatewayv2-authorizers-alpha": {
50
+ "targets": {
51
+ "dotnet": {
52
+ "assemblyOriginatorKeyFile": "../../key.snk",
53
+ "iconUrl": "https://raw.githubusercontent.com/aws/aws-cdk/master/logo/default-256-dark.png",
54
+ "namespace": "Amazon.CDK.AWS.Apigatewayv2.Authorizers.Alpha",
55
+ "packageId": "Amazon.CDK.AWS.APIGatewayv2.Authorizers.Alpha",
56
+ "signAssembly": true
57
+ },
58
+ "go": {
59
+ "moduleName": "github.com/aws/aws-cdk-go",
60
+ "packageName": "awscdkapigatewayv2authorizersalpha"
61
+ },
62
+ "java": {
63
+ "maven": {
64
+ "artifactId": "apigatewayv2-authorizers-alpha",
65
+ "groupId": "software.amazon.awscdk"
66
+ },
67
+ "package": "software.amazon.awscdk.services.apigatewayv2.authorizers.alpha"
68
+ },
69
+ "js": {
70
+ "npm": "@aws-cdk/aws-apigatewayv2-authorizers-alpha"
71
+ },
72
+ "python": {
73
+ "classifiers": [
74
+ "Framework :: AWS CDK",
75
+ "Framework :: AWS CDK :: 2"
76
+ ],
77
+ "distName": "aws-cdk.aws-apigatewayv2-authorizers-alpha",
78
+ "module": "aws_cdk.aws_apigatewayv2_authorizers_alpha"
79
+ }
80
+ }
81
+ },
48
82
  "@aws-cdk/aws-apigatewayv2-integrations-alpha": {
49
83
  "targets": {
50
84
  "dotnet": {
@@ -3066,7 +3100,7 @@
3066
3100
  },
3067
3101
  "name": "@pwrdrvr/microapps-cdk",
3068
3102
  "readme": {
3069
- "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\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\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:stackName=microapps-demo-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"
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\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:stackName=microapps-demo-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`"
3070
3104
  },
3071
3105
  "repository": {
3072
3106
  "type": "git",
@@ -3105,7 +3139,7 @@
3105
3139
  "kind": "interface",
3106
3140
  "locationInModule": {
3107
3141
  "filename": "src/MicroAppsCF.ts",
3108
- "line": 143
3142
+ "line": 167
3109
3143
  },
3110
3144
  "name": "AddRoutesOptions",
3111
3145
  "properties": [
@@ -3118,7 +3152,7 @@
3118
3152
  "immutable": true,
3119
3153
  "locationInModule": {
3120
3154
  "filename": "src/MicroAppsCF.ts",
3121
- "line": 147
3155
+ "line": 171
3122
3156
  },
3123
3157
  "name": "apiGwyOrigin",
3124
3158
  "type": {
@@ -3134,7 +3168,7 @@
3134
3168
  "immutable": true,
3135
3169
  "locationInModule": {
3136
3170
  "filename": "src/MicroAppsCF.ts",
3137
- "line": 162
3171
+ "line": 186
3138
3172
  },
3139
3173
  "name": "apigwyOriginRequestPolicy",
3140
3174
  "type": {
@@ -3150,7 +3184,7 @@
3150
3184
  "immutable": true,
3151
3185
  "locationInModule": {
3152
3186
  "filename": "src/MicroAppsCF.ts",
3153
- "line": 152
3187
+ "line": 176
3154
3188
  },
3155
3189
  "name": "bucketAppsOrigin",
3156
3190
  "type": {
@@ -3166,13 +3200,35 @@
3166
3200
  "immutable": true,
3167
3201
  "locationInModule": {
3168
3202
  "filename": "src/MicroAppsCF.ts",
3169
- "line": 157
3203
+ "line": 181
3170
3204
  },
3171
3205
  "name": "distro",
3172
3206
  "type": {
3173
3207
  "fqn": "aws-cdk-lib.aws_cloudfront.Distribution"
3174
3208
  }
3175
3209
  },
3210
+ {
3211
+ "abstract": true,
3212
+ "docs": {
3213
+ "stability": "experimental",
3214
+ "summary": "Edge lambdas to associate with the API Gateway routes."
3215
+ },
3216
+ "immutable": true,
3217
+ "locationInModule": {
3218
+ "filename": "src/MicroAppsCF.ts",
3219
+ "line": 226
3220
+ },
3221
+ "name": "apigwyEdgeFunctions",
3222
+ "optional": true,
3223
+ "type": {
3224
+ "collection": {
3225
+ "elementtype": {
3226
+ "fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
3227
+ },
3228
+ "kind": "array"
3229
+ }
3230
+ }
3231
+ },
3176
3232
  {
3177
3233
  "abstract": true,
3178
3234
  "docs": {
@@ -3184,7 +3240,7 @@
3184
3240
  "immutable": true,
3185
3241
  "locationInModule": {
3186
3242
  "filename": "src/MicroAppsCF.ts",
3187
- "line": 182
3243
+ "line": 206
3188
3244
  },
3189
3245
  "name": "createAPIPathRoute",
3190
3246
  "optional": true,
@@ -3192,6 +3248,25 @@
3192
3248
  "primitive": "boolean"
3193
3249
  }
3194
3250
  },
3251
+ {
3252
+ "abstract": true,
3253
+ "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
+ "stability": "experimental",
3257
+ "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."
3258
+ },
3259
+ "immutable": true,
3260
+ "locationInModule": {
3261
+ "filename": "src/MicroAppsCF.ts",
3262
+ "line": 221
3263
+ },
3264
+ "name": "createNextDataPathRoute",
3265
+ "optional": true,
3266
+ "type": {
3267
+ "primitive": "boolean"
3268
+ }
3269
+ },
3195
3270
  {
3196
3271
  "abstract": true,
3197
3272
  "docs": {
@@ -3202,7 +3277,7 @@
3202
3277
  "immutable": true,
3203
3278
  "locationInModule": {
3204
3279
  "filename": "src/MicroAppsCF.ts",
3205
- "line": 169
3280
+ "line": 193
3206
3281
  },
3207
3282
  "name": "rootPathPrefix",
3208
3283
  "optional": true,
@@ -3224,7 +3299,7 @@
3224
3299
  "kind": "interface",
3225
3300
  "locationInModule": {
3226
3301
  "filename": "src/MicroAppsCF.ts",
3227
- "line": 115
3302
+ "line": 139
3228
3303
  },
3229
3304
  "name": "CreateAPIOriginPolicyOptions",
3230
3305
  "properties": [
@@ -3239,7 +3314,7 @@
3239
3314
  "immutable": true,
3240
3315
  "locationInModule": {
3241
3316
  "filename": "src/MicroAppsCF.ts",
3242
- "line": 122
3317
+ "line": 146
3243
3318
  },
3244
3319
  "name": "assetNameRoot",
3245
3320
  "optional": true,
@@ -3258,7 +3333,7 @@
3258
3333
  "immutable": true,
3259
3334
  "locationInModule": {
3260
3335
  "filename": "src/MicroAppsCF.ts",
3261
- "line": 130
3336
+ "line": 154
3262
3337
  },
3263
3338
  "name": "assetNameSuffix",
3264
3339
  "optional": true,
@@ -3275,7 +3350,7 @@
3275
3350
  "immutable": true,
3276
3351
  "locationInModule": {
3277
3352
  "filename": "src/MicroAppsCF.ts",
3278
- "line": 137
3353
+ "line": 161
3279
3354
  },
3280
3355
  "name": "domainNameEdge",
3281
3356
  "optional": true,
@@ -3286,6 +3361,83 @@
3286
3361
  ],
3287
3362
  "symbolId": "src/MicroAppsCF:CreateAPIOriginPolicyOptions"
3288
3363
  },
3364
+ "@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions": {
3365
+ "assembly": "@pwrdrvr/microapps-cdk",
3366
+ "datatype": true,
3367
+ "docs": {
3368
+ "stability": "experimental"
3369
+ },
3370
+ "fqn": "@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions",
3371
+ "kind": "interface",
3372
+ "locationInModule": {
3373
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3374
+ "line": 102
3375
+ },
3376
+ "name": "GenerateEdgeToOriginConfigOptions",
3377
+ "properties": [
3378
+ {
3379
+ "abstract": true,
3380
+ "docs": {
3381
+ "stability": "experimental"
3382
+ },
3383
+ "immutable": true,
3384
+ "locationInModule": {
3385
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3386
+ "line": 105
3387
+ },
3388
+ "name": "addXForwardedHostHeader",
3389
+ "type": {
3390
+ "primitive": "boolean"
3391
+ }
3392
+ },
3393
+ {
3394
+ "abstract": true,
3395
+ "docs": {
3396
+ "stability": "experimental"
3397
+ },
3398
+ "immutable": true,
3399
+ "locationInModule": {
3400
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3401
+ "line": 103
3402
+ },
3403
+ "name": "originRegion",
3404
+ "type": {
3405
+ "primitive": "string"
3406
+ }
3407
+ },
3408
+ {
3409
+ "abstract": true,
3410
+ "docs": {
3411
+ "stability": "experimental"
3412
+ },
3413
+ "immutable": true,
3414
+ "locationInModule": {
3415
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3416
+ "line": 106
3417
+ },
3418
+ "name": "replaceHostHeader",
3419
+ "type": {
3420
+ "primitive": "boolean"
3421
+ }
3422
+ },
3423
+ {
3424
+ "abstract": true,
3425
+ "docs": {
3426
+ "stability": "experimental"
3427
+ },
3428
+ "immutable": true,
3429
+ "locationInModule": {
3430
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3431
+ "line": 104
3432
+ },
3433
+ "name": "signingMode",
3434
+ "type": {
3435
+ "primitive": "string"
3436
+ }
3437
+ }
3438
+ ],
3439
+ "symbolId": "src/MicroAppsEdgeToOrigin:GenerateEdgeToOriginConfigOptions"
3440
+ },
3289
3441
  "@pwrdrvr/microapps-cdk.IMicroApps": {
3290
3442
  "assembly": "@pwrdrvr/microapps-cdk",
3291
3443
  "docs": {
@@ -3296,7 +3448,7 @@
3296
3448
  "kind": "interface",
3297
3449
  "locationInModule": {
3298
3450
  "filename": "src/MicroApps.ts",
3299
- "line": 195
3451
+ "line": 258
3300
3452
  },
3301
3453
  "name": "IMicroApps",
3302
3454
  "properties": [
@@ -3309,7 +3461,7 @@
3309
3461
  "immutable": true,
3310
3462
  "locationInModule": {
3311
3463
  "filename": "src/MicroApps.ts",
3312
- "line": 206
3464
+ "line": 272
3313
3465
  },
3314
3466
  "name": "apigwy",
3315
3467
  "type": {
@@ -3325,7 +3477,7 @@
3325
3477
  "immutable": true,
3326
3478
  "locationInModule": {
3327
3479
  "filename": "src/MicroApps.ts",
3328
- "line": 197
3480
+ "line": 260
3329
3481
  },
3330
3482
  "name": "cf",
3331
3483
  "type": {
@@ -3341,7 +3493,7 @@
3341
3493
  "immutable": true,
3342
3494
  "locationInModule": {
3343
3495
  "filename": "src/MicroApps.ts",
3344
- "line": 200
3496
+ "line": 266
3345
3497
  },
3346
3498
  "name": "s3",
3347
3499
  "type": {
@@ -3357,12 +3509,29 @@
3357
3509
  "immutable": true,
3358
3510
  "locationInModule": {
3359
3511
  "filename": "src/MicroApps.ts",
3360
- "line": 203
3512
+ "line": 269
3361
3513
  },
3362
3514
  "name": "svcs",
3363
3515
  "type": {
3364
3516
  "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs"
3365
3517
  }
3518
+ },
3519
+ {
3520
+ "abstract": true,
3521
+ "docs": {
3522
+ "stability": "experimental",
3523
+ "summary": "{@inheritdoc IMicroAppsEdgeToOrigin}."
3524
+ },
3525
+ "immutable": true,
3526
+ "locationInModule": {
3527
+ "filename": "src/MicroApps.ts",
3528
+ "line": 263
3529
+ },
3530
+ "name": "edgeToOrigin",
3531
+ "optional": true,
3532
+ "type": {
3533
+ "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin"
3534
+ }
3366
3535
  }
3367
3536
  ],
3368
3537
  "symbolId": "src/MicroApps:IMicroApps"
@@ -3377,7 +3546,7 @@
3377
3546
  "kind": "interface",
3378
3547
  "locationInModule": {
3379
3548
  "filename": "src/MicroAppsAPIGwy.ts",
3380
- "line": 81
3549
+ "line": 89
3381
3550
  },
3382
3551
  "name": "IMicroAppsAPIGwy",
3383
3552
  "properties": [
@@ -3390,7 +3559,7 @@
3390
3559
  "immutable": true,
3391
3560
  "locationInModule": {
3392
3561
  "filename": "src/MicroAppsAPIGwy.ts",
3393
- "line": 90
3562
+ "line": 98
3394
3563
  },
3395
3564
  "name": "httpApi",
3396
3565
  "type": {
@@ -3406,7 +3575,7 @@
3406
3575
  "immutable": true,
3407
3576
  "locationInModule": {
3408
3577
  "filename": "src/MicroAppsAPIGwy.ts",
3409
- "line": 85
3578
+ "line": 93
3410
3579
  },
3411
3580
  "name": "dnAppsOrigin",
3412
3581
  "optional": true,
@@ -3427,19 +3596,20 @@
3427
3596
  "kind": "interface",
3428
3597
  "locationInModule": {
3429
3598
  "filename": "src/MicroAppsCF.ts",
3430
- "line": 17
3599
+ "line": 16
3431
3600
  },
3432
3601
  "name": "IMicroAppsCF",
3433
3602
  "properties": [
3434
3603
  {
3435
3604
  "abstract": true,
3436
3605
  "docs": {
3437
- "stability": "experimental"
3606
+ "stability": "experimental",
3607
+ "summary": "The CloudFront distribution."
3438
3608
  },
3439
3609
  "immutable": true,
3440
3610
  "locationInModule": {
3441
3611
  "filename": "src/MicroAppsCF.ts",
3442
- "line": 18
3612
+ "line": 20
3443
3613
  },
3444
3614
  "name": "cloudFrontDistro",
3445
3615
  "type": {
@@ -3449,6 +3619,70 @@
3449
3619
  ],
3450
3620
  "symbolId": "src/MicroAppsCF:IMicroAppsCF"
3451
3621
  },
3622
+ "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin": {
3623
+ "assembly": "@pwrdrvr/microapps-cdk",
3624
+ "docs": {
3625
+ "stability": "experimental",
3626
+ "summary": "Represents a MicroApps Edge to Origin Function."
3627
+ },
3628
+ "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
3629
+ "kind": "interface",
3630
+ "locationInModule": {
3631
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3632
+ "line": 15
3633
+ },
3634
+ "name": "IMicroAppsEdgeToOrigin",
3635
+ "properties": [
3636
+ {
3637
+ "abstract": true,
3638
+ "docs": {
3639
+ "remarks": "The generated `config.yml` is included in the Lambda's code.",
3640
+ "stability": "experimental",
3641
+ "summary": "The edge to origin function for API Gateway Request Origin Edge Lambda."
3642
+ },
3643
+ "immutable": true,
3644
+ "locationInModule": {
3645
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3646
+ "line": 21
3647
+ },
3648
+ "name": "edgeToOriginFunction",
3649
+ "type": {
3650
+ "union": {
3651
+ "types": [
3652
+ {
3653
+ "fqn": "aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction"
3654
+ },
3655
+ {
3656
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
3657
+ }
3658
+ ]
3659
+ }
3660
+ }
3661
+ },
3662
+ {
3663
+ "abstract": true,
3664
+ "docs": {
3665
+ "stability": "experimental",
3666
+ "summary": "Configuration of the edge to origin lambda functions."
3667
+ },
3668
+ "immutable": true,
3669
+ "locationInModule": {
3670
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
3671
+ "line": 26
3672
+ },
3673
+ "name": "edgeToOriginLambdas",
3674
+ "type": {
3675
+ "collection": {
3676
+ "elementtype": {
3677
+ "fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
3678
+ },
3679
+ "kind": "array"
3680
+ }
3681
+ }
3682
+ }
3683
+ ],
3684
+ "symbolId": "src/MicroAppsEdgeToOrigin:IMicroAppsEdgeToOrigin"
3685
+ },
3452
3686
  "@pwrdrvr/microapps-cdk.IMicroAppsS3": {
3453
3687
  "assembly": "@pwrdrvr/microapps-cdk",
3454
3688
  "docs": {
@@ -3556,7 +3790,7 @@
3556
3790
  "kind": "interface",
3557
3791
  "locationInModule": {
3558
3792
  "filename": "src/MicroAppsSvcs.ts",
3559
- "line": 153
3793
+ "line": 177
3560
3794
  },
3561
3795
  "name": "IMicroAppsSvcs",
3562
3796
  "properties": [
@@ -3569,7 +3803,7 @@
3569
3803
  "immutable": true,
3570
3804
  "locationInModule": {
3571
3805
  "filename": "src/MicroAppsSvcs.ts",
3572
- "line": 162
3806
+ "line": 186
3573
3807
  },
3574
3808
  "name": "deployerFunc",
3575
3809
  "type": {
@@ -3585,7 +3819,7 @@
3585
3819
  "immutable": true,
3586
3820
  "locationInModule": {
3587
3821
  "filename": "src/MicroAppsSvcs.ts",
3588
- "line": 167
3822
+ "line": 191
3589
3823
  },
3590
3824
  "name": "routerFunc",
3591
3825
  "type": {
@@ -3601,7 +3835,7 @@
3601
3835
  "immutable": true,
3602
3836
  "locationInModule": {
3603
3837
  "filename": "src/MicroAppsSvcs.ts",
3604
- "line": 157
3838
+ "line": 181
3605
3839
  },
3606
3840
  "name": "table",
3607
3841
  "type": {
@@ -3611,11 +3845,47 @@
3611
3845
  ],
3612
3846
  "symbolId": "src/MicroAppsSvcs:IMicroAppsSvcs"
3613
3847
  },
3848
+ "@pwrdrvr/microapps-cdk.IMicroAppsTable": {
3849
+ "assembly": "@pwrdrvr/microapps-cdk",
3850
+ "docs": {
3851
+ "stability": "experimental",
3852
+ "summary": "Represents a MicroAppsTable."
3853
+ },
3854
+ "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsTable",
3855
+ "kind": "interface",
3856
+ "locationInModule": {
3857
+ "filename": "src/MicroAppsTable.ts",
3858
+ "line": 52
3859
+ },
3860
+ "name": "IMicroAppsTable",
3861
+ "properties": [
3862
+ {
3863
+ "abstract": true,
3864
+ "docs": {
3865
+ "stability": "experimental",
3866
+ "summary": "DynamoDB table used by Router, Deployer, and Release console app."
3867
+ },
3868
+ "immutable": true,
3869
+ "locationInModule": {
3870
+ "filename": "src/MicroAppsTable.ts",
3871
+ "line": 56
3872
+ },
3873
+ "name": "table",
3874
+ "type": {
3875
+ "fqn": "aws-cdk-lib.aws_dynamodb.Table"
3876
+ }
3877
+ }
3878
+ ],
3879
+ "symbolId": "src/MicroAppsTable:IMicroAppsTable"
3880
+ },
3614
3881
  "@pwrdrvr/microapps-cdk.MicroApps": {
3615
3882
  "assembly": "@pwrdrvr/microapps-cdk",
3616
3883
  "base": "constructs.Construct",
3617
3884
  "docs": {
3618
- "remarks": "Use this construct to create a working entire stack.\n\nDo not use this construct when adding MicroApps to an existing\nCloudFront, API Gateway, S3 Bucket, etc. or where access\nto all features of the AWS Resources are needed (e.g. to\nadd additional Behaviors to the CloudFront distribution, set authorizors\non API Gateway, etc.).",
3885
+ "custom": {
3886
+ "warning": "This construct is not intended for production use.\nIn a production stack the DynamoDB Table, API Gateway, S3 Buckets,\netc. should be created in a \"durable\" stack where the IDs will not\nchange and where changes to the MicroApps construct will not\ncause failures to deploy or data to be deleted."
3887
+ },
3888
+ "remarks": "Use this construct to create a PoC working entire stack.\n\nDo not use this construct when adding MicroApps to an existing\nCloudFront, API Gateway, S3 Bucket, etc. or where access\nto all features of the AWS Resources are needed (e.g. to\nadd additional Behaviors to the CloudFront distribution, set authorizors\non API Gateway, etc.).",
3619
3889
  "see": "{@link https://github.com/pwrdrvr/microapps-core/blob/main/packages/cdk/lib/MicroApps.ts | example usage in a CDK Stack }",
3620
3890
  "stability": "experimental",
3621
3891
  "summary": "Create a new MicroApps \"turnkey\" construct for simple deployments and for initial evaulation of the MicroApps framework."
@@ -3627,7 +3897,7 @@
3627
3897
  },
3628
3898
  "locationInModule": {
3629
3899
  "filename": "src/MicroApps.ts",
3630
- "line": 244
3900
+ "line": 321
3631
3901
  },
3632
3902
  "parameters": [
3633
3903
  {
@@ -3657,7 +3927,7 @@
3657
3927
  "kind": "class",
3658
3928
  "locationInModule": {
3659
3929
  "filename": "src/MicroApps.ts",
3660
- "line": 223
3930
+ "line": 295
3661
3931
  },
3662
3932
  "name": "MicroApps",
3663
3933
  "properties": [
@@ -3669,7 +3939,7 @@
3669
3939
  "immutable": true,
3670
3940
  "locationInModule": {
3671
3941
  "filename": "src/MicroApps.ts",
3672
- "line": 235
3942
+ "line": 312
3673
3943
  },
3674
3944
  "name": "apigwy",
3675
3945
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -3685,7 +3955,7 @@
3685
3955
  "immutable": true,
3686
3956
  "locationInModule": {
3687
3957
  "filename": "src/MicroApps.ts",
3688
- "line": 225
3958
+ "line": 297
3689
3959
  },
3690
3960
  "name": "cf",
3691
3961
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -3701,7 +3971,7 @@
3701
3971
  "immutable": true,
3702
3972
  "locationInModule": {
3703
3973
  "filename": "src/MicroApps.ts",
3704
- "line": 230
3974
+ "line": 307
3705
3975
  },
3706
3976
  "name": "s3",
3707
3977
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
@@ -3717,13 +3987,30 @@
3717
3987
  "immutable": true,
3718
3988
  "locationInModule": {
3719
3989
  "filename": "src/MicroApps.ts",
3720
- "line": 240
3990
+ "line": 317
3721
3991
  },
3722
3992
  "name": "svcs",
3723
3993
  "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
3724
3994
  "type": {
3725
3995
  "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs"
3726
3996
  }
3997
+ },
3998
+ {
3999
+ "docs": {
4000
+ "stability": "experimental",
4001
+ "summary": "{@inheritdoc IMicroAppsEdgeToOrigin}."
4002
+ },
4003
+ "immutable": true,
4004
+ "locationInModule": {
4005
+ "filename": "src/MicroApps.ts",
4006
+ "line": 302
4007
+ },
4008
+ "name": "edgeToOrigin",
4009
+ "optional": true,
4010
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroApps",
4011
+ "type": {
4012
+ "fqn": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin"
4013
+ }
3727
4014
  }
3728
4015
  ],
3729
4016
  "symbolId": "src/MicroApps:MicroApps"
@@ -3733,7 +4020,7 @@
3733
4020
  "base": "constructs.Construct",
3734
4021
  "docs": {
3735
4022
  "stability": "experimental",
3736
- "summary": "Create a new MicroApps API Gateway HTTP API endpoint."
4023
+ "summary": "Create a new MicroApps API Gateway HTTP API endpoint, optionally requiring IAM authorization."
3737
4024
  },
3738
4025
  "fqn": "@pwrdrvr/microapps-cdk.MicroAppsAPIGwy",
3739
4026
  "initializer": {
@@ -3742,7 +4029,7 @@
3742
4029
  },
3743
4030
  "locationInModule": {
3744
4031
  "filename": "src/MicroAppsAPIGwy.ts",
3745
- "line": 107
4032
+ "line": 116
3746
4033
  },
3747
4034
  "parameters": [
3748
4035
  {
@@ -3759,7 +4046,6 @@
3759
4046
  },
3760
4047
  {
3761
4048
  "name": "props",
3762
- "optional": true,
3763
4049
  "type": {
3764
4050
  "fqn": "@pwrdrvr/microapps-cdk.MicroAppsAPIGwyProps"
3765
4051
  }
@@ -3772,7 +4058,7 @@
3772
4058
  "kind": "class",
3773
4059
  "locationInModule": {
3774
4060
  "filename": "src/MicroAppsAPIGwy.ts",
3775
- "line": 96
4061
+ "line": 105
3776
4062
  },
3777
4063
  "name": "MicroAppsAPIGwy",
3778
4064
  "properties": [
@@ -3784,7 +4070,7 @@
3784
4070
  "immutable": true,
3785
4071
  "locationInModule": {
3786
4072
  "filename": "src/MicroAppsAPIGwy.ts",
3787
- "line": 103
4073
+ "line": 112
3788
4074
  },
3789
4075
  "name": "httpApi",
3790
4076
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsAPIGwy",
@@ -3800,7 +4086,7 @@
3800
4086
  "immutable": true,
3801
4087
  "locationInModule": {
3802
4088
  "filename": "src/MicroAppsAPIGwy.ts",
3803
- "line": 98
4089
+ "line": 107
3804
4090
  },
3805
4091
  "name": "dnAppsOrigin",
3806
4092
  "optional": true,
@@ -3823,7 +4109,7 @@
3823
4109
  "kind": "interface",
3824
4110
  "locationInModule": {
3825
4111
  "filename": "src/MicroAppsAPIGwy.ts",
3826
- "line": 14
4112
+ "line": 15
3827
4113
  },
3828
4114
  "name": "MicroAppsAPIGwyProps",
3829
4115
  "properties": [
@@ -3838,7 +4124,7 @@
3838
4124
  "immutable": true,
3839
4125
  "locationInModule": {
3840
4126
  "filename": "src/MicroAppsAPIGwy.ts",
3841
- "line": 46
4127
+ "line": 47
3842
4128
  },
3843
4129
  "name": "assetNameRoot",
3844
4130
  "optional": true,
@@ -3857,7 +4143,7 @@
3857
4143
  "immutable": true,
3858
4144
  "locationInModule": {
3859
4145
  "filename": "src/MicroAppsAPIGwy.ts",
3860
- "line": 54
4146
+ "line": 55
3861
4147
  },
3862
4148
  "name": "assetNameSuffix",
3863
4149
  "optional": true,
@@ -3875,7 +4161,7 @@
3875
4161
  "immutable": true,
3876
4162
  "locationInModule": {
3877
4163
  "filename": "src/MicroAppsAPIGwy.ts",
3878
- "line": 62
4164
+ "line": 63
3879
4165
  },
3880
4166
  "name": "certOrigin",
3881
4167
  "optional": true,
@@ -3894,7 +4180,7 @@
3894
4180
  "immutable": true,
3895
4181
  "locationInModule": {
3896
4182
  "filename": "src/MicroAppsAPIGwy.ts",
3897
- "line": 30
4183
+ "line": 31
3898
4184
  },
3899
4185
  "name": "domainNameEdge",
3900
4186
  "optional": true,
@@ -3913,7 +4199,7 @@
3913
4199
  "immutable": true,
3914
4200
  "locationInModule": {
3915
4201
  "filename": "src/MicroAppsAPIGwy.ts",
3916
- "line": 38
4202
+ "line": 39
3917
4203
  },
3918
4204
  "name": "domainNameOrigin",
3919
4205
  "optional": true,
@@ -3930,7 +4216,7 @@
3930
4216
  "immutable": true,
3931
4217
  "locationInModule": {
3932
4218
  "filename": "src/MicroAppsAPIGwy.ts",
3933
- "line": 67
4219
+ "line": 68
3934
4220
  },
3935
4221
  "name": "r53Zone",
3936
4222
  "optional": true,
@@ -3949,7 +4235,7 @@
3949
4235
  "immutable": true,
3950
4236
  "locationInModule": {
3951
4237
  "filename": "src/MicroAppsAPIGwy.ts",
3952
- "line": 22
4238
+ "line": 23
3953
4239
  },
3954
4240
  "name": "removalPolicy",
3955
4241
  "optional": true,
@@ -3957,6 +4243,24 @@
3957
4243
  "fqn": "aws-cdk-lib.RemovalPolicy"
3958
4244
  }
3959
4245
  },
4246
+ {
4247
+ "abstract": true,
4248
+ "docs": {
4249
+ "default": "true",
4250
+ "stability": "experimental",
4251
+ "summary": "Require IAM auth on API Gateway."
4252
+ },
4253
+ "immutable": true,
4254
+ "locationInModule": {
4255
+ "filename": "src/MicroAppsAPIGwy.ts",
4256
+ "line": 83
4257
+ },
4258
+ "name": "requireIAMAuthorization",
4259
+ "optional": true,
4260
+ "type": {
4261
+ "primitive": "boolean"
4262
+ }
4263
+ },
3960
4264
  {
3961
4265
  "abstract": true,
3962
4266
  "docs": {
@@ -3968,7 +4272,7 @@
3968
4272
  "immutable": true,
3969
4273
  "locationInModule": {
3970
4274
  "filename": "src/MicroAppsAPIGwy.ts",
3971
- "line": 75
4275
+ "line": 76
3972
4276
  },
3973
4277
  "name": "rootPathPrefix",
3974
4278
  "optional": true,
@@ -3993,7 +4297,7 @@
3993
4297
  },
3994
4298
  "locationInModule": {
3995
4299
  "filename": "src/MicroAppsCF.ts",
3996
- "line": 306
4300
+ "line": 370
3997
4301
  },
3998
4302
  "parameters": [
3999
4303
  {
@@ -4022,7 +4326,7 @@
4022
4326
  "kind": "class",
4023
4327
  "locationInModule": {
4024
4328
  "filename": "src/MicroAppsCF.ts",
4025
- "line": 188
4329
+ "line": 232
4026
4330
  },
4027
4331
  "methods": [
4028
4332
  {
@@ -4032,7 +4336,7 @@
4032
4336
  },
4033
4337
  "locationInModule": {
4034
4338
  "filename": "src/MicroAppsCF.ts",
4035
- "line": 242
4339
+ "line": 291
4036
4340
  },
4037
4341
  "name": "addRoutes",
4038
4342
  "parameters": [
@@ -4059,18 +4363,18 @@
4059
4363
  },
4060
4364
  "locationInModule": {
4061
4365
  "filename": "src/MicroAppsCF.ts",
4062
- "line": 202
4366
+ "line": 246
4063
4367
  },
4064
4368
  "name": "createAPIOriginPolicy",
4065
4369
  "parameters": [
4066
4370
  {
4067
- "name": "scope",
4371
+ "name": "_scope",
4068
4372
  "type": {
4069
4373
  "fqn": "constructs.Construct"
4070
4374
  }
4071
4375
  },
4072
4376
  {
4073
- "name": "props",
4377
+ "name": "_props",
4074
4378
  "type": {
4075
4379
  "fqn": "@pwrdrvr/microapps-cdk.CreateAPIOriginPolicyOptions"
4076
4380
  }
@@ -4088,12 +4392,13 @@
4088
4392
  "properties": [
4089
4393
  {
4090
4394
  "docs": {
4091
- "stability": "experimental"
4395
+ "stability": "experimental",
4396
+ "summary": "The CloudFront distribution."
4092
4397
  },
4093
4398
  "immutable": true,
4094
4399
  "locationInModule": {
4095
4400
  "filename": "src/MicroAppsCF.ts",
4096
- "line": 302
4401
+ "line": 366
4097
4402
  },
4098
4403
  "name": "cloudFrontDistro",
4099
4404
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsCF",
@@ -4115,7 +4420,7 @@
4115
4420
  "kind": "interface",
4116
4421
  "locationInModule": {
4117
4422
  "filename": "src/MicroAppsCF.ts",
4118
- "line": 24
4423
+ "line": 26
4119
4424
  },
4120
4425
  "name": "MicroAppsCFProps",
4121
4426
  "properties": [
@@ -4128,7 +4433,7 @@
4128
4433
  "immutable": true,
4129
4434
  "locationInModule": {
4130
4435
  "filename": "src/MicroAppsCF.ts",
4131
- "line": 37
4436
+ "line": 39
4132
4437
  },
4133
4438
  "name": "bucketAppsOrigin",
4134
4439
  "type": {
@@ -4144,7 +4449,7 @@
4144
4449
  "immutable": true,
4145
4450
  "locationInModule": {
4146
4451
  "filename": "src/MicroAppsCF.ts",
4147
- "line": 63
4452
+ "line": 65
4148
4453
  },
4149
4454
  "name": "httpApi",
4150
4455
  "type": {
@@ -4162,7 +4467,7 @@
4162
4467
  "immutable": true,
4163
4468
  "locationInModule": {
4164
4469
  "filename": "src/MicroAppsCF.ts",
4165
- "line": 71
4470
+ "line": 73
4166
4471
  },
4167
4472
  "name": "assetNameRoot",
4168
4473
  "optional": true,
@@ -4181,7 +4486,7 @@
4181
4486
  "immutable": true,
4182
4487
  "locationInModule": {
4183
4488
  "filename": "src/MicroAppsCF.ts",
4184
- "line": 79
4489
+ "line": 81
4185
4490
  },
4186
4491
  "name": "assetNameSuffix",
4187
4492
  "optional": true,
@@ -4198,7 +4503,7 @@
4198
4503
  "immutable": true,
4199
4504
  "locationInModule": {
4200
4505
  "filename": "src/MicroAppsCF.ts",
4201
- "line": 42
4506
+ "line": 44
4202
4507
  },
4203
4508
  "name": "bucketLogs",
4204
4509
  "optional": true,
@@ -4215,7 +4520,7 @@
4215
4520
  "immutable": true,
4216
4521
  "locationInModule": {
4217
4522
  "filename": "src/MicroAppsCF.ts",
4218
- "line": 84
4523
+ "line": 86
4219
4524
  },
4220
4525
  "name": "certEdge",
4221
4526
  "optional": true,
@@ -4234,7 +4539,7 @@
4234
4539
  "immutable": true,
4235
4540
  "locationInModule": {
4236
4541
  "filename": "src/MicroAppsCF.ts",
4237
- "line": 109
4542
+ "line": 111
4238
4543
  },
4239
4544
  "name": "createAPIPathRoute",
4240
4545
  "optional": true,
@@ -4242,6 +4547,25 @@
4242
4547
  "primitive": "boolean"
4243
4548
  }
4244
4549
  },
4550
+ {
4551
+ "abstract": true,
4552
+ "docs": {
4553
+ "default": "true",
4554
+ "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.",
4555
+ "stability": "experimental",
4556
+ "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."
4557
+ },
4558
+ "immutable": true,
4559
+ "locationInModule": {
4560
+ "filename": "src/MicroAppsCF.ts",
4561
+ "line": 126
4562
+ },
4563
+ "name": "createNextDataPathRoute",
4564
+ "optional": true,
4565
+ "type": {
4566
+ "primitive": "boolean"
4567
+ }
4568
+ },
4245
4569
  {
4246
4570
  "abstract": true,
4247
4571
  "docs": {
@@ -4253,7 +4577,7 @@
4253
4577
  "immutable": true,
4254
4578
  "locationInModule": {
4255
4579
  "filename": "src/MicroAppsCF.ts",
4256
- "line": 50
4580
+ "line": 52
4257
4581
  },
4258
4582
  "name": "domainNameEdge",
4259
4583
  "optional": true,
@@ -4272,7 +4596,7 @@
4272
4596
  "immutable": true,
4273
4597
  "locationInModule": {
4274
4598
  "filename": "src/MicroAppsCF.ts",
4275
- "line": 58
4599
+ "line": 60
4276
4600
  },
4277
4601
  "name": "domainNameOrigin",
4278
4602
  "optional": true,
@@ -4280,6 +4604,31 @@
4280
4604
  "primitive": "string"
4281
4605
  }
4282
4606
  },
4607
+ {
4608
+ "abstract": true,
4609
+ "docs": {
4610
+ "custom": {
4611
+ "defaunt": "- no edge to API Gateway origin functions added"
4612
+ },
4613
+ "stability": "experimental",
4614
+ "summary": "Configuration of the edge to origin lambda functions."
4615
+ },
4616
+ "immutable": true,
4617
+ "locationInModule": {
4618
+ "filename": "src/MicroAppsCF.ts",
4619
+ "line": 133
4620
+ },
4621
+ "name": "edgeToOriginLambdas",
4622
+ "optional": true,
4623
+ "type": {
4624
+ "collection": {
4625
+ "elementtype": {
4626
+ "fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
4627
+ },
4628
+ "kind": "array"
4629
+ }
4630
+ }
4631
+ },
4283
4632
  {
4284
4633
  "abstract": true,
4285
4634
  "docs": {
@@ -4289,7 +4638,7 @@
4289
4638
  "immutable": true,
4290
4639
  "locationInModule": {
4291
4640
  "filename": "src/MicroAppsCF.ts",
4292
- "line": 89
4641
+ "line": 91
4293
4642
  },
4294
4643
  "name": "r53Zone",
4295
4644
  "optional": true,
@@ -4308,7 +4657,7 @@
4308
4657
  "immutable": true,
4309
4658
  "locationInModule": {
4310
4659
  "filename": "src/MicroAppsCF.ts",
4311
- "line": 32
4660
+ "line": 34
4312
4661
  },
4313
4662
  "name": "removalPolicy",
4314
4663
  "optional": true,
@@ -4326,7 +4675,7 @@
4326
4675
  "immutable": true,
4327
4676
  "locationInModule": {
4328
4677
  "filename": "src/MicroAppsCF.ts",
4329
- "line": 96
4678
+ "line": 98
4330
4679
  },
4331
4680
  "name": "rootPathPrefix",
4332
4681
  "optional": true,
@@ -4337,6 +4686,280 @@
4337
4686
  ],
4338
4687
  "symbolId": "src/MicroAppsCF:MicroAppsCFProps"
4339
4688
  },
4689
+ "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin": {
4690
+ "assembly": "@pwrdrvr/microapps-cdk",
4691
+ "base": "constructs.Construct",
4692
+ "docs": {
4693
+ "stability": "experimental",
4694
+ "summary": "Create a new MicroApps Edge to Origin Function w/ `config.yml`."
4695
+ },
4696
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOrigin",
4697
+ "initializer": {
4698
+ "docs": {
4699
+ "stability": "experimental"
4700
+ },
4701
+ "locationInModule": {
4702
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4703
+ "line": 135
4704
+ },
4705
+ "parameters": [
4706
+ {
4707
+ "name": "scope",
4708
+ "type": {
4709
+ "fqn": "constructs.Construct"
4710
+ }
4711
+ },
4712
+ {
4713
+ "name": "id",
4714
+ "type": {
4715
+ "primitive": "string"
4716
+ }
4717
+ },
4718
+ {
4719
+ "name": "props",
4720
+ "type": {
4721
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps"
4722
+ }
4723
+ }
4724
+ ]
4725
+ },
4726
+ "interfaces": [
4727
+ "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin"
4728
+ ],
4729
+ "kind": "class",
4730
+ "locationInModule": {
4731
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4732
+ "line": 112
4733
+ },
4734
+ "methods": [
4735
+ {
4736
+ "docs": {
4737
+ "returns": "",
4738
+ "stability": "experimental",
4739
+ "summary": "Generate the yaml config for the edge lambda."
4740
+ },
4741
+ "locationInModule": {
4742
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4743
+ "line": 118
4744
+ },
4745
+ "name": "generateEdgeToOriginConfig",
4746
+ "parameters": [
4747
+ {
4748
+ "name": "props",
4749
+ "type": {
4750
+ "fqn": "@pwrdrvr/microapps-cdk.GenerateEdgeToOriginConfigOptions"
4751
+ }
4752
+ }
4753
+ ],
4754
+ "returns": {
4755
+ "type": {
4756
+ "primitive": "string"
4757
+ }
4758
+ },
4759
+ "static": true
4760
+ }
4761
+ ],
4762
+ "name": "MicroAppsEdgeToOrigin",
4763
+ "properties": [
4764
+ {
4765
+ "docs": {
4766
+ "remarks": "The generated `config.yml` is included in the Lambda's code.",
4767
+ "stability": "experimental",
4768
+ "summary": "The edge to origin function for API Gateway Request Origin Edge Lambda."
4769
+ },
4770
+ "immutable": true,
4771
+ "locationInModule": {
4772
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4773
+ "line": 126
4774
+ },
4775
+ "name": "edgeToOriginFunction",
4776
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
4777
+ "type": {
4778
+ "union": {
4779
+ "types": [
4780
+ {
4781
+ "fqn": "aws-cdk-lib.aws_cloudfront.experimental.EdgeFunction"
4782
+ },
4783
+ {
4784
+ "fqn": "aws-cdk-lib.aws_lambda.Function"
4785
+ }
4786
+ ]
4787
+ }
4788
+ }
4789
+ },
4790
+ {
4791
+ "docs": {
4792
+ "stability": "experimental",
4793
+ "summary": "Configuration of the edge to origin lambda functions."
4794
+ },
4795
+ "immutable": true,
4796
+ "locationInModule": {
4797
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4798
+ "line": 131
4799
+ },
4800
+ "name": "edgeToOriginLambdas",
4801
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsEdgeToOrigin",
4802
+ "type": {
4803
+ "collection": {
4804
+ "elementtype": {
4805
+ "fqn": "aws-cdk-lib.aws_cloudfront.EdgeLambda"
4806
+ },
4807
+ "kind": "array"
4808
+ }
4809
+ }
4810
+ }
4811
+ ],
4812
+ "symbolId": "src/MicroAppsEdgeToOrigin:MicroAppsEdgeToOrigin"
4813
+ },
4814
+ "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps": {
4815
+ "assembly": "@pwrdrvr/microapps-cdk",
4816
+ "datatype": true,
4817
+ "docs": {
4818
+ "stability": "experimental",
4819
+ "summary": "Properties to initialize an instance of `MicroAppsEdgeToOrigin`."
4820
+ },
4821
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsEdgeToOriginProps",
4822
+ "kind": "interface",
4823
+ "locationInModule": {
4824
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4825
+ "line": 32
4826
+ },
4827
+ "name": "MicroAppsEdgeToOriginProps",
4828
+ "properties": [
4829
+ {
4830
+ "abstract": true,
4831
+ "docs": {
4832
+ "default": "true",
4833
+ "remarks": "Can only be trusted if `signingMode` is enabled, which restricts\naccess to API Gateway to only IAM signed requests.\n\nNote: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin",
4834
+ "stability": "experimental",
4835
+ "summary": "Adds an X-Forwarded-Host-Header when calling API Gateway."
4836
+ },
4837
+ "immutable": true,
4838
+ "locationInModule": {
4839
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4840
+ "line": 65
4841
+ },
4842
+ "name": "addXForwardedHostHeader",
4843
+ "optional": true,
4844
+ "type": {
4845
+ "primitive": "boolean"
4846
+ }
4847
+ },
4848
+ {
4849
+ "abstract": true,
4850
+ "docs": {
4851
+ "default": "- resource names auto assigned",
4852
+ "example": "microapps",
4853
+ "stability": "experimental",
4854
+ "summary": "Optional asset name root."
4855
+ },
4856
+ "immutable": true,
4857
+ "locationInModule": {
4858
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4859
+ "line": 46
4860
+ },
4861
+ "name": "assetNameRoot",
4862
+ "optional": true,
4863
+ "type": {
4864
+ "primitive": "string"
4865
+ }
4866
+ },
4867
+ {
4868
+ "abstract": true,
4869
+ "docs": {
4870
+ "default": "none",
4871
+ "example": "-dev-pr-12",
4872
+ "stability": "experimental",
4873
+ "summary": "Optional asset name suffix."
4874
+ },
4875
+ "immutable": true,
4876
+ "locationInModule": {
4877
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4878
+ "line": 54
4879
+ },
4880
+ "name": "assetNameSuffix",
4881
+ "optional": true,
4882
+ "type": {
4883
+ "primitive": "string"
4884
+ }
4885
+ },
4886
+ {
4887
+ "abstract": true,
4888
+ "docs": {
4889
+ "default": "undefined",
4890
+ "stability": "experimental",
4891
+ "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."
4892
+ },
4893
+ "immutable": true,
4894
+ "locationInModule": {
4895
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4896
+ "line": 99
4897
+ },
4898
+ "name": "originRegion",
4899
+ "optional": true,
4900
+ "type": {
4901
+ "primitive": "string"
4902
+ }
4903
+ },
4904
+ {
4905
+ "abstract": true,
4906
+ "docs": {
4907
+ "default": "- per resource default",
4908
+ "stability": "experimental",
4909
+ "summary": "RemovalPolicy override for child resources."
4910
+ },
4911
+ "immutable": true,
4912
+ "locationInModule": {
4913
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4914
+ "line": 38
4915
+ },
4916
+ "name": "removalPolicy",
4917
+ "optional": true,
4918
+ "type": {
4919
+ "fqn": "aws-cdk-lib.RemovalPolicy"
4920
+ }
4921
+ },
4922
+ {
4923
+ "abstract": true,
4924
+ "docs": {
4925
+ "default": "true",
4926
+ "remarks": "This is necessary when API Gateway has not been configured\nwith a custom domain name that matches the exact domain name used by the CloudFront\nDistribution AND when the OriginRequestPolicy.HeadersBehavior is set\nto pass all headers to the origin.\n\nNote: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin",
4927
+ "stability": "experimental",
4928
+ "summary": "Replaces Host header (which will be the Edge domain name) with the Origin domain name when enabled."
4929
+ },
4930
+ "immutable": true,
4931
+ "locationInModule": {
4932
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4933
+ "line": 77
4934
+ },
4935
+ "name": "replaceHostHeader",
4936
+ "optional": true,
4937
+ "type": {
4938
+ "primitive": "boolean"
4939
+ }
4940
+ },
4941
+ {
4942
+ "abstract": true,
4943
+ "docs": {
4944
+ "default": "'sign'",
4945
+ "remarks": "'sign' - Uses request headers for auth.\n'presign' - Uses query string for auth.\n\nIf enabled,\n\nNote: if 'sign' or 'presign', creates OriginRequest Lambda @ Edge function for API Gateway Origin",
4946
+ "stability": "experimental",
4947
+ "summary": "Requires IAM auth on the API Gateway origin if not set to 'none'."
4948
+ },
4949
+ "immutable": true,
4950
+ "locationInModule": {
4951
+ "filename": "src/MicroAppsEdgeToOrigin.ts",
4952
+ "line": 90
4953
+ },
4954
+ "name": "signingMode",
4955
+ "optional": true,
4956
+ "type": {
4957
+ "primitive": "string"
4958
+ }
4959
+ }
4960
+ ],
4961
+ "symbolId": "src/MicroAppsEdgeToOrigin:MicroAppsEdgeToOriginProps"
4962
+ },
4340
4963
  "@pwrdrvr/microapps-cdk.MicroAppsProps": {
4341
4964
  "assembly": "@pwrdrvr/microapps-cdk",
4342
4965
  "datatype": true,
@@ -4348,7 +4971,7 @@
4348
4971
  "kind": "interface",
4349
4972
  "locationInModule": {
4350
4973
  "filename": "src/MicroApps.ts",
4351
- "line": 36
4974
+ "line": 38
4352
4975
  },
4353
4976
  "name": "MicroAppsProps",
4354
4977
  "properties": [
@@ -4362,13 +4985,32 @@
4362
4985
  "immutable": true,
4363
4986
  "locationInModule": {
4364
4987
  "filename": "src/MicroApps.ts",
4365
- "line": 51
4988
+ "line": 53
4366
4989
  },
4367
4990
  "name": "appEnv",
4368
4991
  "type": {
4369
4992
  "primitive": "string"
4370
4993
  }
4371
4994
  },
4995
+ {
4996
+ "abstract": true,
4997
+ "docs": {
4998
+ "default": "true",
4999
+ "remarks": "Can only be trusted if `signingMode` is enabled, which restricts\naccess to API Gateway to only IAM signed requests.\n\nNote: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin",
5000
+ "stability": "experimental",
5001
+ "summary": "Adds an X-Forwarded-Host-Header when calling API Gateway."
5002
+ },
5003
+ "immutable": true,
5004
+ "locationInModule": {
5005
+ "filename": "src/MicroApps.ts",
5006
+ "line": 202
5007
+ },
5008
+ "name": "addXForwardedHostHeader",
5009
+ "optional": true,
5010
+ "type": {
5011
+ "primitive": "boolean"
5012
+ }
5013
+ },
4372
5014
  {
4373
5015
  "abstract": true,
4374
5016
  "docs": {
@@ -4380,7 +5022,7 @@
4380
5022
  "immutable": true,
4381
5023
  "locationInModule": {
4382
5024
  "filename": "src/MicroApps.ts",
4383
- "line": 59
5025
+ "line": 61
4384
5026
  },
4385
5027
  "name": "assetNameRoot",
4386
5028
  "optional": true,
@@ -4399,7 +5041,7 @@
4399
5041
  "immutable": true,
4400
5042
  "locationInModule": {
4401
5043
  "filename": "src/MicroApps.ts",
4402
- "line": 67
5044
+ "line": 69
4403
5045
  },
4404
5046
  "name": "assetNameSuffix",
4405
5047
  "optional": true,
@@ -4416,7 +5058,7 @@
4416
5058
  "immutable": true,
4417
5059
  "locationInModule": {
4418
5060
  "filename": "src/MicroApps.ts",
4419
- "line": 77
5061
+ "line": 79
4420
5062
  },
4421
5063
  "name": "certEdge",
4422
5064
  "optional": true,
@@ -4433,7 +5075,7 @@
4433
5075
  "immutable": true,
4434
5076
  "locationInModule": {
4435
5077
  "filename": "src/MicroApps.ts",
4436
- "line": 82
5078
+ "line": 84
4437
5079
  },
4438
5080
  "name": "certOrigin",
4439
5081
  "optional": true,
@@ -4452,7 +5094,7 @@
4452
5094
  "immutable": true,
4453
5095
  "locationInModule": {
4454
5096
  "filename": "src/MicroApps.ts",
4455
- "line": 189
5097
+ "line": 191
4456
5098
  },
4457
5099
  "name": "createAPIPathRoute",
4458
5100
  "optional": true,
@@ -4471,9 +5113,28 @@
4471
5113
  "immutable": true,
4472
5114
  "locationInModule": {
4473
5115
  "filename": "src/MicroApps.ts",
4474
- "line": 161
5116
+ "line": 163
5117
+ },
5118
+ "name": "domainNameEdge",
5119
+ "optional": true,
5120
+ "type": {
5121
+ "primitive": "string"
5122
+ }
5123
+ },
5124
+ {
5125
+ "abstract": true,
5126
+ "docs": {
5127
+ "default": "auto-assigned",
5128
+ "example": "apps-origin.pwrdrvr.com",
5129
+ "stability": "experimental",
5130
+ "summary": "Optional custom domain name for the API Gateway HTTPv2 API."
5131
+ },
5132
+ "immutable": true,
5133
+ "locationInModule": {
5134
+ "filename": "src/MicroApps.ts",
5135
+ "line": 171
4475
5136
  },
4476
- "name": "domainNameEdge",
5137
+ "name": "domainNameOrigin",
4477
5138
  "optional": true,
4478
5139
  "type": {
4479
5140
  "primitive": "string"
@@ -4482,17 +5143,16 @@
4482
5143
  {
4483
5144
  "abstract": true,
4484
5145
  "docs": {
4485
- "default": "auto-assigned",
4486
- "example": "apps-origin.pwrdrvr.com",
5146
+ "default": "undefined",
4487
5147
  "stability": "experimental",
4488
- "summary": "Optional custom domain name for the API Gateway HTTPv2 API."
5148
+ "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."
4489
5149
  },
4490
5150
  "immutable": true,
4491
5151
  "locationInModule": {
4492
5152
  "filename": "src/MicroApps.ts",
4493
- "line": 169
5153
+ "line": 236
4494
5154
  },
4495
- "name": "domainNameOrigin",
5155
+ "name": "originRegion",
4496
5156
  "optional": true,
4497
5157
  "type": {
4498
5158
  "primitive": "string"
@@ -4507,7 +5167,7 @@
4507
5167
  "immutable": true,
4508
5168
  "locationInModule": {
4509
5169
  "filename": "src/MicroApps.ts",
4510
- "line": 72
5170
+ "line": 74
4511
5171
  },
4512
5172
  "name": "r53Zone",
4513
5173
  "optional": true,
@@ -4526,7 +5186,7 @@
4526
5186
  "immutable": true,
4527
5187
  "locationInModule": {
4528
5188
  "filename": "src/MicroApps.ts",
4529
- "line": 44
5189
+ "line": 46
4530
5190
  },
4531
5191
  "name": "removalPolicy",
4532
5192
  "optional": true,
@@ -4534,6 +5194,25 @@
4534
5194
  "fqn": "aws-cdk-lib.RemovalPolicy"
4535
5195
  }
4536
5196
  },
5197
+ {
5198
+ "abstract": true,
5199
+ "docs": {
5200
+ "default": "true",
5201
+ "remarks": "This is necessary when API Gateway has not been configured\nwith a custom domain name that matches the exact domain name used by the CloudFront\nDistribution AND when the OriginRequestPolicy.HeadersBehavior is set\nto pass all headers to the origin.\n\nNote: if true, creates OriginRequest Lambda @ Edge function for API Gateway Origin",
5202
+ "stability": "experimental",
5203
+ "summary": "Replaces Host header (which will be the Edge domain name) with the Origin domain name when enabled."
5204
+ },
5205
+ "immutable": true,
5206
+ "locationInModule": {
5207
+ "filename": "src/MicroApps.ts",
5208
+ "line": 214
5209
+ },
5210
+ "name": "replaceHostHeader",
5211
+ "optional": true,
5212
+ "type": {
5213
+ "primitive": "boolean"
5214
+ }
5215
+ },
4537
5216
  {
4538
5217
  "abstract": true,
4539
5218
  "docs": {
@@ -4544,7 +5223,7 @@
4544
5223
  "immutable": true,
4545
5224
  "locationInModule": {
4546
5225
  "filename": "src/MicroApps.ts",
4547
- "line": 176
5226
+ "line": 178
4548
5227
  },
4549
5228
  "name": "rootPathPrefix",
4550
5229
  "optional": true,
@@ -4564,7 +5243,7 @@
4564
5243
  "immutable": true,
4565
5244
  "locationInModule": {
4566
5245
  "filename": "src/MicroApps.ts",
4567
- "line": 153
5246
+ "line": 155
4568
5247
  },
4569
5248
  "name": "s3PolicyBypassAROAs",
4570
5249
  "optional": true,
@@ -4589,7 +5268,7 @@
4589
5268
  "immutable": true,
4590
5269
  "locationInModule": {
4591
5270
  "filename": "src/MicroApps.ts",
4592
- "line": 110
5271
+ "line": 112
4593
5272
  },
4594
5273
  "name": "s3PolicyBypassPrincipalARNs",
4595
5274
  "optional": true,
@@ -4613,13 +5292,53 @@
4613
5292
  "immutable": true,
4614
5293
  "locationInModule": {
4615
5294
  "filename": "src/MicroApps.ts",
4616
- "line": 94
5295
+ "line": 96
4617
5296
  },
4618
5297
  "name": "s3StrictBucketPolicy",
4619
5298
  "optional": true,
4620
5299
  "type": {
4621
5300
  "primitive": "boolean"
4622
5301
  }
5302
+ },
5303
+ {
5304
+ "abstract": true,
5305
+ "docs": {
5306
+ "default": "'sign'",
5307
+ "remarks": "'sign' - Uses request headers for auth.\n'presign' - Uses query string for auth.\n\nIf enabled,\n\nNote: if 'sign' or 'presign', creates OriginRequest Lambda @ Edge function for API Gateway Origin",
5308
+ "stability": "experimental",
5309
+ "summary": "Requires IAM auth on the API Gateway origin if not set to 'none'."
5310
+ },
5311
+ "immutable": true,
5312
+ "locationInModule": {
5313
+ "filename": "src/MicroApps.ts",
5314
+ "line": 227
5315
+ },
5316
+ "name": "signingMode",
5317
+ "optional": true,
5318
+ "type": {
5319
+ "primitive": "string"
5320
+ }
5321
+ },
5322
+ {
5323
+ "abstract": true,
5324
+ "docs": {
5325
+ "custom": {
5326
+ "warning": "- It is *strongly* suggested that production stacks create\ntheir own DynamoDB Table and pass it into this construct, for protection\nagainst data loss due to logical ID changes, the ability to configure\nProvisioned capacity with Auto Scaling, the ability to add additional indices, etc.\n\nRequirements:\n- Hash Key: `PK`\n- Sort Key: `SK`"
5327
+ },
5328
+ "default": "created by construct",
5329
+ "stability": "experimental",
5330
+ "summary": "Existing table for apps/versions/rules."
5331
+ },
5332
+ "immutable": true,
5333
+ "locationInModule": {
5334
+ "filename": "src/MicroApps.ts",
5335
+ "line": 252
5336
+ },
5337
+ "name": "table",
5338
+ "optional": true,
5339
+ "type": {
5340
+ "fqn": "aws-cdk-lib.aws_dynamodb.ITable"
5341
+ }
4623
5342
  }
4624
5343
  ],
4625
5344
  "symbolId": "src/MicroApps:MicroAppsProps"
@@ -4628,8 +5347,9 @@
4628
5347
  "assembly": "@pwrdrvr/microapps-cdk",
4629
5348
  "base": "constructs.Construct",
4630
5349
  "docs": {
5350
+ "remarks": "These should be created in a stack that will not be deleted if\nthere are breaking changes to MicroApps in the future.",
4631
5351
  "stability": "experimental",
4632
- "summary": "Create a new MicroApps S3 Bucket."
5352
+ "summary": "Create the durable MicroApps S3 Buckets."
4633
5353
  },
4634
5354
  "fqn": "@pwrdrvr/microapps-cdk.MicroAppsS3",
4635
5355
  "initializer": {
@@ -4638,7 +5358,7 @@
4638
5358
  },
4639
5359
  "locationInModule": {
4640
5360
  "filename": "src/MicroAppsS3.ts",
4641
- "line": 117
5361
+ "line": 120
4642
5362
  },
4643
5363
  "parameters": [
4644
5364
  {
@@ -4668,7 +5388,7 @@
4668
5388
  "kind": "class",
4669
5389
  "locationInModule": {
4670
5390
  "filename": "src/MicroAppsS3.ts",
4671
- "line": 91
5391
+ "line": 94
4672
5392
  },
4673
5393
  "name": "MicroAppsS3",
4674
5394
  "properties": [
@@ -4680,7 +5400,7 @@
4680
5400
  "immutable": true,
4681
5401
  "locationInModule": {
4682
5402
  "filename": "src/MicroAppsS3.ts",
4683
- "line": 93
5403
+ "line": 96
4684
5404
  },
4685
5405
  "name": "bucketApps",
4686
5406
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
@@ -4696,7 +5416,7 @@
4696
5416
  "immutable": true,
4697
5417
  "locationInModule": {
4698
5418
  "filename": "src/MicroAppsS3.ts",
4699
- "line": 98
5419
+ "line": 101
4700
5420
  },
4701
5421
  "name": "bucketAppsOAI",
4702
5422
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
@@ -4712,7 +5432,7 @@
4712
5432
  "immutable": true,
4713
5433
  "locationInModule": {
4714
5434
  "filename": "src/MicroAppsS3.ts",
4715
- "line": 103
5435
+ "line": 106
4716
5436
  },
4717
5437
  "name": "bucketAppsOrigin",
4718
5438
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
@@ -4728,7 +5448,7 @@
4728
5448
  "immutable": true,
4729
5449
  "locationInModule": {
4730
5450
  "filename": "src/MicroAppsS3.ts",
4731
- "line": 108
5451
+ "line": 111
4732
5452
  },
4733
5453
  "name": "bucketAppsStaging",
4734
5454
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
@@ -4744,7 +5464,7 @@
4744
5464
  "immutable": true,
4745
5465
  "locationInModule": {
4746
5466
  "filename": "src/MicroAppsS3.ts",
4747
- "line": 113
5467
+ "line": 116
4748
5468
  },
4749
5469
  "name": "bucketLogs",
4750
5470
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsS3",
@@ -4898,7 +5618,7 @@
4898
5618
  },
4899
5619
  "locationInModule": {
4900
5620
  "filename": "src/MicroAppsSvcs.ts",
4901
- "line": 190
5621
+ "line": 215
4902
5622
  },
4903
5623
  "parameters": [
4904
5624
  {
@@ -4928,7 +5648,7 @@
4928
5648
  "kind": "class",
4929
5649
  "locationInModule": {
4930
5650
  "filename": "src/MicroAppsSvcs.ts",
4931
- "line": 174
5651
+ "line": 198
4932
5652
  },
4933
5653
  "name": "MicroAppsSvcs",
4934
5654
  "properties": [
@@ -4940,7 +5660,7 @@
4940
5660
  "immutable": true,
4941
5661
  "locationInModule": {
4942
5662
  "filename": "src/MicroAppsSvcs.ts",
4943
- "line": 181
5663
+ "line": 206
4944
5664
  },
4945
5665
  "name": "deployerFunc",
4946
5666
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs",
@@ -4956,7 +5676,7 @@
4956
5676
  "immutable": true,
4957
5677
  "locationInModule": {
4958
5678
  "filename": "src/MicroAppsSvcs.ts",
4959
- "line": 186
5679
+ "line": 211
4960
5680
  },
4961
5681
  "name": "routerFunc",
4962
5682
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs",
@@ -4972,7 +5692,7 @@
4972
5692
  "immutable": true,
4973
5693
  "locationInModule": {
4974
5694
  "filename": "src/MicroAppsSvcs.ts",
4975
- "line": 176
5695
+ "line": 201
4976
5696
  },
4977
5697
  "name": "table",
4978
5698
  "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsSvcs",
@@ -4994,7 +5714,7 @@
4994
5714
  "kind": "interface",
4995
5715
  "locationInModule": {
4996
5716
  "filename": "src/MicroAppsSvcs.ts",
4997
- "line": 18
5717
+ "line": 19
4998
5718
  },
4999
5719
  "name": "MicroAppsSvcsProps",
5000
5720
  "properties": [
@@ -5007,7 +5727,7 @@
5007
5727
  "immutable": true,
5008
5728
  "locationInModule": {
5009
5729
  "filename": "src/MicroAppsSvcs.ts",
5010
- "line": 52
5730
+ "line": 53
5011
5731
  },
5012
5732
  "name": "appEnv",
5013
5733
  "type": {
@@ -5023,7 +5743,7 @@
5023
5743
  "immutable": true,
5024
5744
  "locationInModule": {
5025
5745
  "filename": "src/MicroAppsSvcs.ts",
5026
- "line": 31
5746
+ "line": 32
5027
5747
  },
5028
5748
  "name": "bucketApps",
5029
5749
  "type": {
@@ -5039,7 +5759,7 @@
5039
5759
  "immutable": true,
5040
5760
  "locationInModule": {
5041
5761
  "filename": "src/MicroAppsSvcs.ts",
5042
- "line": 36
5762
+ "line": 37
5043
5763
  },
5044
5764
  "name": "bucketAppsOAI",
5045
5765
  "type": {
@@ -5055,7 +5775,7 @@
5055
5775
  "immutable": true,
5056
5776
  "locationInModule": {
5057
5777
  "filename": "src/MicroAppsSvcs.ts",
5058
- "line": 41
5778
+ "line": 42
5059
5779
  },
5060
5780
  "name": "bucketAppsStaging",
5061
5781
  "type": {
@@ -5071,7 +5791,7 @@
5071
5791
  "immutable": true,
5072
5792
  "locationInModule": {
5073
5793
  "filename": "src/MicroAppsSvcs.ts",
5074
- "line": 46
5794
+ "line": 47
5075
5795
  },
5076
5796
  "name": "httpApi",
5077
5797
  "type": {
@@ -5089,7 +5809,7 @@
5089
5809
  "immutable": true,
5090
5810
  "locationInModule": {
5091
5811
  "filename": "src/MicroAppsSvcs.ts",
5092
- "line": 60
5812
+ "line": 61
5093
5813
  },
5094
5814
  "name": "assetNameRoot",
5095
5815
  "optional": true,
@@ -5108,7 +5828,7 @@
5108
5828
  "immutable": true,
5109
5829
  "locationInModule": {
5110
5830
  "filename": "src/MicroAppsSvcs.ts",
5111
- "line": 68
5831
+ "line": 69
5112
5832
  },
5113
5833
  "name": "assetNameSuffix",
5114
5834
  "optional": true,
@@ -5127,7 +5847,7 @@
5127
5847
  "immutable": true,
5128
5848
  "locationInModule": {
5129
5849
  "filename": "src/MicroAppsSvcs.ts",
5130
- "line": 26
5850
+ "line": 27
5131
5851
  },
5132
5852
  "name": "removalPolicy",
5133
5853
  "optional": true,
@@ -5135,6 +5855,24 @@
5135
5855
  "fqn": "aws-cdk-lib.RemovalPolicy"
5136
5856
  }
5137
5857
  },
5858
+ {
5859
+ "abstract": true,
5860
+ "docs": {
5861
+ "default": "true",
5862
+ "stability": "experimental",
5863
+ "summary": "Require IAM auth on API Gateway."
5864
+ },
5865
+ "immutable": true,
5866
+ "locationInModule": {
5867
+ "filename": "src/MicroAppsSvcs.ts",
5868
+ "line": 155
5869
+ },
5870
+ "name": "requireIAMAuthorization",
5871
+ "optional": true,
5872
+ "type": {
5873
+ "primitive": "boolean"
5874
+ }
5875
+ },
5138
5876
  {
5139
5877
  "abstract": true,
5140
5878
  "docs": {
@@ -5146,7 +5884,7 @@
5146
5884
  "immutable": true,
5147
5885
  "locationInModule": {
5148
5886
  "filename": "src/MicroAppsSvcs.ts",
5149
- "line": 147
5887
+ "line": 148
5150
5888
  },
5151
5889
  "name": "rootPathPrefix",
5152
5890
  "optional": true,
@@ -5166,7 +5904,7 @@
5166
5904
  "immutable": true,
5167
5905
  "locationInModule": {
5168
5906
  "filename": "src/MicroAppsSvcs.ts",
5169
- "line": 139
5907
+ "line": 140
5170
5908
  },
5171
5909
  "name": "s3PolicyBypassAROAs",
5172
5910
  "optional": true,
@@ -5191,7 +5929,7 @@
5191
5929
  "immutable": true,
5192
5930
  "locationInModule": {
5193
5931
  "filename": "src/MicroAppsSvcs.ts",
5194
- "line": 96
5932
+ "line": 97
5195
5933
  },
5196
5934
  "name": "s3PolicyBypassPrincipalARNs",
5197
5935
  "optional": true,
@@ -5215,18 +5953,216 @@
5215
5953
  "immutable": true,
5216
5954
  "locationInModule": {
5217
5955
  "filename": "src/MicroAppsSvcs.ts",
5218
- "line": 80
5956
+ "line": 81
5219
5957
  },
5220
5958
  "name": "s3StrictBucketPolicy",
5221
5959
  "optional": true,
5222
5960
  "type": {
5223
5961
  "primitive": "boolean"
5224
5962
  }
5963
+ },
5964
+ {
5965
+ "abstract": true,
5966
+ "docs": {
5967
+ "custom": {
5968
+ "warning": "- It is *strongly* suggested that production stacks create\ntheir own DynamoDB Table and pass it into this construct, for protection\nagainst data loss due to logical ID changes, the ability to configure\nProvisioned capacity with Auto Scaling, the ability to add additional indices, etc.\n\nRequirements:\n- Hash Key: `PK`\n- Sort Key: `SK`"
5969
+ },
5970
+ "default": "created by construct",
5971
+ "stability": "experimental",
5972
+ "summary": "Existing table for apps/versions/rules."
5973
+ },
5974
+ "immutable": true,
5975
+ "locationInModule": {
5976
+ "filename": "src/MicroAppsSvcs.ts",
5977
+ "line": 171
5978
+ },
5979
+ "name": "table",
5980
+ "optional": true,
5981
+ "type": {
5982
+ "fqn": "aws-cdk-lib.aws_dynamodb.ITable"
5983
+ }
5225
5984
  }
5226
5985
  ],
5227
5986
  "symbolId": "src/MicroAppsSvcs:MicroAppsSvcsProps"
5987
+ },
5988
+ "@pwrdrvr/microapps-cdk.MicroAppsTable": {
5989
+ "assembly": "@pwrdrvr/microapps-cdk",
5990
+ "base": "constructs.Construct",
5991
+ "docs": {
5992
+ "stability": "experimental",
5993
+ "summary": "Create a new MicroApps Table for apps / versions / rules."
5994
+ },
5995
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsTable",
5996
+ "initializer": {
5997
+ "docs": {
5998
+ "stability": "experimental"
5999
+ },
6000
+ "locationInModule": {
6001
+ "filename": "src/MicroAppsTable.ts",
6002
+ "line": 68
6003
+ },
6004
+ "parameters": [
6005
+ {
6006
+ "name": "scope",
6007
+ "type": {
6008
+ "fqn": "constructs.Construct"
6009
+ }
6010
+ },
6011
+ {
6012
+ "name": "id",
6013
+ "type": {
6014
+ "primitive": "string"
6015
+ }
6016
+ },
6017
+ {
6018
+ "name": "props",
6019
+ "optional": true,
6020
+ "type": {
6021
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsTableProps"
6022
+ }
6023
+ }
6024
+ ]
6025
+ },
6026
+ "interfaces": [
6027
+ "@pwrdrvr/microapps-cdk.IMicroAppsTable"
6028
+ ],
6029
+ "kind": "class",
6030
+ "locationInModule": {
6031
+ "filename": "src/MicroAppsTable.ts",
6032
+ "line": 62
6033
+ },
6034
+ "name": "MicroAppsTable",
6035
+ "properties": [
6036
+ {
6037
+ "docs": {
6038
+ "stability": "experimental",
6039
+ "summary": "DynamoDB table used by Router, Deployer, and Release console app."
6040
+ },
6041
+ "immutable": true,
6042
+ "locationInModule": {
6043
+ "filename": "src/MicroAppsTable.ts",
6044
+ "line": 64
6045
+ },
6046
+ "name": "table",
6047
+ "overrides": "@pwrdrvr/microapps-cdk.IMicroAppsTable",
6048
+ "type": {
6049
+ "fqn": "aws-cdk-lib.aws_dynamodb.Table"
6050
+ }
6051
+ }
6052
+ ],
6053
+ "symbolId": "src/MicroAppsTable:MicroAppsTable"
6054
+ },
6055
+ "@pwrdrvr/microapps-cdk.MicroAppsTableProps": {
6056
+ "assembly": "@pwrdrvr/microapps-cdk",
6057
+ "datatype": true,
6058
+ "docs": {
6059
+ "stability": "experimental",
6060
+ "summary": "Properties to initialize an instance of `MicroAppsTable`."
6061
+ },
6062
+ "fqn": "@pwrdrvr/microapps-cdk.MicroAppsTableProps",
6063
+ "kind": "interface",
6064
+ "locationInModule": {
6065
+ "filename": "src/MicroAppsTable.ts",
6066
+ "line": 8
6067
+ },
6068
+ "name": "MicroAppsTableProps",
6069
+ "properties": [
6070
+ {
6071
+ "abstract": true,
6072
+ "docs": {
6073
+ "stability": "experimental",
6074
+ "summary": "Application environment, passed as `NODE_ENV` to the Router and Deployer Lambda functions."
6075
+ },
6076
+ "immutable": true,
6077
+ "locationInModule": {
6078
+ "filename": "src/MicroAppsTable.ts",
6079
+ "line": 22
6080
+ },
6081
+ "name": "appEnv",
6082
+ "type": {
6083
+ "primitive": "string"
6084
+ }
6085
+ },
6086
+ {
6087
+ "abstract": true,
6088
+ "docs": {
6089
+ "default": "- resource names auto assigned",
6090
+ "example": "microapps",
6091
+ "stability": "experimental",
6092
+ "summary": "Optional asset name root."
6093
+ },
6094
+ "immutable": true,
6095
+ "locationInModule": {
6096
+ "filename": "src/MicroAppsTable.ts",
6097
+ "line": 30
6098
+ },
6099
+ "name": "assetNameRoot",
6100
+ "optional": true,
6101
+ "type": {
6102
+ "primitive": "string"
6103
+ }
6104
+ },
6105
+ {
6106
+ "abstract": true,
6107
+ "docs": {
6108
+ "default": "none",
6109
+ "example": "-dev-pr-12",
6110
+ "stability": "experimental",
6111
+ "summary": "Optional asset name suffix."
6112
+ },
6113
+ "immutable": true,
6114
+ "locationInModule": {
6115
+ "filename": "src/MicroAppsTable.ts",
6116
+ "line": 38
6117
+ },
6118
+ "name": "assetNameSuffix",
6119
+ "optional": true,
6120
+ "type": {
6121
+ "primitive": "string"
6122
+ }
6123
+ },
6124
+ {
6125
+ "abstract": true,
6126
+ "docs": {
6127
+ "default": "- per resource default",
6128
+ "remarks": "Note: if set to DESTROY the S3 buckes will have `autoDeleteObjects` set to `true`",
6129
+ "stability": "experimental",
6130
+ "summary": "RemovalPolicy override for child resources."
6131
+ },
6132
+ "immutable": true,
6133
+ "locationInModule": {
6134
+ "filename": "src/MicroAppsTable.ts",
6135
+ "line": 16
6136
+ },
6137
+ "name": "removalPolicy",
6138
+ "optional": true,
6139
+ "type": {
6140
+ "fqn": "aws-cdk-lib.RemovalPolicy"
6141
+ }
6142
+ },
6143
+ {
6144
+ "abstract": true,
6145
+ "docs": {
6146
+ "default": "none",
6147
+ "example": "dev/",
6148
+ "stability": "experimental",
6149
+ "summary": "Path prefix on the root of the deployment."
6150
+ },
6151
+ "immutable": true,
6152
+ "locationInModule": {
6153
+ "filename": "src/MicroAppsTable.ts",
6154
+ "line": 46
6155
+ },
6156
+ "name": "rootPathPrefix",
6157
+ "optional": true,
6158
+ "type": {
6159
+ "primitive": "string"
6160
+ }
6161
+ }
6162
+ ],
6163
+ "symbolId": "src/MicroAppsTable:MicroAppsTableProps"
5228
6164
  }
5229
6165
  },
5230
- "version": "0.2.10",
5231
- "fingerprint": "cf+x3bDx5LxzTnbJaUgh6qyjhyDT8VAtswrEHtMJhqk="
6166
+ "version": "0.2.11",
6167
+ "fingerprint": "2pfJZCKSJIr9Tun1hbwzpkcAtPzke8YGGzasGMSQ+F4="
5232
6168
  }