@pwrdrvr/microapps-cdk 0.0.10 → 0.0.15
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/.gitattributes +18 -16
- package/.jsii +4 -4
- package/API.md +0 -0
- package/README.md +1 -1
- package/lib/MicroApps.js +1 -1
- package/lib/microapps-deployer/index.js +61 -60
- package/lib/microapps-deployer/index.js.map +3 -3
- package/lib/microapps-router/index.js +50 -49
- package/lib/microapps-router/index.js.map +3 -3
- package/lib/microapps-router/templates/appFrame.html +0 -0
- package/package.json +23 -19
package/.gitattributes
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
# ~~ Generated by projen. To modify, edit .projenrc.js and run "npx projen".
|
|
2
2
|
|
|
3
|
-
/.eslintrc.json
|
|
4
|
-
/.gitattributes
|
|
5
|
-
/.github/pull_request_template.md
|
|
6
|
-
/.github/workflows/build.yml
|
|
7
|
-
/.github/workflows/
|
|
8
|
-
/.github/workflows/
|
|
9
|
-
/.github/workflows/
|
|
10
|
-
/.
|
|
11
|
-
/.
|
|
12
|
-
/.
|
|
13
|
-
/.
|
|
14
|
-
/.projen
|
|
15
|
-
/.projen/
|
|
16
|
-
/
|
|
17
|
-
/
|
|
18
|
-
/
|
|
3
|
+
/.eslintrc.json linguist-generated
|
|
4
|
+
/.gitattributes linguist-generated
|
|
5
|
+
/.github/pull_request_template.md linguist-generated
|
|
6
|
+
/.github/workflows/build.yml linguist-generated
|
|
7
|
+
/.github/workflows/pull-request-lint.yml linguist-generated
|
|
8
|
+
/.github/workflows/release.yml linguist-generated
|
|
9
|
+
/.github/workflows/stale.yml linguist-generated
|
|
10
|
+
/.github/workflows/upgrade-main.yml linguist-generated
|
|
11
|
+
/.gitignore linguist-generated
|
|
12
|
+
/.mergify.yml linguist-generated
|
|
13
|
+
/.npmignore linguist-generated
|
|
14
|
+
/.projen/** linguist-generated
|
|
15
|
+
/.projen/deps.json linguist-generated
|
|
16
|
+
/.projen/tasks.json linguist-generated
|
|
17
|
+
/LICENSE linguist-generated
|
|
18
|
+
/package-lock.json linguist-generated
|
|
19
|
+
/package.json linguist-generated
|
|
20
|
+
/tsconfig.dev.json linguist-generated
|
package/.jsii
CHANGED
|
@@ -1239,7 +1239,7 @@
|
|
|
1239
1239
|
},
|
|
1240
1240
|
"name": "@pwrdrvr/microapps-cdk",
|
|
1241
1241
|
"readme": {
|
|
1242
|
-
"markdown": "# Overview\n\nThe MicroApps project...\n\n# Project Layout\n\n- [src/cdk]() - CDK Stacks\n - MicroAppsS3\n - Creates S3 buckets\n - MicroAppsRepos\n - Creates the ECR repos for components to be published into;\n - Deployer\n - Router\n - MicroAppsSvcs\n - Create DynamoDB table\n - Create Deployer Lambda function\n - Create Router Lambda function\n - Create APIGateway HTTP API\n - MicroAppsCF\n - Creates Cloudfront distribution\n - MicroAppsR53\n - Creates domain names to point to the edge (Cloudfront) and origin (API Gateway)\n- [src/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- [src/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 - Permissions required:\n - Lambda invoke\n - S3 publish to the staging bucket\n - ECR write\n - Lambda version publish\n- [src/microapps-router]()\n - Lambda function that determines which version of an app to point a user to on a particular invocation\n\n# Useful Commands\n\n- `npm run build` compiles TypeSript to JavaScript\n- `npm run lint` checks TypeScript for compliance with Lint rules\n- `cdk list` list the stack names\n- `cdk deploy` deploy this stack to your default AWS account/region\n- `cdk diff` compare deployed stack with current state\n- `cdk synth` emits the synthesized CloudFormation template\n\n# Running CDK\n\nAlways run CDK from the root of the git repo, which is the directory containing `cdk.json`.\n\n## Set AWS Profile\n\n`export AWS_PROFILE=pwrdrvr`\n\n## Set NVM Version\n\n`nvm use`\n\n# Deployer Service\n\nCopies static assets from staging to deployed directory, creates record of application / version in DynamoDB Table.\n\n## Build and Deploy Update\n\n```\nmake aws-ecr-login\nmake aws-ecr-publish-deployer\nmake aws-lambda-update-deployer\n```\n\n# Notes on Selection of Docker Image Lambdas\n\nThe Router and Deployer services are very small (0.5 MB) after tree shaking, minification, and uglification performed by `rollup`. The router has the tightest performance requirement and performed just as well as a docker image vs a zip file. However, docker image start up is up to 2x longer vs the zip file for the router; this should not be a problem for any live system with continuous usage and for demos the router can be initialized or pre-provisioned beforehand. The development benefits of docker images for Lambda outweigh the small init time impact on cold starts.\n\n# Notes on Performance\n\n## Router\n\nFor best demo performance (and real user performance), the memory for the Router Lambda should be set to 1024 MB as this gives the
|
|
1242
|
+
"markdown": "# Overview\n\nThe MicroApps project...\n\n# Project Layout\n\n- [src/cdk]() - CDK Stacks\n - MicroAppsS3\n - Creates S3 buckets\n - MicroAppsRepos\n - Creates the ECR repos for components to be published into;\n - Deployer\n - Router\n - MicroAppsSvcs\n - Create DynamoDB table\n - Create Deployer Lambda function\n - Create Router Lambda function\n - Create APIGateway HTTP API\n - MicroAppsCF\n - Creates Cloudfront distribution\n - MicroAppsR53\n - Creates domain names to point to the edge (Cloudfront) and origin (API Gateway)\n- [src/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- [src/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 - Permissions required:\n - Lambda invoke\n - S3 publish to the staging bucket\n - ECR write\n - Lambda version publish\n- [src/microapps-router]()\n - Lambda function that determines which version of an app to point a user to on a particular invocation\n\n# Useful Commands\n\n- `npm run build` compiles TypeSript to JavaScript\n- `npm run lint` checks TypeScript for compliance with Lint rules\n- `cdk list` list the stack names\n- `cdk deploy` deploy this stack to your default AWS account/region\n- `cdk diff` compare deployed stack with current state\n- `cdk synth` emits the synthesized CloudFormation template\n\n# Running CDK\n\nAlways run CDK from the root of the git repo, which is the directory containing `cdk.json`.\n\n## Set AWS Profile\n\n`export AWS_PROFILE=pwrdrvr`\n\n## Set NVM Version\n\n`nvm use`\n\n# Deployer Service\n\nCopies static assets from staging to deployed directory, creates record of application / version in DynamoDB Table.\n\n## Build and Deploy Update\n\n```\nmake aws-ecr-login\nmake aws-ecr-publish-deployer\nmake aws-lambda-update-deployer\n```\n\n# Notes on Selection of Docker Image Lambdas\n\nThe Router and Deployer services are very small (0.5 MB) after tree shaking, minification, and uglification performed by `rollup`. The router has the tightest performance requirement and performed just as well as a docker image vs a zip file. However, docker image start up is up to 2x longer vs the zip file for the router; this should not be a problem for any live system with continuous usage and for demos the router can be initialized or pre-provisioned beforehand. The development benefits of docker images for Lambda outweigh the small init time impact on cold starts.\n\n# Notes on Performance\n\n## Router\n\nFor best demo performance (and real user performance), the memory for the Router Lambda should be set to 1024 MB as this gives the fastest cold start at the lowest cost. The cost per warm request is actually lower at 1024 MB than at 128 MB, so 1024 MB is just the ideal size.\n\nFor supremely optimum demo performance the Router Lambda should be deployed as a .zip file as that saves about 50% of the cold start time, or about 200 ms, but once it's the cold start has happened they are equally as fast as each other.\n\n- Lambda Memory (which linearly scales CPU) Speeds\n - Docker Image Lambda\n - Note: All times captured with Rollup ~400 KB Docker Layer\n - 128 MB\n - Duration Warm: 118 ms\n - Duration Cold: 763 ms\n - Init Duration: 518 ms\n - Billed Duration Warm: 119 ms\n - Billed Duration Init: 1,282 ms\n - Warm Cost: 0.025 millicents\n - Init Cost: 0.26 millicents\n - 256 MB\n - Duration Warm: 30 ms\n - Duration Cold: 363 ms\n - Init Duration: 488 ms\n - Billed Duration Warm: 30 ms\n - Billed Duration Init: 853 ms\n - Warm Cost: 0.013 millicents\n - Init Cost: 0.36 millicents\n - 512 MB\n - Duration Warm: 10 ms\n - Duration Cold: 176 ms\n - Init Duration: 572 ms\n - Billed Duration Warm: 10 ms\n - Billed Duration Init: 749 ms\n - Warm Cost: 0.0083 millicents\n - Init Cost: 0.62 millicents\n - 1024 MB\n - Duration Warm: 9 ms\n - Duration Cold: 84.5 ms\n - Init Duration: 497 ms\n - Billed Duration Warm: 9 ms\n - Billed Duration Init: 585 ms\n - Warm Cost: 0.015 millicents\n - Init Cost: 0.97 millicents\n - _Init performance scales linearly up to and including 1024 MB_\n - 1769 MB\n - This is the point at which a Lambda has 100% of 1 CPU\n - https://docs.aws.amazon.com/lambda/latest/dg/configuration-memory.html\n - Duration Warm: 8.31 ms\n - Duration Cold: 73 ms\n - Init Duration: 514 ms\n - Billed Duration Warm: 10 ms\n - Billed Duration Cold: 587 ms\n - Warm Cost: 0.029 millicents\n - Init Cost: 1.7 millicents\n - 2048 MB\n - Duration Warm: 10 ms\n - Duration Cold: 67 ms\n - Init Duration: 497 ms\n - Billed Duration Warm: 11 ms\n - Billed Duration Init: 566 ms\n - Warm Cost: 0.037 millicents\n - Init Cost: 1.89 millicents\n - Zip File Lambda\n - 128 MB\n - Duration Warm: 110 ms\n - Duration Cold: 761 ms\n - Init Duration: 210 ms\n - Billed Duration Warm: 120 ms\n - Billed Duration Init: 762 ms\n - Warm Cost: 0.025 millicents\n - Init Cost: 0.16 millicents\n - 512 MB\n - Duration Warm: 10 ms\n - Duration Cold: 179 ms\n - Init Duration: 201 ms\n - Billed Duration Warm: 12 ms\n - Billed Duration Init: 185 ms\n - Warm Cost: 0.01 millicents\n - Init Cost: 0.15 millicents\n - 1024 MB\n - Duration Warm: 10 ms\n - Duration Cold: 85 ms\n - Init Duration: 185 ms\n - Billed Duration Warm: 12 ms\n - Billed Duration Init: 85 ms\n - Warm Cost: 0.02 millicents\n - Init Cost: 0.14 millicents\n"
|
|
1243
1243
|
},
|
|
1244
1244
|
"repository": {
|
|
1245
1245
|
"type": "git",
|
|
@@ -1253,7 +1253,7 @@
|
|
|
1253
1253
|
},
|
|
1254
1254
|
"java": {
|
|
1255
1255
|
"maven": {
|
|
1256
|
-
"artifactId": "cdk",
|
|
1256
|
+
"artifactId": "microapps-cdk",
|
|
1257
1257
|
"groupId": "com.pwrdrvr.microapps"
|
|
1258
1258
|
},
|
|
1259
1259
|
"package": "com.pwrdrvr.microapps.cdk"
|
|
@@ -1585,6 +1585,6 @@
|
|
|
1585
1585
|
]
|
|
1586
1586
|
}
|
|
1587
1587
|
},
|
|
1588
|
-
"version": "0.0.
|
|
1589
|
-
"fingerprint": "
|
|
1588
|
+
"version": "0.0.15",
|
|
1589
|
+
"fingerprint": "5BrsYudjm+GO9zE5+N8vgsS1RUX90jF7RCwp4FT3d7c="
|
|
1590
1590
|
}
|
package/API.md
CHANGED
|
File without changes
|
package/README.md
CHANGED
|
@@ -73,7 +73,7 @@ The Router and Deployer services are very small (0.5 MB) after tree shaking, min
|
|
|
73
73
|
|
|
74
74
|
## Router
|
|
75
75
|
|
|
76
|
-
For best demo performance (and real user performance), the memory for the Router Lambda should be set to 1024 MB as this gives the
|
|
76
|
+
For best demo performance (and real user performance), the memory for the Router Lambda should be set to 1024 MB as this gives the fastest cold start at the lowest cost. The cost per warm request is actually lower at 1024 MB than at 128 MB, so 1024 MB is just the ideal size.
|
|
77
77
|
|
|
78
78
|
For supremely optimum demo performance the Router Lambda should be deployed as a .zip file as that saves about 50% of the cold start time, or about 200 ms, but once it's the cold start has happened they are equally as fast as each other.
|
|
79
79
|
|
package/lib/MicroApps.js
CHANGED
|
@@ -73,5 +73,5 @@ class MicroApps extends cdk.Construct {
|
|
|
73
73
|
}
|
|
74
74
|
exports.MicroApps = MicroApps;
|
|
75
75
|
_a = JSII_RTTI_SYMBOL_1;
|
|
76
|
-
MicroApps[_a] = { fqn: "@pwrdrvr/microapps-cdk.MicroApps", version: "0.0.
|
|
76
|
+
MicroApps[_a] = { fqn: "@pwrdrvr/microapps-cdk.MicroApps", version: "0.0.15" };
|
|
77
77
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWljcm9BcHBzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL01pY3JvQ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BhcyBjZGsgZnJvbSAnQGF3cy1jZGsvY29yZSc7XG5pbXBvcnQgeyBNaWNyb0FwcHNDRiB9IGZyb20gJy4vTWljcm9BcHBzQ0YnO1xuaW1wb3J0IHsgTWljcm9BcHBzUzMgfSBmcm9tICcuL01pY3JvQXBwc1MzJztcbmltcG9ydCB7IE1pY3JvQXBwc1N2Y3MgfSBmcm9tICcuL01pY3JvQXBwc1N2Y3MnO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbmV4cG9ydCBpbnRlcmZhY2UgTWljcm9BcHBzUHJvcHMge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGF1dG9EZWxldGVFdmVyeXRoaW5nPzogYm9vbGVhbjtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGFwcEVudjogc3RyaW5nO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGFzc2V0TmFtZVJvb3Q6IHN0cmluZztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgYXNzZXROYW1lU3VmZml4Pzogc3RyaW5nO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBkb21haW5OYW1lOiBzdHJpbmc7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSByNTNab25lTmFtZTogc3RyaW5nO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSByNTNab25lSUQ6IHN0cmluZztcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBjZXJ0RWRnZTogYWNtLklDZXJ0aWZpY2F0ZTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBjZXJ0T3JpZ2luOiBhY20uSUNlcnRpZmljYXRlO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgczNQb2xpY3lCeXBhc3NSb2xlTmFtZTogc3RyaW5nO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgczNQb2xpY3lCeXBhc3NBUk9BOiBzdHJpbmc7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFxuICByZWFkb25seSBhY2NvdW50OiBzdHJpbmc7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IHJlZ2lvbjogc3RyaW5nO1xuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG4gIHJlYWRvbmx5IGRvbWFpbk5hbWVFZGdlOiBzdHJpbmc7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcbiAgcmVhZG9ubHkgZG9tYWluTmFtZU9yaWdpbjogc3RyaW5nO1xufVxuXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXG5leHBvcnQgY2xhc3MgTWljcm9BcHBzIGV4dGVuZHMgY2RrLkNvbnN0cnVjdCB7XG4gIC8vIGlucHV0IGxpa2UgJ2V4YW1wbGUuY29tLicgd2lsbCByZXR1cm4gYXMgJ2NvbS5leGFtcGxlJ1xuICBwcml2YXRlIHN0YXRpYyByZXZlcnNlRG9tYWluKGRvbWFpbjogc3RyaW5nKTogc3RyaW5nIHtcbiAgICBsZXQgcGFydHMgPSBkb21haW4uc3BsaXQoJy4nKS5yZXZlcnNlKCk7XG4gICAgaWYgKHBhcnRzWzBdID09PSAnJykge1xuICAgICAgcGFydHMgPSBwY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