@ashishpandeyone/cdk-lambda-web-function 0.1.1 → 0.1.3
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 +1520 -130
- package/.jsii.tabl.json +1 -1
- package/API.md +1612 -124
- package/README.md +151 -7
- package/assets/web-function-deployment/index.js +58 -0
- package/assets/web-function-provider/index.js +26 -26
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -1
- package/lib/nodejs-web-function.js +1 -1
- package/lib/private/metrics.d.ts +23 -0
- package/lib/private/metrics.js +49 -0
- package/lib/private/provider-protocol.d.ts +57 -0
- package/lib/private/provider-protocol.js +13 -2
- package/lib/private/provider.d.ts +3 -3
- package/lib/private/provider.js +16 -6
- package/lib/private/regional-alarm.d.ts +23 -0
- package/lib/private/regional-alarm.js +40 -0
- package/lib/private/revision-cleanup.d.ts +19 -0
- package/lib/private/revision-cleanup.js +38 -0
- package/lib/private/rollback.d.ts +9 -0
- package/lib/private/rollback.js +3 -0
- package/lib/private/traffic-shift.d.ts +22 -0
- package/lib/private/traffic-shift.js +144 -0
- package/lib/web-function-deployment.d.ts +153 -0
- package/lib/web-function-deployment.js +125 -0
- package/lib/web-function-endpoint.d.ts +168 -19
- package/lib/web-function-endpoint.js +292 -18
- package/lib/web-function-grants.d.ts +2 -2
- package/lib/web-function-grants.js +4 -4
- package/lib/web-function-revision.d.ts +45 -0
- package/lib/web-function-revision.js +40 -0
- package/lib/web-function.d.ts +69 -9
- package/lib/web-function.js +130 -26
- package/package.json +5 -2
package/.jsii
CHANGED
|
@@ -9745,7 +9745,7 @@
|
|
|
9745
9745
|
},
|
|
9746
9746
|
"name": "@ashishpandeyone/cdk-lambda-web-function",
|
|
9747
9747
|
"readme": {
|
|
9748
|
-
"markdown": "# CDK constructs for AWS Lambda Web Functions\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n[AWS Lambda Web Functions](https://aws.amazon.com/lambda/) run an ordinary Node.js HTTP server (Express, Fastify, Hono, `node:http`) on Lambda and give it an HTTPS endpoint, optionally served from several regions. `WebFunction` deploys one, following the conventions of `aws-cdk-lib/aws-lambda` where the two services overlap.\n\n```ts fixture=bare\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\nconst fn = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n endpoint: {\n endpointType: WebFunctionEndpointType.MULTI_REGION,\n regions: ['us-east-1', 'eu-west-1'],\n },\n});\n\nnew CfnOutput(this, 'Url', { value: fn.endpoint.url }); // https://<id>.lambda-web.global.on.aws\n```\n\nThe stack's region is the function's **home region**. Multi-region endpoints need a stack with an explicit `env.region`.\n\n## Writing the server\n\n1. Listen on the host and port in **`AWS_LAMBDA_HTTP_ENDPOINT`** (`0.0.0.0:3000` today). `PORT` is not set.\n2. Start listening within **about 9 seconds**, or initialisation fails with `Application.TimeoutListenError`.\n3. Put the entry file at the root of your bundle as **`index.js`**, or set `entrypoint`.\n4. The runtime has **no AWS SDK**: bundle the clients you import.\n5. Code runs on **arm64**.\n\n```js\nconst express = require('express');\n\nconst app = express();\napp.get('/', (req, res) => res.json({ hello: 'world', region: process.env.AWS_REGION }));\n\nconst [host, port] = process.env.AWS_LAMBDA_HTTP_ENDPOINT.split(':');\napp.listen(Number(port), host);\n```\n\nRequests carry `lambda-web-request-id` and `lambda-web-endpoint-name` headers.\n\n## Regions and endpoints\n\nEach `WebFunction` has one endpoint, `fn.endpoint`:\n\n| `endpointType` | URL | Routing |\n|---|---|---|\n| `HOME_REGION` (default) | `https://<id>.<cell>.lambda-web.<home>.on.aws` | home region only |\n| `MULTI_REGION` | one global `https://<id>.lambda-web.global.on.aws` | nearest region |\n| `PER_REGION` | one URL per region, from `fn.endpoint.regionalUrl(region)` | the region in the hostname |\n\n```ts\nconst perRegion = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n endpoint: {\n endpointType: WebFunctionEndpointType.PER_REGION,\n regions: ['us-east-1', 'eu-west-1'],\n },\n});\n\nnew CfnOutput(this, 'UsEast1Url', { value: perRegion.endpoint.regionalUrl('us-east-1') });\n// perRegion.endpoint.regions is ['<home region>', 'eu-west-1', 'us-east-1']\n```\n\n- `MULTI_REGION` and `PER_REGION` need at least one region besides the home region; `HOME_REGION` takes none.\n- A MultiRegion endpoint takes about a minute to create.\n\n### Changing regions or the endpoint type\n\nAn endpoint's type and regions can't change in place: a change creates a **new endpoint with a new URL**, and the old one is deleted once the new one is live. Two endpoints of one function can't share a name, so:\n\n| `endpointName` | Physical name | Changing `regions` or `endpointType` |\n|---|---|---|\n| omitted (recommended) | `default-<hash of type and regions>` | works: new endpoint, new URL |\n| set, e.g. `'live'` | `live` | also change the name in the same deployment, or it fails with *The endpoint live already exists* (the stack rolls back and the old endpoint keeps serving) |\n\nThe construct warns at synth time when `endpointName` is set.\n\n## Authentication and invoking\n\n| `authType` | Meaning |\n|---|---|\n| `AWS_IAM` | Callers sign requests (SigV4 or SigV4a, signing name `lambda`) and need `lambda:InvokeWebFunctionEndpoint` |\n| `NONE` | **Public**: Lambda does no authentication; your application does (JWT, sessions). The `Authorization` header reaches your application untouched. The construct warns at synth time |\n\n```ts\nfn.grants.invoke(consumerRole); // or fn.grantInvoke(consumerRole), as on lambda.Function\n```\n\nThe grant is on the endpoint's home-region ARN, which IAM evaluates in every region the endpoint serves from, including the global URL.\n\n| Endpoint | How to sign |\n|---|---|\n| `HOME_REGION` | SigV4 for the home region |\n| `PER_REGION` | SigV4 for the hostname's region, or SigV4a |\n| `MULTI_REGION` | **SigV4a with region set `*`**: you can't know which region will serve the request |\n\n```js\nimport { SignatureV4a } from '@smithy/signature-v4a';\nimport { Sha256 } from '@aws-crypto/sha256-js';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\n\nconst signer = new SignatureV4a({ service: 'lambda', region: '*', sha256: Sha256, credentials: fromNodeProviderChain() });\nconst signed = await signer.sign(\n { method: 'GET', protocol: 'https:', hostname: host, path: '/', headers: { host } },\n { signingRegion: '*' },\n);\nconst response = await fetch(`https://${host}/`, { headers: signed.headers });\n```\n\n## Configuration\n\n```ts\nconst api = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('build'),\n authType: WebFunctionAuthType.AWS_IAM,\n entrypoint: 'server.js', // default index.js\n webFunctionName: 'orders-api', // default: generated from the construct path\n description: 'Orders HTTP API',\n environment: { TABLE_NAME: table.tableName },\n timeout: Duration.seconds(60), // per request: 3 seconds to 15 minutes, default 30 seconds\n maxConcurrencyPerEnvironment: 32, // requests per environment at once: 1-128, default 64\n});\n\napi.addEnvironment('FEATURE_FLAG', 'on');\ntable.grantReadWriteData(api); // the default role trusts lambda.amazonaws.com\n```\n\n- Requests handled by one environment share module-level state, so keep handlers concurrency-safe.\n- Environment variable names starting with `AWS_` are reserved.\n- **Renaming the function replaces it and changes its URL.** A generated name depends on the construct path, so moving the construct renames it too.\n\n### Bundling TypeScript with `NodejsWebFunction`\n\n`NodejsWebFunction` is a `WebFunction` that bundles your server from a TypeScript or JavaScript entry file with esbuild, like `NodejsFunction` does for Lambda functions:\n\n```ts\nnew NodejsWebFunction(this, 'Api', {\n entry: 'src/server.ts',\n authType: WebFunctionAuthType.AWS_IAM,\n bundling: {\n minify: true, // default true\n sourceMap: true, // default true\n format: lambdaNodejs.OutputFormat.ESM, // default ESM (index.mjs); CJS gives index.js\n externalModules: [], // default: bundle everything you import\n },\n});\n```\n\n- **Defaults:** `runtime` is `NODEJS_24_X`, and the esbuild target follows the runtime (`node24`). The project root is the directory of the nearest lock file above `entry` (override it with `depsLockFilePath` or `projectRoot`).\n- **It also sets what a `lambda.Code` can't:** the entry point that matches the bundle, and `NODE_OPTIONS=--enable-source-maps` when source maps are on, appended to any `NODE_OPTIONS` you set, so stack traces point at your `.ts` files (e.g. `/var/task/src/server.ts:22:12`). Source map paths are relative to the project root, so no build-machine paths are deployed.\n- **ESM bundles include a `require` shim**, so CommonJS dependencies that load Node.js built-ins (Express, for example) work.\n- **The AWS SDK is bundled like any other dependency**, since the runtime has none. Only the clients you import are included.\n- **Bundling runs locally** when esbuild is installed in your project, and otherwise in Docker (an arm64 AWS SAM build image; set `forceDockerBundling` to always use Docker).\n- **Not yet supported:** installing native modules next to the bundle (`nodeModules`) and command hooks. For native dependencies, use `WebFunction` with `Code.fromAsset(..., { bundling: { image, command } })`.\n\n### Code\n\n`code` takes any `lambda.Code` that produces a zip in S3: `fromAsset`, `fromBucket`/`fromBucketV2`, `fromCustomCommand`, `fromDockerBuild`. Inline code and container images fail at synth time.\n\nLambda Web Functions download code as the `lambda.amazonaws.com` service principal, from a **versioned** bucket, and the CDK bootstrap bucket allows neither. So each stack gets a small code bucket, and the code is copied into it on deploy.\n\n### Updates\n\nAny change to code or configuration creates a new **revision**. The endpoint switches to it once it's ready, and the old revision is deleted after the deployment succeeds; a failed deployment rolls back to it. If nothing changed, nothing is deployed.\n\n## Logs in every region\n\nWeb Functions log in two tiers:\n\n```text\n every serving region home region\n ┌──────────────────┐ ┌──────────────────────────────────────────┐\n │ <group>.local │── copied ───►│ <group> every region's logs │\n │ (that region's │ (seconds) │ streams …[rev]<instance>-<acct>-<region> │\n │ environments) │ │ <group>.local (home-region traffic) │\n └──────────────────┘ └──────────────────────────────────────────┘\n```\n\n**Query `fn.logGroup`**, the home-region group that receives every region's logs. The service would create missing groups without retention and never delete them, so the construct creates and owns all of them: both home-region groups, and `<group>.local` in every other region of the endpoint.\n\n```ts\nnew WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n logRetention: logs.RetentionDays.THREE_MONTHS, // default ONE_MONTH, every group in every region\n logRemovalPolicy: RemovalPolicy.DESTROY, // default RETAIN\n applicationLogLevelV2: lambda.ApplicationLogLevel.WARN,\n systemLogLevelV2: lambda.SystemLogLevel.INFO, // DEBUG, INFO or WARN\n});\n```\n\n- The default group is `/aws/lambda/web/<function name>`. Log lines are JSON; application lines carry `requestId`, `endpointName` and `region`.\n- Every event is stored twice (`.local` plus the home-region copy), so expect about double log ingestion, plus cross-region transfer.\n- With `DESTROY`, deletion waits about a minute after the function is gone, because environments flush their last lines late.\n- Subscribe only to `fn.logGroup`: subscribing to the `.local` groups as well delivers every event twice.\n\n## Limitations\n\n- One endpoint per function; no traffic splitting between revisions.\n- Not yet supported: importing existing functions, VPC access (network connectors), resource-policy permissions, KMS encryption, metrics helpers, tracing, and a CloudFront origin.\n- `cdk deploy --hotswap` and `cdk watch` don't support Web Functions.\n- Quotas per account and region: 50 revisions and 10 endpoints per function, 200 Arm vCPUs, 10,000 requests per second.\n- The stack's custom resource provider Lambda keeps its own log group after the stack is deleted, as with other CDK custom resources.\n\n## Development\n\nTooling is pinned in `mise.toml` (Node 24, AWS CDK CLI). Personal settings, such as the AWS profile for the live end-to-end tests, go in a git-ignored `mise.local.toml`.\n\n```bash\nmise install\nnpx projen build # compile, unit tests, lint, API docs\nnpx projen e2e # deploy, verify and destroy real stacks in three regions (needs AWS credentials)\n```\n"
|
|
9748
|
+
"markdown": "# CDK constructs for AWS Lambda Web Functions\n\n<!--BEGIN STABILITY BANNER-->\n\n---\n\n\n\n> The APIs of higher level constructs in this module are experimental and under active development.\n> They are subject to non-backward compatible changes or removal in any future version. These are\n> not subject to the [Semantic Versioning](https://semver.org/) model and breaking changes will be\n> announced in the release notes. This means that while you may use them, you may need to update\n> your source code when upgrading to a newer version of this package.\n\n---\n\n<!--END STABILITY BANNER-->\n\n[AWS Lambda Web Functions](https://aws.amazon.com/lambda/) run an ordinary Node.js HTTP server (Express, Fastify, Hono, `node:http`) on Lambda and give it an HTTPS endpoint, optionally served from several regions. `WebFunction` deploys one, following the conventions of `aws-cdk-lib/aws-lambda` where the two services overlap.\n\n```ts fixture=bare\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\nconst fn = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n endpoint: {\n endpointType: WebFunctionEndpointType.MULTI_REGION,\n regions: ['us-east-1', 'eu-west-1'],\n },\n});\n\nnew CfnOutput(this, 'Url', { value: fn.endpoint.url }); // https://<id>.lambda-web.global.on.aws\n```\n\nThe stack's region is the function's **home region**. Multi-region endpoints need a stack with an explicit `env.region`.\n\n## Writing the server\n\n1. Listen on the host and port in **`AWS_LAMBDA_HTTP_ENDPOINT`** (`0.0.0.0:3000` today). `PORT` is not set.\n2. Start listening within **about 9 seconds**, or initialisation fails with `Application.TimeoutListenError`.\n3. Put the entry file at the root of your bundle as **`index.js`**, or set `entrypoint`.\n4. The runtime has **no AWS SDK**: bundle the clients you import.\n5. Code runs on **arm64**.\n\n```js\nconst express = require('express');\n\nconst app = express();\napp.get('/', (req, res) => res.json({ hello: 'world', region: process.env.AWS_REGION }));\n\nconst [host, port] = process.env.AWS_LAMBDA_HTTP_ENDPOINT.split(':');\napp.listen(Number(port), host);\n```\n\nRequests carry `lambda-web-request-id` and `lambda-web-endpoint-name` headers.\n\n## Regions and endpoints\n\nEach `WebFunction` has a default endpoint, `fn.endpoint`, configured with the `endpoint` property. [Add more](#more-endpoints) with `fn.addEndpoint()`.\n\n| `endpointType` | URL | Routing |\n|---|---|---|\n| `HOME_REGION` (default) | `https://<id>.<cell>.lambda-web.<home>.on.aws` | home region only |\n| `MULTI_REGION` | one global `https://<id>.lambda-web.global.on.aws` | nearest region |\n| `PER_REGION` | one URL per region, from `fn.endpoint.regionalUrl(region)` | the region in the hostname |\n\n```ts\nconst perRegion = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n endpoint: {\n endpointType: WebFunctionEndpointType.PER_REGION,\n regions: ['us-east-1', 'eu-west-1'],\n },\n});\n\nnew CfnOutput(this, 'UsEast1Url', { value: perRegion.endpoint.regionalUrl('us-east-1') });\n// perRegion.endpoint.regions is ['<home region>', 'eu-west-1', 'us-east-1']\n```\n\n- `MULTI_REGION` and `PER_REGION` need at least one region besides the home region; `HOME_REGION` takes none.\n- A MultiRegion endpoint takes about a minute to create.\n- Lambda routes a `MULTI_REGION` endpoint by latency, not by health: it doesn't fail over when a region has problems.\n\n### More endpoints\n\nA function can have up to 10 endpoints, each with its own URL, authentication, regions and limits. For example, a public endpoint next to an IAM-only global one:\n\n```ts\nconst api = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.NONE, // the default endpoint is public\n endpoint: { rateLimit: 1000 }, // requests per second\n});\n\nconst internal = api.addEndpoint('Internal', {\n authType: WebFunctionAuthType.AWS_IAM,\n endpointType: WebFunctionEndpointType.MULTI_REGION,\n regions: ['us-east-1', 'eu-west-1'],\n description: 'Service-to-service traffic',\n maxEnvironments: 50,\n});\ninternal.grantInvoke(consumerRole);\nnew CfnOutput(this, 'InternalUrl', { value: internal.url });\n```\n\n- `rateLimit` takes 0 (blocks all traffic), 100–1,000 in steps of 100, or 2,000–10,000 in steps of 1,000; excess requests get HTTP 429. `maxEnvironments` takes 2–10,000.\n- **Both limits apply separately in each region** an endpoint serves from: a 3-region endpoint with `rateLimit: 1000` accepts up to 1,000 requests per second in each region.\n- Endpoints can serve the same regions. The construct owns one `.local` log group per region, whichever endpoints serve it.\n\n### Changing regions or the endpoint type\n\nAn endpoint's type and regions can't change in place: a change creates a **new endpoint with a new URL**, and the old one is deleted once the new one is live. Two endpoints of one function can't share a name, so:\n\n| `endpointName` | Physical name | Changing `regions` or `endpointType` |\n|---|---|---|\n| omitted (recommended) | `default-<hash>` for `fn.endpoint`, `<id>-<hash>` for added endpoints; the hash covers the type and regions | works: new endpoint, new URL |\n| set, e.g. `'live'` | `live` | also change the name in the same deployment, or it fails with *The endpoint live already exists* (the stack rolls back and the old endpoint keeps serving) |\n\nThe construct warns at synth time when `endpointName` is set.\n\n## Authentication and invoking\n\n| `authType` | Meaning |\n|---|---|\n| `AWS_IAM` | Callers sign requests (SigV4 or SigV4a, signing name `lambda`) and need `lambda:InvokeWebFunctionEndpoint` |\n| `NONE` | **Public**: Lambda does no authentication; your application does (JWT, sessions). The `Authorization` header reaches your application untouched. The construct warns at synth time |\n\n```ts\nfn.grants.invoke(consumerRole); // or fn.grantInvoke(consumerRole), as on lambda.Function\n```\n\nThe grant is on the endpoint's home-region ARN, which IAM evaluates in every region the endpoint serves from, including the global URL. `fn.grants` covers the default endpoint only; grant other endpoints with their own `grantInvoke()` or `grants.invoke()`.\n\n| Endpoint | How to sign |\n|---|---|\n| `HOME_REGION` | SigV4 for the home region |\n| `PER_REGION` | SigV4 for the hostname's region, or SigV4a |\n| `MULTI_REGION` | **SigV4a with region set `*`**: you can't know which region will serve the request |\n\n```js\nimport { SignatureV4a } from '@smithy/signature-v4a';\nimport { Sha256 } from '@aws-crypto/sha256-js';\nimport { fromNodeProviderChain } from '@aws-sdk/credential-providers';\n\nconst signer = new SignatureV4a({ service: 'lambda', region: '*', sha256: Sha256, credentials: fromNodeProviderChain() });\nconst signed = await signer.sign(\n { method: 'GET', protocol: 'https:', hostname: host, path: '/', headers: { host } },\n { signingRegion: '*' },\n);\nconst response = await fetch(`https://${host}/`, { headers: signed.headers });\n```\n\n## Configuration\n\n```ts\nconst api = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('build'),\n authType: WebFunctionAuthType.AWS_IAM,\n entrypoint: 'server.js', // default index.js\n webFunctionName: 'orders-api', // default: generated from the construct path\n description: 'Orders HTTP API',\n environment: { TABLE_NAME: table.tableName },\n timeout: Duration.seconds(60), // per request: 3 seconds to 15 minutes, default 30 seconds\n maxConcurrencyPerEnvironment: 32, // requests per environment at once: 1-128, default 64\n});\n\napi.addEnvironment('FEATURE_FLAG', 'on');\ntable.grantReadWriteData(api); // the default role trusts lambda.amazonaws.com\n```\n\n- Requests handled by one environment share module-level state, so keep handlers concurrency-safe.\n- Environment variable names starting with `AWS_` are reserved.\n- **Renaming the function replaces it and changes its URL.** A generated name depends on the construct path, so moving the construct renames it too.\n\n### Bundling TypeScript with `NodejsWebFunction`\n\n`NodejsWebFunction` is a `WebFunction` that bundles your server from a TypeScript or JavaScript entry file with esbuild, like `NodejsFunction` does for Lambda functions:\n\n```ts\nnew NodejsWebFunction(this, 'Api', {\n entry: 'src/server.ts',\n authType: WebFunctionAuthType.AWS_IAM,\n bundling: {\n minify: true, // default true\n sourceMap: true, // default true\n format: lambdaNodejs.OutputFormat.ESM, // default ESM (index.mjs); CJS gives index.js\n externalModules: [], // default: bundle everything you import\n },\n});\n```\n\n- **Defaults:** `runtime` is `NODEJS_24_X`, and the esbuild target follows the runtime (`node24`). The project root is the directory of the nearest lock file above `entry` (override it with `depsLockFilePath` or `projectRoot`).\n- **It also sets what a `lambda.Code` can't:** the entry point that matches the bundle, and `NODE_OPTIONS=--enable-source-maps` when source maps are on, appended to any `NODE_OPTIONS` you set, so stack traces point at your `.ts` files (e.g. `/var/task/src/server.ts:22:12`). Source map paths are relative to the project root, so no build-machine paths are deployed.\n- **ESM bundles include a `require` shim**, so CommonJS dependencies that load Node.js built-ins (Express, for example) work.\n- **The AWS SDK is bundled like any other dependency**, since the runtime has none. Only the clients you import are included.\n- **Bundling runs locally** when esbuild is installed in your project, and otherwise in Docker (an arm64 AWS SAM build image; set `forceDockerBundling` to always use Docker).\n- **Not yet supported:** installing native modules next to the bundle (`nodeModules`) and command hooks. For native dependencies, use `WebFunction` with `Code.fromAsset(..., { bundling: { image, command } })`.\n\n### Code\n\n`code` takes any `lambda.Code` that produces a zip in S3: `fromAsset`, `fromBucket`/`fromBucketV2`, `fromCustomCommand`, `fromDockerBuild`. Inline code and container images fail at synth time.\n\nLambda Web Functions download code as the `lambda.amazonaws.com` service principal, from a **versioned** bucket, and the CDK bootstrap bucket allows neither. So each stack gets a small code bucket, and the code is copied into it on deploy.\n\n## Revisions\n\nAny change to code or configuration creates a new **revision** (`fn.currentRevision`), and endpoints switch to it once it's ready. A failed deployment rolls back to the previous revision. If nothing changed, nothing is deployed.\n\nEarlier revisions are kept, so you can roll back or route traffic to them. After each deployment, the construct deletes the oldest beyond `revisionRetention` (default 20, up to 50). It never deletes a revision an endpoint routes to, or one the previous deployment used, which a rollback returns to.\n\n```ts\nnew WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n revisionRetention: 5,\n});\n```\n\n### Routing to earlier revisions\n\nReference an earlier revision by its ID (for example from a `CfnOutput` of `fn.currentRevision.revisionId`, or `aws lambda-web list-web-function-revisions`). Then pin an endpoint to it, or split traffic between two revisions:\n\n```ts\nconst previous = WebFunctionRevision.fromRevisionAttributes(this, 'Previous', {\n webFunction: fn,\n revisionId: 'rev-a1b2c',\n});\n\n// Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.endpoint.routeTraffic(previous, [{ revision: fn.currentRevision, weight: 0.1 }]);\n\n// Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.addEndpoint('Stable', { authType: WebFunctionAuthType.AWS_IAM, revision: previous });\n```\n\n- An endpoint routes to at most two revisions. The additional revision's `weight` is a whole percentage, from 0.01 to 0.99.\n- To promote, remove `routeTraffic` (or `revision`) and deploy: the endpoint serves the current revision again.\n- Lambda Web Function metrics have no revision dimension. To compare a split's revisions, log a version you control (for example an environment variable) from your application.\n\n### Canary and linear deployments\n\nBy default an endpoint moves all its traffic to a new revision at once. With `deployment`, it moves in steps instead, watching CloudWatch alarms: if one goes into ALARM, the endpoint goes back to the revision it served before and the deployment fails, so CloudFormation rolls the stack back.\n\n```ts\nconst api = new WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n endpoint: {\n // 10% of the traffic for 10 minutes, then all of it; back if more than 2% of requests get a 5XX.\n deployment: WebFunctionDeployment.canary({ percent: 10, bake: Duration.minutes(10), rollbackOn: { serverErrorRate: 2 } }),\n },\n});\n\n// 25% more every 5 minutes, watching an alarm of your own. Each endpoint has its own deployment.\n// errorRate: any cloudwatch.IAlarm, e.g. on a metric your application publishes.\napi.addEndpoint('Public', {\n authType: WebFunctionAuthType.NONE,\n deployment: WebFunctionDeployment.linear({ percent: 25, interval: Duration.minutes(5), alarms: [errorRate] }),\n});\n```\n\n| | Steps | Limits |\n|---|---|---|\n| `allAtOnce()` (default) | 100% | |\n| `canary({ percent, bake })` | `percent`, then 100% after `bake` | `percent` 1–99, `bake` 1–45 minutes |\n| `linear({ percent, interval })` | `percent` more every `interval` | `percent` 5–50, `interval` from 1 minute, at most 45 minutes in all |\n\nHow it works:\n\n- Each deployment that creates a revision (code or configuration) moves the traffic from the revision the endpoint serves at that moment, which is also what it goes back to. If someone switched the endpoint outside CloudFormation, the deployment starts from there.\n- Each step waits until every region of a `MULTI_REGION` or `PER_REGION` endpoint has applied it (usually about 15 seconds), and if a region fails to update, the endpoint goes back as for an alarm. The bake or interval counts from the start of the step.\n- Alarms are checked before the first step (an alarm already in ALARM stops the deployment before any traffic moves), throughout every step, and once the new revision has all the traffic. They can be in any region, and composite alarms work. `INSUFFICIENT_DATA` doesn't stop a deployment.\n- A rollback of the stack, for any reason, moves the traffic back at once, without waiting or checking alarms.\n- A stack's first deployment, and a new endpoint (including one renamed by a region change), serve the revision at once: there's nothing to move from.\n- A deployment can take up to an hour: CloudFormation waits for it before it updates the endpoint. Deployments of different endpoints run in parallel.\n- A canary or linear endpoint always moves to the current revision, so it can't also use `revision`, `additionalRevisions` or `routeTraffic()`. Use `allAtOnce()` to deploy a fix immediately, for example while an alarm is in ALARM.\n\n#### Rollback alarms\n\n`rollbackOn` makes the endpoint create alarms on its own error rates, and the deployment watches them alongside any `alarms` you pass:\n\n| `rollbackOn` | Default | |\n|---|---|---|\n| `serverErrorRate` | none | roll back when more than this % of requests get a 5XX |\n| `clientErrorRate` | none | the same for 4XX (including 429s from `rateLimit` and `maxEnvironments`) |\n| `minimumRequests` | 10 | periods with fewer requests don't count, so one failed request out of two doesn't roll back |\n| `period`, `evaluationPeriods` | 1 minute, 2 | consecutive periods over the threshold before rolling back |\n\n- **One alarm per threshold in every region the endpoint serves from.** Metrics are published in the region that served the request, and an alarm can only watch metrics in its own region. The home region's alarm is a normal CloudFormation alarm; the others are created and deleted with the endpoint by a custom resource, and named `LambdaWeb-<function>-<endpoint>-5xx-rate` (or `-4xx-rate`). `endpoint.rollbackAlarms` lists them all, e.g. to add notifications to the home region's.\n- **The alarms see the whole endpoint.** Lambda Web Function metrics have no revision dimension, so at 10% a new revision's errors are about a tenth of the endpoint's: set the threshold low enough to notice that, or alarm on metrics your application publishes with its version.\n- **5XX includes the platform's 503s** while the endpoint scales up for a sudden burst, not only your application's errors.\n- **A step should outlast the alarm.** CloudWatch needs `period` × `evaluationPeriods`, plus a couple of minutes of delay, to fire; the construct warns when a canary's bake or a linear interval is shorter.\n\nThe deployment runs in a few resources per stack, created on first use: two Lambda functions, a Step Functions state machine that calls them every 15 seconds, and a log group.\n\n## Metrics\n\nEndpoints and functions have helpers for their CloudWatch metrics (namespace `AWS/Lambda/Web`), like `lambda.Function`'s:\n\n```ts\nfn.endpoint.metricServerErrorRate().createAlarm(this, 'ErrorRate', { threshold: 1, evaluationPeriods: 3 });\nfn.endpoint.metricRequestThrottles().createAlarm(this, 'Throttled', { threshold: 10, evaluationPeriods: 3 });\nfn.metricConcurrentRequests().createAlarm(this, 'Saturated', { threshold: 60, evaluationPeriods: 3 });\n```\n\n| Endpoint | Metric |\n|---|---|\n| `metricRequests()` | `ExecutedRequests` (there's no separate 2XX count) |\n| `metricClientErrors()`, `metricServerErrors()` | `HTTPResponseStatusClass4XX`, `HTTPResponseStatusClass5XX` |\n| `metricClientErrorRate()`, `metricServerErrorRate()` | 4XX or 5XX as a % of requests (math expression) |\n| `metricActiveEnvironments()` | `EndpointActiveEnvironments`, to compare with `maxEnvironments` |\n| `metricRequestThrottles()`, `metricEnvironmentThrottles()` | 429s from `rateLimit` and from `maxEnvironments` |\n\n| Function | Metric |\n|---|---|\n| `metricConcurrentRequests()` | `EnvironmentConcurrentRequests` (maximum), to compare with `maxConcurrencyPerEnvironment` |\n| `metricMaxMemoryUsage()` | `EnvironmentMaxMemoryUsage` (maximum) |\n| `metricActiveTime()`, `metricCpuTime()`, `metricResponseBytes()` | `EnvironmentActiveTime`, `EnvironmentCPUTime`, `ResponseBytes` |\n\n- **Metrics stay in the region that served the request**; unlike logs, they aren't copied to the home region. Every helper takes `region`. Dashboards can show any region, but an alarm can only use metrics from its own stack's region.\n- 4XX, 5XX and the throttle metrics only exist once they're non-zero: alarm on them with `treatMissingData: NOT_BREACHING`. The rate helpers count missing errors as 0.\n- There's no latency metric. Publish one from your application (e.g. with the CloudWatch embedded metric format).\n\n## Logs in every region\n\nWeb Functions log in two tiers:\n\n```text\n every serving region home region\n ┌──────────────────┐ ┌──────────────────────────────────────────┐\n │ <group>.local │── copied ───►│ <group> every region's logs │\n │ (that region's │ (seconds) │ streams …[rev]<instance>-<acct>-<region> │\n │ environments) │ │ <group>.local (home-region traffic) │\n └──────────────────┘ └──────────────────────────────────────────┘\n```\n\n**Query `fn.logGroup`**, the home-region group that receives every region's logs. The service would create missing groups without retention and never delete them, so the construct creates and owns all of them: both home-region groups, and `<group>.local` in every other region of the endpoint.\n\n```ts\nnew WebFunction(this, 'Api', {\n runtime: lambda.Runtime.NODEJS_24_X,\n code: lambda.Code.fromAsset('dist'),\n authType: WebFunctionAuthType.AWS_IAM,\n logRetention: logs.RetentionDays.THREE_MONTHS, // default ONE_MONTH, every group in every region\n logRemovalPolicy: RemovalPolicy.DESTROY, // default RETAIN\n applicationLogLevelV2: lambda.ApplicationLogLevel.WARN,\n systemLogLevelV2: lambda.SystemLogLevel.INFO, // DEBUG, INFO or WARN\n});\n```\n\n- The default group is `/aws/lambda/web/<function name>`. Log lines are JSON; application lines carry `requestId`, `endpointName` and `region`.\n- Every event is stored twice (`.local` plus the home-region copy), so expect about double log ingestion, plus cross-region transfer.\n- With `DESTROY`, deletion waits about a minute after the function is gone, because environments flush their last lines late.\n- Subscribe only to `fn.logGroup`: subscribing to the `.local` groups as well delivers every event twice.\n\n## Limitations\n\n- Not yet supported: importing existing functions, VPC access (network connectors), resource-policy permissions, KMS encryption, metrics helpers, tracing, and a CloudFront origin.\n- `cdk deploy --hotswap` and `cdk watch` don't support Web Functions.\n- Quotas: 10 endpoints and about 50 revisions per function (Lambda cleans up older revisions automatically), and 10,000 requests per second per endpoint. Per account and region: 100,000 requests per second and 2,000 Arm64 vCPUs (each execution environment uses 2). The account quotas are adjustable, and new accounts start lower. See [Lambda quotas](https://docs.aws.amazon.com/lambda/latest/dg/gettingstarted-limits.html).\n- The stack's custom resource provider Lambda keeps its own log group after the stack is deleted, as with other CDK custom resources.\n\n## Development\n\nTooling is pinned in `mise.toml` (Node 24, AWS CDK CLI). Personal settings, such as the AWS profile for the live end-to-end tests, go in a git-ignored `mise.local.toml`.\n\n```bash\nmise install\nnpx projen build # compile, unit tests, lint, API docs\nnpx projen e2e # deploy, verify and destroy real stacks in three regions (needs AWS credentials)\n```\n"
|
|
9749
9749
|
},
|
|
9750
9750
|
"repository": {
|
|
9751
9751
|
"type": "git",
|
|
@@ -9758,6 +9758,85 @@
|
|
|
9758
9758
|
}
|
|
9759
9759
|
},
|
|
9760
9760
|
"types": {
|
|
9761
|
+
"@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions": {
|
|
9762
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
9763
|
+
"datatype": true,
|
|
9764
|
+
"docs": {
|
|
9765
|
+
"stability": "experimental",
|
|
9766
|
+
"summary": "Options for `WebFunction.addEndpoint`."
|
|
9767
|
+
},
|
|
9768
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions",
|
|
9769
|
+
"interfaces": [
|
|
9770
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions"
|
|
9771
|
+
],
|
|
9772
|
+
"kind": "interface",
|
|
9773
|
+
"locationInModule": {
|
|
9774
|
+
"filename": "src/web-function-endpoint.ts",
|
|
9775
|
+
"line": 112
|
|
9776
|
+
},
|
|
9777
|
+
"name": "AddWebFunctionEndpointOptions",
|
|
9778
|
+
"properties": [
|
|
9779
|
+
{
|
|
9780
|
+
"abstract": true,
|
|
9781
|
+
"docs": {
|
|
9782
|
+
"stability": "experimental",
|
|
9783
|
+
"summary": "How callers of this endpoint are authenticated."
|
|
9784
|
+
},
|
|
9785
|
+
"immutable": true,
|
|
9786
|
+
"locationInModule": {
|
|
9787
|
+
"filename": "src/web-function-endpoint.ts",
|
|
9788
|
+
"line": 116
|
|
9789
|
+
},
|
|
9790
|
+
"name": "authType",
|
|
9791
|
+
"type": {
|
|
9792
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType"
|
|
9793
|
+
}
|
|
9794
|
+
},
|
|
9795
|
+
{
|
|
9796
|
+
"abstract": true,
|
|
9797
|
+
"docs": {
|
|
9798
|
+
"default": "- all traffic goes to `revision`",
|
|
9799
|
+
"remarks": "`revision` gets the rest.\nAn endpoint routes to at most two revisions.",
|
|
9800
|
+
"stability": "experimental",
|
|
9801
|
+
"summary": "A second revision and its share of the endpoint's traffic;"
|
|
9802
|
+
},
|
|
9803
|
+
"immutable": true,
|
|
9804
|
+
"locationInModule": {
|
|
9805
|
+
"filename": "src/web-function-endpoint.ts",
|
|
9806
|
+
"line": 132
|
|
9807
|
+
},
|
|
9808
|
+
"name": "additionalRevisions",
|
|
9809
|
+
"optional": true,
|
|
9810
|
+
"type": {
|
|
9811
|
+
"collection": {
|
|
9812
|
+
"elementtype": {
|
|
9813
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionWeight"
|
|
9814
|
+
},
|
|
9815
|
+
"kind": "array"
|
|
9816
|
+
}
|
|
9817
|
+
}
|
|
9818
|
+
},
|
|
9819
|
+
{
|
|
9820
|
+
"abstract": true,
|
|
9821
|
+
"docs": {
|
|
9822
|
+
"default": "- the function's current revision (`currentRevision`)",
|
|
9823
|
+
"stability": "experimental",
|
|
9824
|
+
"summary": "The revision the endpoint serves, e.g. an earlier one from `WebFunctionRevision.fromRevisionAttributes` to keep this endpoint on it while others move on. Same as calling `routeTraffic`."
|
|
9825
|
+
},
|
|
9826
|
+
"immutable": true,
|
|
9827
|
+
"locationInModule": {
|
|
9828
|
+
"filename": "src/web-function-endpoint.ts",
|
|
9829
|
+
"line": 124
|
|
9830
|
+
},
|
|
9831
|
+
"name": "revision",
|
|
9832
|
+
"optional": true,
|
|
9833
|
+
"type": {
|
|
9834
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
9835
|
+
}
|
|
9836
|
+
}
|
|
9837
|
+
],
|
|
9838
|
+
"symbolId": "src/web-function-endpoint:AddWebFunctionEndpointOptions"
|
|
9839
|
+
},
|
|
9761
9840
|
"@ashishpandeyone/cdk-lambda-web-function.IWebFunction": {
|
|
9762
9841
|
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
9763
9842
|
"docs": {
|
|
@@ -9772,7 +9851,7 @@
|
|
|
9772
9851
|
"kind": "interface",
|
|
9773
9852
|
"locationInModule": {
|
|
9774
9853
|
"filename": "src/web-function.ts",
|
|
9775
|
-
"line":
|
|
9854
|
+
"line": 155
|
|
9776
9855
|
},
|
|
9777
9856
|
"name": "IWebFunction",
|
|
9778
9857
|
"properties": [
|
|
@@ -9788,7 +9867,7 @@
|
|
|
9788
9867
|
"immutable": true,
|
|
9789
9868
|
"locationInModule": {
|
|
9790
9869
|
"filename": "src/web-function.ts",
|
|
9791
|
-
"line":
|
|
9870
|
+
"line": 168
|
|
9792
9871
|
},
|
|
9793
9872
|
"name": "webFunctionArn",
|
|
9794
9873
|
"type": {
|
|
@@ -9807,7 +9886,7 @@
|
|
|
9807
9886
|
"immutable": true,
|
|
9808
9887
|
"locationInModule": {
|
|
9809
9888
|
"filename": "src/web-function.ts",
|
|
9810
|
-
"line":
|
|
9889
|
+
"line": 161
|
|
9811
9890
|
},
|
|
9812
9891
|
"name": "webFunctionName",
|
|
9813
9892
|
"type": {
|
|
@@ -9817,6 +9896,74 @@
|
|
|
9817
9896
|
],
|
|
9818
9897
|
"symbolId": "src/web-function:IWebFunction"
|
|
9819
9898
|
},
|
|
9899
|
+
"@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision": {
|
|
9900
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
9901
|
+
"docs": {
|
|
9902
|
+
"stability": "experimental",
|
|
9903
|
+
"summary": "A revision of a Web Function: an immutable snapshot of its code and configuration."
|
|
9904
|
+
},
|
|
9905
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision",
|
|
9906
|
+
"interfaces": [
|
|
9907
|
+
"constructs.IConstruct"
|
|
9908
|
+
],
|
|
9909
|
+
"kind": "interface",
|
|
9910
|
+
"locationInModule": {
|
|
9911
|
+
"filename": "src/web-function-revision.ts",
|
|
9912
|
+
"line": 7
|
|
9913
|
+
},
|
|
9914
|
+
"name": "IWebFunctionRevision",
|
|
9915
|
+
"properties": [
|
|
9916
|
+
{
|
|
9917
|
+
"abstract": true,
|
|
9918
|
+
"docs": {
|
|
9919
|
+
"stability": "experimental",
|
|
9920
|
+
"summary": "The revision's ARN."
|
|
9921
|
+
},
|
|
9922
|
+
"immutable": true,
|
|
9923
|
+
"locationInModule": {
|
|
9924
|
+
"filename": "src/web-function-revision.ts",
|
|
9925
|
+
"line": 12
|
|
9926
|
+
},
|
|
9927
|
+
"name": "revisionArn",
|
|
9928
|
+
"type": {
|
|
9929
|
+
"primitive": "string"
|
|
9930
|
+
}
|
|
9931
|
+
},
|
|
9932
|
+
{
|
|
9933
|
+
"abstract": true,
|
|
9934
|
+
"docs": {
|
|
9935
|
+
"stability": "experimental",
|
|
9936
|
+
"summary": "The revision's ID, e.g. `rev-a1b2c`."
|
|
9937
|
+
},
|
|
9938
|
+
"immutable": true,
|
|
9939
|
+
"locationInModule": {
|
|
9940
|
+
"filename": "src/web-function-revision.ts",
|
|
9941
|
+
"line": 9
|
|
9942
|
+
},
|
|
9943
|
+
"name": "revisionId",
|
|
9944
|
+
"type": {
|
|
9945
|
+
"primitive": "string"
|
|
9946
|
+
}
|
|
9947
|
+
},
|
|
9948
|
+
{
|
|
9949
|
+
"abstract": true,
|
|
9950
|
+
"docs": {
|
|
9951
|
+
"stability": "experimental",
|
|
9952
|
+
"summary": "The function the revision belongs to."
|
|
9953
|
+
},
|
|
9954
|
+
"immutable": true,
|
|
9955
|
+
"locationInModule": {
|
|
9956
|
+
"filename": "src/web-function-revision.ts",
|
|
9957
|
+
"line": 15
|
|
9958
|
+
},
|
|
9959
|
+
"name": "webFunction",
|
|
9960
|
+
"type": {
|
|
9961
|
+
"fqn": "aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef"
|
|
9962
|
+
}
|
|
9963
|
+
}
|
|
9964
|
+
],
|
|
9965
|
+
"symbolId": "src/web-function-revision:IWebFunctionRevision"
|
|
9966
|
+
},
|
|
9820
9967
|
"@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction": {
|
|
9821
9968
|
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
9822
9969
|
"base": "@ashishpandeyone/cdk-lambda-web-function.WebFunction",
|
|
@@ -10305,7 +10452,7 @@
|
|
|
10305
10452
|
"custom": {
|
|
10306
10453
|
"resource": "AWS::Lambda::WebFunction"
|
|
10307
10454
|
},
|
|
10308
|
-
"remarks": "Creates the function, its current revision (code and configuration; any change
|
|
10455
|
+
"remarks": "Creates the function, its current revision (code and configuration; any change creates a new one,\nand the newest `revisionRetention` are kept), a default HTTPS endpoint, an execution role, and owns\nthe function's log groups in every region its endpoints serve from.\n\nImporting existing functions (`fromXxx` methods) is planned after 0.1.",
|
|
10309
10456
|
"stability": "experimental",
|
|
10310
10457
|
"summary": "A Node.js HTTP server running as an AWS Lambda Web Function, served from one or more regions."
|
|
10311
10458
|
},
|
|
@@ -10316,7 +10463,7 @@
|
|
|
10316
10463
|
},
|
|
10317
10464
|
"locationInModule": {
|
|
10318
10465
|
"filename": "src/web-function.ts",
|
|
10319
|
-
"line":
|
|
10466
|
+
"line": 223
|
|
10320
10467
|
},
|
|
10321
10468
|
"parameters": [
|
|
10322
10469
|
{
|
|
@@ -10346,9 +10493,42 @@
|
|
|
10346
10493
|
"kind": "class",
|
|
10347
10494
|
"locationInModule": {
|
|
10348
10495
|
"filename": "src/web-function.ts",
|
|
10349
|
-
"line":
|
|
10496
|
+
"line": 182
|
|
10350
10497
|
},
|
|
10351
10498
|
"methods": [
|
|
10499
|
+
{
|
|
10500
|
+
"docs": {
|
|
10501
|
+
"stability": "experimental",
|
|
10502
|
+
"summary": "Adds an endpoint (up to 10 per function), e.g. a public one next to an IAM-only one, or one pinned to an earlier revision. Each endpoint has its own URL, authentication, regions and limits."
|
|
10503
|
+
},
|
|
10504
|
+
"locationInModule": {
|
|
10505
|
+
"filename": "src/web-function.ts",
|
|
10506
|
+
"line": 325
|
|
10507
|
+
},
|
|
10508
|
+
"name": "addEndpoint",
|
|
10509
|
+
"parameters": [
|
|
10510
|
+
{
|
|
10511
|
+
"docs": {
|
|
10512
|
+
"summary": "the endpoint's construct ID, also used in its generated name (`<id>-<hash>`)."
|
|
10513
|
+
},
|
|
10514
|
+
"name": "id",
|
|
10515
|
+
"type": {
|
|
10516
|
+
"primitive": "string"
|
|
10517
|
+
}
|
|
10518
|
+
},
|
|
10519
|
+
{
|
|
10520
|
+
"name": "options",
|
|
10521
|
+
"type": {
|
|
10522
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions"
|
|
10523
|
+
}
|
|
10524
|
+
}
|
|
10525
|
+
],
|
|
10526
|
+
"returns": {
|
|
10527
|
+
"type": {
|
|
10528
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint"
|
|
10529
|
+
}
|
|
10530
|
+
}
|
|
10531
|
+
},
|
|
10352
10532
|
{
|
|
10353
10533
|
"docs": {
|
|
10354
10534
|
"remarks": "Names starting with `AWS_` are reserved.",
|
|
@@ -10357,7 +10537,7 @@
|
|
|
10357
10537
|
},
|
|
10358
10538
|
"locationInModule": {
|
|
10359
10539
|
"filename": "src/web-function.ts",
|
|
10360
|
-
"line":
|
|
10540
|
+
"line": 333
|
|
10361
10541
|
},
|
|
10362
10542
|
"name": "addEnvironment",
|
|
10363
10543
|
"parameters": [
|
|
@@ -10387,7 +10567,7 @@
|
|
|
10387
10567
|
},
|
|
10388
10568
|
"locationInModule": {
|
|
10389
10569
|
"filename": "src/web-function.ts",
|
|
10390
|
-
"line":
|
|
10570
|
+
"line": 344
|
|
10391
10571
|
},
|
|
10392
10572
|
"name": "addToRolePolicy",
|
|
10393
10573
|
"parameters": [
|
|
@@ -10407,7 +10587,7 @@
|
|
|
10407
10587
|
},
|
|
10408
10588
|
"locationInModule": {
|
|
10409
10589
|
"filename": "src/web-function.ts",
|
|
10410
|
-
"line":
|
|
10590
|
+
"line": 352
|
|
10411
10591
|
},
|
|
10412
10592
|
"name": "grantInvoke",
|
|
10413
10593
|
"parameters": [
|
|
@@ -10423,146 +10603,324 @@
|
|
|
10423
10603
|
"fqn": "aws-cdk-lib.aws_iam.Grant"
|
|
10424
10604
|
}
|
|
10425
10605
|
}
|
|
10426
|
-
}
|
|
10427
|
-
],
|
|
10428
|
-
"name": "WebFunction",
|
|
10429
|
-
"properties": [
|
|
10606
|
+
},
|
|
10430
10607
|
{
|
|
10431
10608
|
"docs": {
|
|
10609
|
+
"default": "- sum over 1 minute, in the home region",
|
|
10610
|
+
"remarks": "For request and error counts, use the endpoint's metrics (`fn.endpoint.metricRequests()`).\n\nMetrics are published in the region that served the request: pass `region` for another serving region.\nAn alarm can only use metrics from its own stack's region.",
|
|
10432
10611
|
"stability": "experimental",
|
|
10433
|
-
"summary": "
|
|
10612
|
+
"summary": "A metric of this function's execution environments in `AWS/Lambda/Web` (dimension `FunctionName`), across all endpoints."
|
|
10434
10613
|
},
|
|
10435
|
-
"immutable": true,
|
|
10436
10614
|
"locationInModule": {
|
|
10437
10615
|
"filename": "src/web-function.ts",
|
|
10438
|
-
"line":
|
|
10616
|
+
"line": 365
|
|
10439
10617
|
},
|
|
10440
|
-
"name": "
|
|
10441
|
-
"
|
|
10442
|
-
|
|
10618
|
+
"name": "metric",
|
|
10619
|
+
"parameters": [
|
|
10620
|
+
{
|
|
10621
|
+
"name": "metricName",
|
|
10622
|
+
"type": {
|
|
10623
|
+
"primitive": "string"
|
|
10624
|
+
}
|
|
10625
|
+
},
|
|
10626
|
+
{
|
|
10627
|
+
"name": "props",
|
|
10628
|
+
"optional": true,
|
|
10629
|
+
"type": {
|
|
10630
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10631
|
+
}
|
|
10632
|
+
}
|
|
10633
|
+
],
|
|
10634
|
+
"returns": {
|
|
10635
|
+
"type": {
|
|
10636
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10637
|
+
}
|
|
10443
10638
|
}
|
|
10444
10639
|
},
|
|
10445
10640
|
{
|
|
10446
10641
|
"docs": {
|
|
10447
10642
|
"stability": "experimental",
|
|
10448
|
-
"summary": "
|
|
10643
|
+
"summary": "Time the execution environments were active (`EnvironmentActiveTime`)."
|
|
10449
10644
|
},
|
|
10450
|
-
"immutable": true,
|
|
10451
10645
|
"locationInModule": {
|
|
10452
10646
|
"filename": "src/web-function.ts",
|
|
10453
|
-
"line":
|
|
10647
|
+
"line": 377
|
|
10454
10648
|
},
|
|
10455
|
-
"name": "
|
|
10456
|
-
"
|
|
10457
|
-
|
|
10458
|
-
|
|
10649
|
+
"name": "metricActiveTime",
|
|
10650
|
+
"parameters": [
|
|
10651
|
+
{
|
|
10652
|
+
"name": "props",
|
|
10653
|
+
"optional": true,
|
|
10654
|
+
"type": {
|
|
10655
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10656
|
+
}
|
|
10657
|
+
}
|
|
10658
|
+
],
|
|
10659
|
+
"returns": {
|
|
10660
|
+
"type": {
|
|
10661
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10662
|
+
}
|
|
10459
10663
|
}
|
|
10460
10664
|
},
|
|
10461
10665
|
{
|
|
10462
10666
|
"docs": {
|
|
10667
|
+
"default": "- maximum over 1 minute",
|
|
10463
10668
|
"stability": "experimental",
|
|
10464
|
-
"summary": "
|
|
10669
|
+
"summary": "Requests an execution environment handled at once (`EnvironmentConcurrentRequests`), to compare with `maxConcurrencyPerEnvironment`."
|
|
10465
10670
|
},
|
|
10466
|
-
"immutable": true,
|
|
10467
10671
|
"locationInModule": {
|
|
10468
10672
|
"filename": "src/web-function.ts",
|
|
10469
|
-
"line":
|
|
10673
|
+
"line": 392
|
|
10470
10674
|
},
|
|
10471
|
-
"name": "
|
|
10472
|
-
"
|
|
10473
|
-
|
|
10675
|
+
"name": "metricConcurrentRequests",
|
|
10676
|
+
"parameters": [
|
|
10677
|
+
{
|
|
10678
|
+
"name": "props",
|
|
10679
|
+
"optional": true,
|
|
10680
|
+
"type": {
|
|
10681
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10682
|
+
}
|
|
10683
|
+
}
|
|
10684
|
+
],
|
|
10685
|
+
"returns": {
|
|
10686
|
+
"type": {
|
|
10687
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10688
|
+
}
|
|
10474
10689
|
}
|
|
10475
10690
|
},
|
|
10476
10691
|
{
|
|
10477
10692
|
"docs": {
|
|
10478
|
-
"remarks": "Subscribe to this one only: each region's `.local` group holds a copy of the same events.",
|
|
10479
10693
|
"stability": "experimental",
|
|
10480
|
-
"summary": "
|
|
10694
|
+
"summary": "CPU time the execution environments used (`EnvironmentCPUTime`)."
|
|
10481
10695
|
},
|
|
10482
|
-
"immutable": true,
|
|
10483
10696
|
"locationInModule": {
|
|
10484
10697
|
"filename": "src/web-function.ts",
|
|
10485
|
-
"line":
|
|
10698
|
+
"line": 382
|
|
10486
10699
|
},
|
|
10487
|
-
"name": "
|
|
10488
|
-
"
|
|
10489
|
-
|
|
10700
|
+
"name": "metricCpuTime",
|
|
10701
|
+
"parameters": [
|
|
10702
|
+
{
|
|
10703
|
+
"name": "props",
|
|
10704
|
+
"optional": true,
|
|
10705
|
+
"type": {
|
|
10706
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10707
|
+
}
|
|
10708
|
+
}
|
|
10709
|
+
],
|
|
10710
|
+
"returns": {
|
|
10711
|
+
"type": {
|
|
10712
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10713
|
+
}
|
|
10490
10714
|
}
|
|
10491
10715
|
},
|
|
10492
10716
|
{
|
|
10493
10717
|
"docs": {
|
|
10718
|
+
"default": "- maximum over 1 minute",
|
|
10719
|
+
"remarks": "each environment has 2 GB.",
|
|
10494
10720
|
"stability": "experimental",
|
|
10495
|
-
"summary": "
|
|
10721
|
+
"summary": "Peak memory an execution environment used (`EnvironmentMaxMemoryUsage`);"
|
|
10496
10722
|
},
|
|
10497
|
-
"immutable": true,
|
|
10498
10723
|
"locationInModule": {
|
|
10499
10724
|
"filename": "src/web-function.ts",
|
|
10500
|
-
"line":
|
|
10725
|
+
"line": 401
|
|
10501
10726
|
},
|
|
10502
|
-
"name": "
|
|
10503
|
-
"
|
|
10504
|
-
|
|
10727
|
+
"name": "metricMaxMemoryUsage",
|
|
10728
|
+
"parameters": [
|
|
10729
|
+
{
|
|
10730
|
+
"name": "props",
|
|
10731
|
+
"optional": true,
|
|
10732
|
+
"type": {
|
|
10733
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10734
|
+
}
|
|
10735
|
+
}
|
|
10736
|
+
],
|
|
10737
|
+
"returns": {
|
|
10738
|
+
"type": {
|
|
10739
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10740
|
+
}
|
|
10505
10741
|
}
|
|
10506
10742
|
},
|
|
10507
10743
|
{
|
|
10508
10744
|
"docs": {
|
|
10509
10745
|
"stability": "experimental",
|
|
10510
|
-
"summary": "
|
|
10746
|
+
"summary": "Bytes sent in responses (`ResponseBytes`)."
|
|
10511
10747
|
},
|
|
10512
|
-
"immutable": true,
|
|
10513
10748
|
"locationInModule": {
|
|
10514
10749
|
"filename": "src/web-function.ts",
|
|
10515
|
-
"line":
|
|
10750
|
+
"line": 406
|
|
10516
10751
|
},
|
|
10517
|
-
"name": "
|
|
10518
|
-
"
|
|
10519
|
-
|
|
10752
|
+
"name": "metricResponseBytes",
|
|
10753
|
+
"parameters": [
|
|
10754
|
+
{
|
|
10755
|
+
"name": "props",
|
|
10756
|
+
"optional": true,
|
|
10757
|
+
"type": {
|
|
10758
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
10759
|
+
}
|
|
10760
|
+
}
|
|
10761
|
+
],
|
|
10762
|
+
"returns": {
|
|
10763
|
+
"type": {
|
|
10764
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
10765
|
+
}
|
|
10520
10766
|
}
|
|
10521
|
-
}
|
|
10767
|
+
}
|
|
10768
|
+
],
|
|
10769
|
+
"name": "WebFunction",
|
|
10770
|
+
"properties": [
|
|
10522
10771
|
{
|
|
10523
10772
|
"docs": {
|
|
10524
10773
|
"stability": "experimental",
|
|
10525
|
-
"summary": "The
|
|
10774
|
+
"summary": "The revision built from the current code and configuration."
|
|
10526
10775
|
},
|
|
10527
10776
|
"immutable": true,
|
|
10528
10777
|
"locationInModule": {
|
|
10529
10778
|
"filename": "src/web-function.ts",
|
|
10530
|
-
"line":
|
|
10779
|
+
"line": 190
|
|
10531
10780
|
},
|
|
10532
|
-
"name": "
|
|
10533
|
-
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunction",
|
|
10781
|
+
"name": "currentRevision",
|
|
10534
10782
|
"type": {
|
|
10535
|
-
"
|
|
10783
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
10536
10784
|
}
|
|
10537
10785
|
},
|
|
10538
10786
|
{
|
|
10539
10787
|
"docs": {
|
|
10788
|
+
"remarks": "Add more with `addEndpoint`.",
|
|
10540
10789
|
"stability": "experimental",
|
|
10541
|
-
"summary": "The
|
|
10790
|
+
"summary": "The default endpoint."
|
|
10542
10791
|
},
|
|
10543
10792
|
"immutable": true,
|
|
10544
10793
|
"locationInModule": {
|
|
10545
10794
|
"filename": "src/web-function.ts",
|
|
10546
|
-
"line":
|
|
10795
|
+
"line": 193
|
|
10547
10796
|
},
|
|
10548
|
-
"name": "
|
|
10549
|
-
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunction",
|
|
10797
|
+
"name": "endpoint",
|
|
10550
10798
|
"type": {
|
|
10551
|
-
"
|
|
10799
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint"
|
|
10552
10800
|
}
|
|
10553
10801
|
},
|
|
10554
10802
|
{
|
|
10555
10803
|
"docs": {
|
|
10556
10804
|
"stability": "experimental",
|
|
10557
|
-
"summary": "
|
|
10805
|
+
"summary": "The principal to grant permissions to (the execution role)."
|
|
10558
10806
|
},
|
|
10559
10807
|
"immutable": true,
|
|
10560
10808
|
"locationInModule": {
|
|
10561
10809
|
"filename": "src/web-function.ts",
|
|
10562
|
-
"line":
|
|
10810
|
+
"line": 202
|
|
10563
10811
|
},
|
|
10564
|
-
"name": "
|
|
10565
|
-
"overrides": "aws-cdk-lib.
|
|
10812
|
+
"name": "grantPrincipal",
|
|
10813
|
+
"overrides": "aws-cdk-lib.aws_iam.IGrantable",
|
|
10814
|
+
"type": {
|
|
10815
|
+
"fqn": "aws-cdk-lib.aws_iam.IPrincipal"
|
|
10816
|
+
}
|
|
10817
|
+
},
|
|
10818
|
+
{
|
|
10819
|
+
"docs": {
|
|
10820
|
+
"stability": "experimental",
|
|
10821
|
+
"summary": "Grants on the default endpoint (e.g. `grants.invoke(principal)`). Other endpoints have their own `grants`."
|
|
10822
|
+
},
|
|
10823
|
+
"immutable": true,
|
|
10824
|
+
"locationInModule": {
|
|
10825
|
+
"filename": "src/web-function.ts",
|
|
10826
|
+
"line": 196
|
|
10827
|
+
},
|
|
10828
|
+
"name": "grants",
|
|
10829
|
+
"type": {
|
|
10830
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants"
|
|
10831
|
+
}
|
|
10832
|
+
},
|
|
10833
|
+
{
|
|
10834
|
+
"docs": {
|
|
10835
|
+
"remarks": "Subscribe to this one only: each region's `.local` group holds a copy of the same events.",
|
|
10836
|
+
"stability": "experimental",
|
|
10837
|
+
"summary": "The home-region log group that receives the logs of every region the function serves from."
|
|
10838
|
+
},
|
|
10839
|
+
"immutable": true,
|
|
10840
|
+
"locationInModule": {
|
|
10841
|
+
"filename": "src/web-function.ts",
|
|
10842
|
+
"line": 208
|
|
10843
|
+
},
|
|
10844
|
+
"name": "logGroup",
|
|
10845
|
+
"type": {
|
|
10846
|
+
"fqn": "aws-cdk-lib.aws_logs.ILogGroup"
|
|
10847
|
+
}
|
|
10848
|
+
},
|
|
10849
|
+
{
|
|
10850
|
+
"docs": {
|
|
10851
|
+
"remarks": "Same as `currentRevision.revisionId`.",
|
|
10852
|
+
"stability": "experimental",
|
|
10853
|
+
"summary": "The ID of the current revision."
|
|
10854
|
+
},
|
|
10855
|
+
"immutable": true,
|
|
10856
|
+
"locationInModule": {
|
|
10857
|
+
"filename": "src/web-function.ts",
|
|
10858
|
+
"line": 187
|
|
10859
|
+
},
|
|
10860
|
+
"name": "revisionId",
|
|
10861
|
+
"type": {
|
|
10862
|
+
"primitive": "string"
|
|
10863
|
+
}
|
|
10864
|
+
},
|
|
10865
|
+
{
|
|
10866
|
+
"docs": {
|
|
10867
|
+
"stability": "experimental",
|
|
10868
|
+
"summary": "The execution role."
|
|
10869
|
+
},
|
|
10870
|
+
"immutable": true,
|
|
10871
|
+
"locationInModule": {
|
|
10872
|
+
"filename": "src/web-function.ts",
|
|
10873
|
+
"line": 199
|
|
10874
|
+
},
|
|
10875
|
+
"name": "role",
|
|
10876
|
+
"type": {
|
|
10877
|
+
"fqn": "aws-cdk-lib.aws_iam.IRole"
|
|
10878
|
+
}
|
|
10879
|
+
},
|
|
10880
|
+
{
|
|
10881
|
+
"docs": {
|
|
10882
|
+
"stability": "experimental",
|
|
10883
|
+
"summary": "The function's ARN."
|
|
10884
|
+
},
|
|
10885
|
+
"immutable": true,
|
|
10886
|
+
"locationInModule": {
|
|
10887
|
+
"filename": "src/web-function.ts",
|
|
10888
|
+
"line": 184
|
|
10889
|
+
},
|
|
10890
|
+
"name": "webFunctionArn",
|
|
10891
|
+
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunction",
|
|
10892
|
+
"type": {
|
|
10893
|
+
"primitive": "string"
|
|
10894
|
+
}
|
|
10895
|
+
},
|
|
10896
|
+
{
|
|
10897
|
+
"docs": {
|
|
10898
|
+
"stability": "experimental",
|
|
10899
|
+
"summary": "The function's name."
|
|
10900
|
+
},
|
|
10901
|
+
"immutable": true,
|
|
10902
|
+
"locationInModule": {
|
|
10903
|
+
"filename": "src/web-function.ts",
|
|
10904
|
+
"line": 183
|
|
10905
|
+
},
|
|
10906
|
+
"name": "webFunctionName",
|
|
10907
|
+
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunction",
|
|
10908
|
+
"type": {
|
|
10909
|
+
"primitive": "string"
|
|
10910
|
+
}
|
|
10911
|
+
},
|
|
10912
|
+
{
|
|
10913
|
+
"docs": {
|
|
10914
|
+
"stability": "experimental",
|
|
10915
|
+
"summary": "A reference to this function, for APIs that accept `lambda.IWebFunctionRef`."
|
|
10916
|
+
},
|
|
10917
|
+
"immutable": true,
|
|
10918
|
+
"locationInModule": {
|
|
10919
|
+
"filename": "src/web-function.ts",
|
|
10920
|
+
"line": 219
|
|
10921
|
+
},
|
|
10922
|
+
"name": "webFunctionRef",
|
|
10923
|
+
"overrides": "aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef",
|
|
10566
10924
|
"type": {
|
|
10567
10925
|
"fqn": "aws-cdk-lib.interfaces.aws_lambda.WebFunctionReference"
|
|
10568
10926
|
}
|
|
@@ -10586,37 +10944,479 @@
|
|
|
10586
10944
|
{
|
|
10587
10945
|
"docs": {
|
|
10588
10946
|
"stability": "experimental",
|
|
10589
|
-
"summary": "Requests must be signed with SigV4 or SigV4a (signing name `lambda`) by a principal allowed `lambda:InvokeWebFunctionEndpoint` on the endpoint."
|
|
10947
|
+
"summary": "Requests must be signed with SigV4 or SigV4a (signing name `lambda`) by a principal allowed `lambda:InvokeWebFunctionEndpoint` on the endpoint."
|
|
10948
|
+
},
|
|
10949
|
+
"name": "AWS_IAM"
|
|
10950
|
+
},
|
|
10951
|
+
{
|
|
10952
|
+
"docs": {
|
|
10953
|
+
"remarks": "The `Authorization` header reaches your application untouched.",
|
|
10954
|
+
"stability": "experimental",
|
|
10955
|
+
"summary": "No authentication by Lambda: the endpoint is public and your application authenticates requests itself."
|
|
10956
|
+
},
|
|
10957
|
+
"name": "NONE"
|
|
10958
|
+
}
|
|
10959
|
+
],
|
|
10960
|
+
"name": "WebFunctionAuthType",
|
|
10961
|
+
"symbolId": "src/enums:WebFunctionAuthType"
|
|
10962
|
+
},
|
|
10963
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionCanaryDeploymentOptions": {
|
|
10964
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
10965
|
+
"datatype": true,
|
|
10966
|
+
"docs": {
|
|
10967
|
+
"stability": "experimental",
|
|
10968
|
+
"summary": "Options for a canary deployment."
|
|
10969
|
+
},
|
|
10970
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionCanaryDeploymentOptions",
|
|
10971
|
+
"kind": "interface",
|
|
10972
|
+
"locationInModule": {
|
|
10973
|
+
"filename": "src/web-function-deployment.ts",
|
|
10974
|
+
"line": 61
|
|
10975
|
+
},
|
|
10976
|
+
"name": "WebFunctionCanaryDeploymentOptions",
|
|
10977
|
+
"properties": [
|
|
10978
|
+
{
|
|
10979
|
+
"abstract": true,
|
|
10980
|
+
"docs": {
|
|
10981
|
+
"remarks": "Make it longer than the time your alarms need to fire (period × evaluation periods).",
|
|
10982
|
+
"stability": "experimental",
|
|
10983
|
+
"summary": "How long the new revision serves `percent` before it gets all traffic (1-45 minutes)."
|
|
10984
|
+
},
|
|
10985
|
+
"immutable": true,
|
|
10986
|
+
"locationInModule": {
|
|
10987
|
+
"filename": "src/web-function-deployment.ts",
|
|
10988
|
+
"line": 71
|
|
10989
|
+
},
|
|
10990
|
+
"name": "bake",
|
|
10991
|
+
"type": {
|
|
10992
|
+
"fqn": "aws-cdk-lib.Duration"
|
|
10993
|
+
}
|
|
10994
|
+
},
|
|
10995
|
+
{
|
|
10996
|
+
"abstract": true,
|
|
10997
|
+
"docs": {
|
|
10998
|
+
"stability": "experimental",
|
|
10999
|
+
"summary": "The share of traffic, in whole percent (1-99), that the new revision gets first."
|
|
11000
|
+
},
|
|
11001
|
+
"immutable": true,
|
|
11002
|
+
"locationInModule": {
|
|
11003
|
+
"filename": "src/web-function-deployment.ts",
|
|
11004
|
+
"line": 65
|
|
11005
|
+
},
|
|
11006
|
+
"name": "percent",
|
|
11007
|
+
"type": {
|
|
11008
|
+
"primitive": "number"
|
|
11009
|
+
}
|
|
11010
|
+
},
|
|
11011
|
+
{
|
|
11012
|
+
"abstract": true,
|
|
11013
|
+
"docs": {
|
|
11014
|
+
"default": "- no alarms: traffic moves on a timer",
|
|
11015
|
+
"remarks": "They're checked before traffic moves, during the bake, and once the new revision has all traffic.\nUse alarms in any region (by ARN), including composite alarms.",
|
|
11016
|
+
"stability": "experimental",
|
|
11017
|
+
"summary": "Alarms that stop the deployment: if one is in ALARM, the endpoint goes back to the previous revision and the deployment fails, so CloudFormation rolls the stack back."
|
|
11018
|
+
},
|
|
11019
|
+
"immutable": true,
|
|
11020
|
+
"locationInModule": {
|
|
11021
|
+
"filename": "src/web-function-deployment.ts",
|
|
11022
|
+
"line": 82
|
|
11023
|
+
},
|
|
11024
|
+
"name": "alarms",
|
|
11025
|
+
"optional": true,
|
|
11026
|
+
"type": {
|
|
11027
|
+
"collection": {
|
|
11028
|
+
"elementtype": {
|
|
11029
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.IAlarm"
|
|
11030
|
+
},
|
|
11031
|
+
"kind": "array"
|
|
11032
|
+
}
|
|
11033
|
+
}
|
|
11034
|
+
},
|
|
11035
|
+
{
|
|
11036
|
+
"abstract": true,
|
|
11037
|
+
"docs": {
|
|
11038
|
+
"default": "- no endpoint alarms",
|
|
11039
|
+
"remarks": "They stop the deployment like `alarms` (both can be used together).",
|
|
11040
|
+
"stability": "experimental",
|
|
11041
|
+
"summary": "Alarms on the endpoint's own error rates, created by the endpoint in every region it serves from."
|
|
11042
|
+
},
|
|
11043
|
+
"immutable": true,
|
|
11044
|
+
"locationInModule": {
|
|
11045
|
+
"filename": "src/web-function-deployment.ts",
|
|
11046
|
+
"line": 90
|
|
11047
|
+
},
|
|
11048
|
+
"name": "rollbackOn",
|
|
11049
|
+
"optional": true,
|
|
11050
|
+
"type": {
|
|
11051
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions"
|
|
11052
|
+
}
|
|
11053
|
+
}
|
|
11054
|
+
],
|
|
11055
|
+
"symbolId": "src/web-function-deployment:WebFunctionCanaryDeploymentOptions"
|
|
11056
|
+
},
|
|
11057
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment": {
|
|
11058
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
11059
|
+
"docs": {
|
|
11060
|
+
"stability": "experimental",
|
|
11061
|
+
"summary": "How an endpoint moves its traffic to a new revision."
|
|
11062
|
+
},
|
|
11063
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment",
|
|
11064
|
+
"kind": "class",
|
|
11065
|
+
"locationInModule": {
|
|
11066
|
+
"filename": "src/web-function-deployment.ts",
|
|
11067
|
+
"line": 130
|
|
11068
|
+
},
|
|
11069
|
+
"methods": [
|
|
11070
|
+
{
|
|
11071
|
+
"docs": {
|
|
11072
|
+
"stability": "experimental",
|
|
11073
|
+
"summary": "All traffic moves to the new revision at once, as soon as it's ready (the default)."
|
|
11074
|
+
},
|
|
11075
|
+
"locationInModule": {
|
|
11076
|
+
"filename": "src/web-function-deployment.ts",
|
|
11077
|
+
"line": 134
|
|
11078
|
+
},
|
|
11079
|
+
"name": "allAtOnce",
|
|
11080
|
+
"returns": {
|
|
11081
|
+
"type": {
|
|
11082
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment"
|
|
11083
|
+
}
|
|
11084
|
+
},
|
|
11085
|
+
"static": true
|
|
11086
|
+
},
|
|
11087
|
+
{
|
|
11088
|
+
"docs": {
|
|
11089
|
+
"stability": "experimental",
|
|
11090
|
+
"summary": "The new revision first gets `percent` of the traffic for `bake`, then all of it."
|
|
11091
|
+
},
|
|
11092
|
+
"locationInModule": {
|
|
11093
|
+
"filename": "src/web-function-deployment.ts",
|
|
11094
|
+
"line": 141
|
|
11095
|
+
},
|
|
11096
|
+
"name": "canary",
|
|
11097
|
+
"parameters": [
|
|
11098
|
+
{
|
|
11099
|
+
"name": "options",
|
|
11100
|
+
"type": {
|
|
11101
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionCanaryDeploymentOptions"
|
|
11102
|
+
}
|
|
11103
|
+
}
|
|
11104
|
+
],
|
|
11105
|
+
"returns": {
|
|
11106
|
+
"type": {
|
|
11107
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment"
|
|
11108
|
+
}
|
|
11109
|
+
},
|
|
11110
|
+
"static": true
|
|
11111
|
+
},
|
|
11112
|
+
{
|
|
11113
|
+
"docs": {
|
|
11114
|
+
"stability": "experimental",
|
|
11115
|
+
"summary": "The new revision gets `percent` more of the traffic every `interval` until it has all of it."
|
|
11116
|
+
},
|
|
11117
|
+
"locationInModule": {
|
|
11118
|
+
"filename": "src/web-function-deployment.ts",
|
|
11119
|
+
"line": 150
|
|
11120
|
+
},
|
|
11121
|
+
"name": "linear",
|
|
11122
|
+
"parameters": [
|
|
11123
|
+
{
|
|
11124
|
+
"name": "options",
|
|
11125
|
+
"type": {
|
|
11126
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionLinearDeploymentOptions"
|
|
11127
|
+
}
|
|
11128
|
+
}
|
|
11129
|
+
],
|
|
11130
|
+
"returns": {
|
|
11131
|
+
"type": {
|
|
11132
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment"
|
|
11133
|
+
}
|
|
11134
|
+
},
|
|
11135
|
+
"static": true
|
|
11136
|
+
}
|
|
11137
|
+
],
|
|
11138
|
+
"name": "WebFunctionDeployment",
|
|
11139
|
+
"symbolId": "src/web-function-deployment:WebFunctionDeployment"
|
|
11140
|
+
},
|
|
11141
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint": {
|
|
11142
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
11143
|
+
"base": "constructs.Construct",
|
|
11144
|
+
"docs": {
|
|
11145
|
+
"remarks": "Endpoints are created only through `WebFunction`, which owns their log groups in every region, so the constructor is private.",
|
|
11146
|
+
"stability": "experimental",
|
|
11147
|
+
"summary": "An HTTPS endpoint of a Web Function: `fn.endpoint` (the default one) or the result of `fn.addEndpoint()`."
|
|
11148
|
+
},
|
|
11149
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint",
|
|
11150
|
+
"kind": "class",
|
|
11151
|
+
"locationInModule": {
|
|
11152
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11153
|
+
"line": 157
|
|
11154
|
+
},
|
|
11155
|
+
"methods": [
|
|
11156
|
+
{
|
|
11157
|
+
"docs": {
|
|
11158
|
+
"remarks": "Shortcut for `grants.invoke(grantee)`.\n[disable-awslint:no-grants]",
|
|
11159
|
+
"stability": "experimental",
|
|
11160
|
+
"summary": "Allows `grantee` to call this endpoint."
|
|
11161
|
+
},
|
|
11162
|
+
"locationInModule": {
|
|
11163
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11164
|
+
"line": 420
|
|
11165
|
+
},
|
|
11166
|
+
"name": "grantInvoke",
|
|
11167
|
+
"parameters": [
|
|
11168
|
+
{
|
|
11169
|
+
"name": "grantee",
|
|
11170
|
+
"type": {
|
|
11171
|
+
"fqn": "aws-cdk-lib.aws_iam.IGrantable"
|
|
11172
|
+
}
|
|
11173
|
+
}
|
|
11174
|
+
],
|
|
11175
|
+
"returns": {
|
|
11176
|
+
"type": {
|
|
11177
|
+
"fqn": "aws-cdk-lib.aws_iam.Grant"
|
|
11178
|
+
}
|
|
11179
|
+
}
|
|
11180
|
+
},
|
|
11181
|
+
{
|
|
11182
|
+
"docs": {
|
|
11183
|
+
"default": "- sum over 1 minute, in the home region",
|
|
11184
|
+
"remarks": "Metrics are published in the region that served the request: pass `region` for one of the endpoint's\nother regions. An alarm can only use metrics from its own stack's region.",
|
|
11185
|
+
"stability": "experimental",
|
|
11186
|
+
"summary": "A metric of this endpoint in `AWS/Lambda/Web` (dimensions `FunctionName` and `EndpointName`)."
|
|
11187
|
+
},
|
|
11188
|
+
"locationInModule": {
|
|
11189
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11190
|
+
"line": 355
|
|
11191
|
+
},
|
|
11192
|
+
"name": "metric",
|
|
11193
|
+
"parameters": [
|
|
11194
|
+
{
|
|
11195
|
+
"name": "metricName",
|
|
11196
|
+
"type": {
|
|
11197
|
+
"primitive": "string"
|
|
11198
|
+
}
|
|
11199
|
+
},
|
|
11200
|
+
{
|
|
11201
|
+
"name": "props",
|
|
11202
|
+
"optional": true,
|
|
11203
|
+
"type": {
|
|
11204
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11205
|
+
}
|
|
11206
|
+
}
|
|
11207
|
+
],
|
|
11208
|
+
"returns": {
|
|
11209
|
+
"type": {
|
|
11210
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11211
|
+
}
|
|
11212
|
+
}
|
|
11213
|
+
},
|
|
11214
|
+
{
|
|
11215
|
+
"docs": {
|
|
11216
|
+
"default": "- maximum over 1 minute, in the home region",
|
|
11217
|
+
"stability": "experimental",
|
|
11218
|
+
"summary": "Execution environments serving the endpoint (`EndpointActiveEnvironments`), to compare with `maxEnvironments`."
|
|
11219
|
+
},
|
|
11220
|
+
"locationInModule": {
|
|
11221
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11222
|
+
"line": 402
|
|
11223
|
+
},
|
|
11224
|
+
"name": "metricActiveEnvironments",
|
|
11225
|
+
"parameters": [
|
|
11226
|
+
{
|
|
11227
|
+
"name": "props",
|
|
11228
|
+
"optional": true,
|
|
11229
|
+
"type": {
|
|
11230
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11231
|
+
}
|
|
11232
|
+
}
|
|
11233
|
+
],
|
|
11234
|
+
"returns": {
|
|
11235
|
+
"type": {
|
|
11236
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11237
|
+
}
|
|
11238
|
+
}
|
|
11239
|
+
},
|
|
11240
|
+
{
|
|
11241
|
+
"docs": {
|
|
11242
|
+
"remarks": "periods with no 4XX count as 0).",
|
|
11243
|
+
"stability": "experimental",
|
|
11244
|
+
"summary": "The percentage of requests answered with a 4XX status (math expression;"
|
|
11245
|
+
},
|
|
11246
|
+
"locationInModule": {
|
|
11247
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11248
|
+
"line": 388
|
|
11249
|
+
},
|
|
11250
|
+
"name": "metricClientErrorRate",
|
|
11251
|
+
"parameters": [
|
|
11252
|
+
{
|
|
11253
|
+
"name": "props",
|
|
11254
|
+
"optional": true,
|
|
11255
|
+
"type": {
|
|
11256
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11257
|
+
}
|
|
11258
|
+
}
|
|
11259
|
+
],
|
|
11260
|
+
"returns": {
|
|
11261
|
+
"type": {
|
|
11262
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MathExpression"
|
|
11263
|
+
}
|
|
11264
|
+
}
|
|
11265
|
+
},
|
|
11266
|
+
{
|
|
11267
|
+
"docs": {
|
|
11268
|
+
"remarks": "The metric only exists once it's non-zero, so alarms should treat missing data as not breaching.",
|
|
11269
|
+
"stability": "experimental",
|
|
11270
|
+
"summary": "Requests answered with a 4XX status (`HTTPResponseStatusClass4XX`), including 429s from `rateLimit` and `maxEnvironments`."
|
|
11271
|
+
},
|
|
11272
|
+
"locationInModule": {
|
|
11273
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11274
|
+
"line": 375
|
|
11275
|
+
},
|
|
11276
|
+
"name": "metricClientErrors",
|
|
11277
|
+
"parameters": [
|
|
11278
|
+
{
|
|
11279
|
+
"name": "props",
|
|
11280
|
+
"optional": true,
|
|
11281
|
+
"type": {
|
|
11282
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11283
|
+
}
|
|
11284
|
+
}
|
|
11285
|
+
],
|
|
11286
|
+
"returns": {
|
|
11287
|
+
"type": {
|
|
11288
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11289
|
+
}
|
|
11290
|
+
}
|
|
11291
|
+
},
|
|
11292
|
+
{
|
|
11293
|
+
"docs": {
|
|
11294
|
+
"stability": "experimental",
|
|
11295
|
+
"summary": "Requests rejected with 429 because the endpoint reached `maxEnvironments` (`EndpointActiveEnvironmentThrottles`)."
|
|
11296
|
+
},
|
|
11297
|
+
"locationInModule": {
|
|
11298
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11299
|
+
"line": 412
|
|
11300
|
+
},
|
|
11301
|
+
"name": "metricEnvironmentThrottles",
|
|
11302
|
+
"parameters": [
|
|
11303
|
+
{
|
|
11304
|
+
"name": "props",
|
|
11305
|
+
"optional": true,
|
|
11306
|
+
"type": {
|
|
11307
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11308
|
+
}
|
|
11309
|
+
}
|
|
11310
|
+
],
|
|
11311
|
+
"returns": {
|
|
11312
|
+
"type": {
|
|
11313
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11314
|
+
}
|
|
11315
|
+
}
|
|
11316
|
+
},
|
|
11317
|
+
{
|
|
11318
|
+
"docs": {
|
|
11319
|
+
"remarks": "There's no separate count of successful (2XX) responses.",
|
|
11320
|
+
"stability": "experimental",
|
|
11321
|
+
"summary": "Requests the endpoint served (`ExecutedRequests`)."
|
|
11322
|
+
},
|
|
11323
|
+
"locationInModule": {
|
|
11324
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11325
|
+
"line": 367
|
|
11326
|
+
},
|
|
11327
|
+
"name": "metricRequests",
|
|
11328
|
+
"parameters": [
|
|
11329
|
+
{
|
|
11330
|
+
"name": "props",
|
|
11331
|
+
"optional": true,
|
|
11332
|
+
"type": {
|
|
11333
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11334
|
+
}
|
|
11335
|
+
}
|
|
11336
|
+
],
|
|
11337
|
+
"returns": {
|
|
11338
|
+
"type": {
|
|
11339
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11340
|
+
}
|
|
11341
|
+
}
|
|
11342
|
+
},
|
|
11343
|
+
{
|
|
11344
|
+
"docs": {
|
|
11345
|
+
"stability": "experimental",
|
|
11346
|
+
"summary": "Requests rejected with 429 because the endpoint reached its `rateLimit` (`EndpointRequestThrottles`)."
|
|
11347
|
+
},
|
|
11348
|
+
"locationInModule": {
|
|
11349
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11350
|
+
"line": 407
|
|
11351
|
+
},
|
|
11352
|
+
"name": "metricRequestThrottles",
|
|
11353
|
+
"parameters": [
|
|
11354
|
+
{
|
|
11355
|
+
"name": "props",
|
|
11356
|
+
"optional": true,
|
|
11357
|
+
"type": {
|
|
11358
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11359
|
+
}
|
|
11360
|
+
}
|
|
11361
|
+
],
|
|
11362
|
+
"returns": {
|
|
11363
|
+
"type": {
|
|
11364
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11365
|
+
}
|
|
11366
|
+
}
|
|
11367
|
+
},
|
|
11368
|
+
{
|
|
11369
|
+
"docs": {
|
|
11370
|
+
"remarks": "periods with no 5XX count as 0).",
|
|
11371
|
+
"stability": "experimental",
|
|
11372
|
+
"summary": "The percentage of requests answered with a 5XX status (math expression;"
|
|
10590
11373
|
},
|
|
10591
|
-
"
|
|
11374
|
+
"locationInModule": {
|
|
11375
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11376
|
+
"line": 393
|
|
11377
|
+
},
|
|
11378
|
+
"name": "metricServerErrorRate",
|
|
11379
|
+
"parameters": [
|
|
11380
|
+
{
|
|
11381
|
+
"name": "props",
|
|
11382
|
+
"optional": true,
|
|
11383
|
+
"type": {
|
|
11384
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11385
|
+
}
|
|
11386
|
+
}
|
|
11387
|
+
],
|
|
11388
|
+
"returns": {
|
|
11389
|
+
"type": {
|
|
11390
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MathExpression"
|
|
11391
|
+
}
|
|
11392
|
+
}
|
|
10592
11393
|
},
|
|
10593
11394
|
{
|
|
10594
11395
|
"docs": {
|
|
10595
|
-
"remarks": "
|
|
11396
|
+
"remarks": "Includes the platform's 503s while the endpoint\nscales up for a sudden burst, not only your application's errors. The metric only exists once it's non-zero.",
|
|
10596
11397
|
"stability": "experimental",
|
|
10597
|
-
"summary": "
|
|
11398
|
+
"summary": "Requests answered with a 5XX status (`HTTPResponseStatusClass5XX`)."
|
|
10598
11399
|
},
|
|
10599
|
-
"
|
|
10600
|
-
|
|
10601
|
-
|
|
10602
|
-
|
|
10603
|
-
|
|
10604
|
-
|
|
10605
|
-
|
|
10606
|
-
|
|
10607
|
-
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10613
|
-
|
|
10614
|
-
|
|
10615
|
-
|
|
10616
|
-
|
|
10617
|
-
|
|
10618
|
-
|
|
10619
|
-
"methods": [
|
|
11400
|
+
"locationInModule": {
|
|
11401
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11402
|
+
"line": 383
|
|
11403
|
+
},
|
|
11404
|
+
"name": "metricServerErrors",
|
|
11405
|
+
"parameters": [
|
|
11406
|
+
{
|
|
11407
|
+
"name": "props",
|
|
11408
|
+
"optional": true,
|
|
11409
|
+
"type": {
|
|
11410
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.MetricOptions"
|
|
11411
|
+
}
|
|
11412
|
+
}
|
|
11413
|
+
],
|
|
11414
|
+
"returns": {
|
|
11415
|
+
"type": {
|
|
11416
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.Metric"
|
|
11417
|
+
}
|
|
11418
|
+
}
|
|
11419
|
+
},
|
|
10620
11420
|
{
|
|
10621
11421
|
"docs": {
|
|
10622
11422
|
"remarks": "Only for `PER_REGION` endpoints.",
|
|
@@ -10625,7 +11425,7 @@
|
|
|
10625
11425
|
},
|
|
10626
11426
|
"locationInModule": {
|
|
10627
11427
|
"filename": "src/web-function-endpoint.ts",
|
|
10628
|
-
"line":
|
|
11428
|
+
"line": 298
|
|
10629
11429
|
},
|
|
10630
11430
|
"name": "regionalUrl",
|
|
10631
11431
|
"parameters": [
|
|
@@ -10644,10 +11444,57 @@
|
|
|
10644
11444
|
"primitive": "string"
|
|
10645
11445
|
}
|
|
10646
11446
|
}
|
|
11447
|
+
},
|
|
11448
|
+
{
|
|
11449
|
+
"docs": {
|
|
11450
|
+
"remarks": "`revision` gets the rest).\n\nUse it to keep an endpoint on an earlier revision (`WebFunctionRevision.fromRevisionAttributes`),\nor to send part of the traffic to the current revision:\n`fn.endpoint.routeTraffic(previous, [{ revision: fn.currentRevision, weight: 0.1 }])`.\nCan be called once per endpoint, and not on one created with `revision` or `additionalRevisions`.",
|
|
11451
|
+
"stability": "experimental",
|
|
11452
|
+
"summary": "Routes the endpoint to `revision` instead of the function's current revision, optionally sharing traffic with one more revision (`additionalRevisions`, which gets its weight;"
|
|
11453
|
+
},
|
|
11454
|
+
"locationInModule": {
|
|
11455
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11456
|
+
"line": 326
|
|
11457
|
+
},
|
|
11458
|
+
"name": "routeTraffic",
|
|
11459
|
+
"parameters": [
|
|
11460
|
+
{
|
|
11461
|
+
"name": "revision",
|
|
11462
|
+
"type": {
|
|
11463
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
11464
|
+
}
|
|
11465
|
+
},
|
|
11466
|
+
{
|
|
11467
|
+
"name": "additionalRevisions",
|
|
11468
|
+
"optional": true,
|
|
11469
|
+
"type": {
|
|
11470
|
+
"collection": {
|
|
11471
|
+
"elementtype": {
|
|
11472
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionWeight"
|
|
11473
|
+
},
|
|
11474
|
+
"kind": "array"
|
|
11475
|
+
}
|
|
11476
|
+
}
|
|
11477
|
+
}
|
|
11478
|
+
]
|
|
10647
11479
|
}
|
|
10648
11480
|
],
|
|
10649
11481
|
"name": "WebFunctionEndpoint",
|
|
10650
11482
|
"properties": [
|
|
11483
|
+
{
|
|
11484
|
+
"docs": {
|
|
11485
|
+
"stability": "experimental",
|
|
11486
|
+
"summary": "How callers of the endpoint are authenticated."
|
|
11487
|
+
},
|
|
11488
|
+
"immutable": true,
|
|
11489
|
+
"locationInModule": {
|
|
11490
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11491
|
+
"line": 177
|
|
11492
|
+
},
|
|
11493
|
+
"name": "authType",
|
|
11494
|
+
"type": {
|
|
11495
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType"
|
|
11496
|
+
}
|
|
11497
|
+
},
|
|
10651
11498
|
{
|
|
10652
11499
|
"docs": {
|
|
10653
11500
|
"stability": "experimental",
|
|
@@ -10656,7 +11503,7 @@
|
|
|
10656
11503
|
"immutable": true,
|
|
10657
11504
|
"locationInModule": {
|
|
10658
11505
|
"filename": "src/web-function-endpoint.ts",
|
|
10659
|
-
"line":
|
|
11506
|
+
"line": 185
|
|
10660
11507
|
},
|
|
10661
11508
|
"name": "domainName",
|
|
10662
11509
|
"type": {
|
|
@@ -10671,7 +11518,7 @@
|
|
|
10671
11518
|
"immutable": true,
|
|
10672
11519
|
"locationInModule": {
|
|
10673
11520
|
"filename": "src/web-function-endpoint.ts",
|
|
10674
|
-
"line":
|
|
11521
|
+
"line": 171
|
|
10675
11522
|
},
|
|
10676
11523
|
"name": "endpointArn",
|
|
10677
11524
|
"type": {
|
|
@@ -10686,7 +11533,7 @@
|
|
|
10686
11533
|
"immutable": true,
|
|
10687
11534
|
"locationInModule": {
|
|
10688
11535
|
"filename": "src/web-function-endpoint.ts",
|
|
10689
|
-
"line":
|
|
11536
|
+
"line": 168
|
|
10690
11537
|
},
|
|
10691
11538
|
"name": "endpointName",
|
|
10692
11539
|
"type": {
|
|
@@ -10701,13 +11548,28 @@
|
|
|
10701
11548
|
"immutable": true,
|
|
10702
11549
|
"locationInModule": {
|
|
10703
11550
|
"filename": "src/web-function-endpoint.ts",
|
|
10704
|
-
"line":
|
|
11551
|
+
"line": 174
|
|
10705
11552
|
},
|
|
10706
11553
|
"name": "endpointType",
|
|
10707
11554
|
"type": {
|
|
10708
11555
|
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType"
|
|
10709
11556
|
}
|
|
10710
11557
|
},
|
|
11558
|
+
{
|
|
11559
|
+
"docs": {
|
|
11560
|
+
"stability": "experimental",
|
|
11561
|
+
"summary": "Grants on this endpoint (e.g. `grants.invoke(principal)`)."
|
|
11562
|
+
},
|
|
11563
|
+
"immutable": true,
|
|
11564
|
+
"locationInModule": {
|
|
11565
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11566
|
+
"line": 193
|
|
11567
|
+
},
|
|
11568
|
+
"name": "grants",
|
|
11569
|
+
"type": {
|
|
11570
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants"
|
|
11571
|
+
}
|
|
11572
|
+
},
|
|
10711
11573
|
{
|
|
10712
11574
|
"docs": {
|
|
10713
11575
|
"stability": "experimental",
|
|
@@ -10716,7 +11578,7 @@
|
|
|
10716
11578
|
"immutable": true,
|
|
10717
11579
|
"locationInModule": {
|
|
10718
11580
|
"filename": "src/web-function-endpoint.ts",
|
|
10719
|
-
"line":
|
|
11581
|
+
"line": 180
|
|
10720
11582
|
},
|
|
10721
11583
|
"name": "regions",
|
|
10722
11584
|
"type": {
|
|
@@ -10728,6 +11590,27 @@
|
|
|
10728
11590
|
}
|
|
10729
11591
|
}
|
|
10730
11592
|
},
|
|
11593
|
+
{
|
|
11594
|
+
"docs": {
|
|
11595
|
+
"remarks": "Empty without `rollbackOn`.",
|
|
11596
|
+
"stability": "experimental",
|
|
11597
|
+
"summary": "The alarms this endpoint created for its deployment's `rollbackOn`, one per threshold in every region it serves from (the home region's first)."
|
|
11598
|
+
},
|
|
11599
|
+
"immutable": true,
|
|
11600
|
+
"locationInModule": {
|
|
11601
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11602
|
+
"line": 199
|
|
11603
|
+
},
|
|
11604
|
+
"name": "rollbackAlarms",
|
|
11605
|
+
"type": {
|
|
11606
|
+
"collection": {
|
|
11607
|
+
"elementtype": {
|
|
11608
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.IAlarm"
|
|
11609
|
+
},
|
|
11610
|
+
"kind": "array"
|
|
11611
|
+
}
|
|
11612
|
+
}
|
|
11613
|
+
},
|
|
10731
11614
|
{
|
|
10732
11615
|
"docs": {
|
|
10733
11616
|
"stability": "experimental",
|
|
@@ -10736,7 +11619,7 @@
|
|
|
10736
11619
|
"immutable": true,
|
|
10737
11620
|
"locationInModule": {
|
|
10738
11621
|
"filename": "src/web-function-endpoint.ts",
|
|
10739
|
-
"line":
|
|
11622
|
+
"line": 190
|
|
10740
11623
|
},
|
|
10741
11624
|
"name": "url",
|
|
10742
11625
|
"type": {
|
|
@@ -10757,22 +11640,59 @@
|
|
|
10757
11640
|
"kind": "interface",
|
|
10758
11641
|
"locationInModule": {
|
|
10759
11642
|
"filename": "src/web-function-endpoint.ts",
|
|
10760
|
-
"line":
|
|
11643
|
+
"line": 39
|
|
10761
11644
|
},
|
|
10762
11645
|
"name": "WebFunctionEndpointOptions",
|
|
10763
11646
|
"properties": [
|
|
10764
11647
|
{
|
|
10765
11648
|
"abstract": true,
|
|
10766
11649
|
"docs": {
|
|
10767
|
-
"default": "
|
|
10768
|
-
"remarks": "
|
|
11650
|
+
"default": "WebFunctionDeployment.allAtOnce()",
|
|
11651
|
+
"remarks": "A deployment in steps can't be combined with `revision`, `additionalRevisions` or `routeTraffic()`.",
|
|
10769
11652
|
"stability": "experimental",
|
|
10770
|
-
"summary": "
|
|
11653
|
+
"summary": "How the endpoint moves its traffic to a new revision: all at once, or in steps (`WebFunctionDeployment.canary()` or `linear()`) that watch CloudWatch alarms and move the traffic back when one goes into ALARM."
|
|
10771
11654
|
},
|
|
10772
11655
|
"immutable": true,
|
|
10773
11656
|
"locationInModule": {
|
|
10774
11657
|
"filename": "src/web-function-endpoint.ts",
|
|
10775
|
-
"line":
|
|
11658
|
+
"line": 106
|
|
11659
|
+
},
|
|
11660
|
+
"name": "deployment",
|
|
11661
|
+
"optional": true,
|
|
11662
|
+
"type": {
|
|
11663
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment"
|
|
11664
|
+
}
|
|
11665
|
+
},
|
|
11666
|
+
{
|
|
11667
|
+
"abstract": true,
|
|
11668
|
+
"docs": {
|
|
11669
|
+
"default": "- no description",
|
|
11670
|
+
"stability": "experimental",
|
|
11671
|
+
"summary": "A description of the endpoint."
|
|
11672
|
+
},
|
|
11673
|
+
"immutable": true,
|
|
11674
|
+
"locationInModule": {
|
|
11675
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11676
|
+
"line": 75
|
|
11677
|
+
},
|
|
11678
|
+
"name": "description",
|
|
11679
|
+
"optional": true,
|
|
11680
|
+
"type": {
|
|
11681
|
+
"primitive": "string"
|
|
11682
|
+
}
|
|
11683
|
+
},
|
|
11684
|
+
{
|
|
11685
|
+
"abstract": true,
|
|
11686
|
+
"docs": {
|
|
11687
|
+
"default": "- `default-<hash>` for the function's default endpoint, `<id>-<hash>` for endpoints added with `addEndpoint`",
|
|
11688
|
+
"remarks": "When omitted, the name ends in a hash of the endpoint type and regions, so changing either deploys\na new endpoint cleanly. When set, changing the endpoint type or regions also requires a new name:\ntwo endpoints of one function can't share a name, and CloudFormation creates the replacement\nbefore deleting the old one.",
|
|
11689
|
+
"stability": "experimental",
|
|
11690
|
+
"summary": "The endpoint's name, shown in logs (`endpointName`) and in the `lambda-web-endpoint-name` header. Names are unique per function."
|
|
11691
|
+
},
|
|
11692
|
+
"immutable": true,
|
|
11693
|
+
"locationInModule": {
|
|
11694
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11695
|
+
"line": 68
|
|
10776
11696
|
},
|
|
10777
11697
|
"name": "endpointName",
|
|
10778
11698
|
"optional": true,
|
|
@@ -10790,7 +11710,7 @@
|
|
|
10790
11710
|
"immutable": true,
|
|
10791
11711
|
"locationInModule": {
|
|
10792
11712
|
"filename": "src/web-function-endpoint.ts",
|
|
10793
|
-
"line":
|
|
11713
|
+
"line": 45
|
|
10794
11714
|
},
|
|
10795
11715
|
"name": "endpointType",
|
|
10796
11716
|
"optional": true,
|
|
@@ -10798,6 +11718,44 @@
|
|
|
10798
11718
|
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType"
|
|
10799
11719
|
}
|
|
10800
11720
|
},
|
|
11721
|
+
{
|
|
11722
|
+
"abstract": true,
|
|
11723
|
+
"docs": {
|
|
11724
|
+
"default": "- scales within the account's vCPU quota",
|
|
11725
|
+
"remarks": "Enforced separately in each region the endpoint serves from.",
|
|
11726
|
+
"stability": "experimental",
|
|
11727
|
+
"summary": "The most execution environments the endpoint may use (2–10,000). Each one uses 2 vCPUs of the account's quota."
|
|
11728
|
+
},
|
|
11729
|
+
"immutable": true,
|
|
11730
|
+
"locationInModule": {
|
|
11731
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11732
|
+
"line": 95
|
|
11733
|
+
},
|
|
11734
|
+
"name": "maxEnvironments",
|
|
11735
|
+
"optional": true,
|
|
11736
|
+
"type": {
|
|
11737
|
+
"primitive": "number"
|
|
11738
|
+
}
|
|
11739
|
+
},
|
|
11740
|
+
{
|
|
11741
|
+
"abstract": true,
|
|
11742
|
+
"docs": {
|
|
11743
|
+
"default": "- no limit beyond the service quota of 10,000 requests per second per endpoint (per region)",
|
|
11744
|
+
"remarks": "excess requests get HTTP 429.\nAllowed: 0 (blocks all traffic), 100–1,000 in steps of 100, or 2,000–10,000 in steps of 1,000.\n\nEnforced separately in each region the endpoint serves from, so a multi-region endpoint\ncan accept this many requests per second in every region.",
|
|
11745
|
+
"stability": "experimental",
|
|
11746
|
+
"summary": "The most requests per second the endpoint accepts;"
|
|
11747
|
+
},
|
|
11748
|
+
"immutable": true,
|
|
11749
|
+
"locationInModule": {
|
|
11750
|
+
"filename": "src/web-function-endpoint.ts",
|
|
11751
|
+
"line": 86
|
|
11752
|
+
},
|
|
11753
|
+
"name": "rateLimit",
|
|
11754
|
+
"optional": true,
|
|
11755
|
+
"type": {
|
|
11756
|
+
"primitive": "number"
|
|
11757
|
+
}
|
|
11758
|
+
},
|
|
10801
11759
|
{
|
|
10802
11760
|
"abstract": true,
|
|
10803
11761
|
"docs": {
|
|
@@ -10809,7 +11767,7 @@
|
|
|
10809
11767
|
"immutable": true,
|
|
10810
11768
|
"locationInModule": {
|
|
10811
11769
|
"filename": "src/web-function-endpoint.ts",
|
|
10812
|
-
"line":
|
|
11770
|
+
"line": 55
|
|
10813
11771
|
},
|
|
10814
11772
|
"name": "regions",
|
|
10815
11773
|
"optional": true,
|
|
@@ -10866,9 +11824,9 @@
|
|
|
10866
11824
|
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants": {
|
|
10867
11825
|
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
10868
11826
|
"docs": {
|
|
10869
|
-
"remarks": "Access
|
|
11827
|
+
"remarks": "Access them as `fn.grants` (the default endpoint) or `endpoint.grants`.",
|
|
10870
11828
|
"stability": "experimental",
|
|
10871
|
-
"summary": "Grants on a Web Function."
|
|
11829
|
+
"summary": "Grants on a Web Function endpoint."
|
|
10872
11830
|
},
|
|
10873
11831
|
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants",
|
|
10874
11832
|
"kind": "class",
|
|
@@ -10881,7 +11839,7 @@
|
|
|
10881
11839
|
"docs": {
|
|
10882
11840
|
"remarks": "The grant is on the endpoint's home-region ARN, which IAM evaluates for every region the\nendpoint serves from, including a MULTI_REGION global URL.",
|
|
10883
11841
|
"stability": "experimental",
|
|
10884
|
-
"summary": "Allows `grantee` to call the
|
|
11842
|
+
"summary": "Allows `grantee` to call the endpoint (`lambda:InvokeWebFunctionEndpoint`)."
|
|
10885
11843
|
},
|
|
10886
11844
|
"locationInModule": {
|
|
10887
11845
|
"filename": "src/web-function-grants.ts",
|
|
@@ -10906,6 +11864,99 @@
|
|
|
10906
11864
|
"name": "WebFunctionGrants",
|
|
10907
11865
|
"symbolId": "src/web-function-grants:WebFunctionGrants"
|
|
10908
11866
|
},
|
|
11867
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionLinearDeploymentOptions": {
|
|
11868
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
11869
|
+
"datatype": true,
|
|
11870
|
+
"docs": {
|
|
11871
|
+
"stability": "experimental",
|
|
11872
|
+
"summary": "Options for a linear deployment."
|
|
11873
|
+
},
|
|
11874
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionLinearDeploymentOptions",
|
|
11875
|
+
"kind": "interface",
|
|
11876
|
+
"locationInModule": {
|
|
11877
|
+
"filename": "src/web-function-deployment.ts",
|
|
11878
|
+
"line": 96
|
|
11879
|
+
},
|
|
11880
|
+
"name": "WebFunctionLinearDeploymentOptions",
|
|
11881
|
+
"properties": [
|
|
11882
|
+
{
|
|
11883
|
+
"abstract": true,
|
|
11884
|
+
"docs": {
|
|
11885
|
+
"stability": "experimental",
|
|
11886
|
+
"summary": "How long each step serves before the next one (at least 1 minute, and at most 45 minutes in total)."
|
|
11887
|
+
},
|
|
11888
|
+
"immutable": true,
|
|
11889
|
+
"locationInModule": {
|
|
11890
|
+
"filename": "src/web-function-deployment.ts",
|
|
11891
|
+
"line": 105
|
|
11892
|
+
},
|
|
11893
|
+
"name": "interval",
|
|
11894
|
+
"type": {
|
|
11895
|
+
"fqn": "aws-cdk-lib.Duration"
|
|
11896
|
+
}
|
|
11897
|
+
},
|
|
11898
|
+
{
|
|
11899
|
+
"abstract": true,
|
|
11900
|
+
"docs": {
|
|
11901
|
+
"stability": "experimental",
|
|
11902
|
+
"summary": "The share of traffic, in whole percent (5-50), that moves to the new revision at each step."
|
|
11903
|
+
},
|
|
11904
|
+
"immutable": true,
|
|
11905
|
+
"locationInModule": {
|
|
11906
|
+
"filename": "src/web-function-deployment.ts",
|
|
11907
|
+
"line": 100
|
|
11908
|
+
},
|
|
11909
|
+
"name": "percent",
|
|
11910
|
+
"type": {
|
|
11911
|
+
"primitive": "number"
|
|
11912
|
+
}
|
|
11913
|
+
},
|
|
11914
|
+
{
|
|
11915
|
+
"abstract": true,
|
|
11916
|
+
"docs": {
|
|
11917
|
+
"default": "- no alarms: traffic moves on a timer",
|
|
11918
|
+
"remarks": "They're checked before traffic moves, during every step, and once the new revision has all traffic.\nUse alarms in any region (by ARN), including composite alarms.",
|
|
11919
|
+
"stability": "experimental",
|
|
11920
|
+
"summary": "Alarms that stop the deployment: if one is in ALARM, the endpoint goes back to the previous revision and the deployment fails, so CloudFormation rolls the stack back."
|
|
11921
|
+
},
|
|
11922
|
+
"immutable": true,
|
|
11923
|
+
"locationInModule": {
|
|
11924
|
+
"filename": "src/web-function-deployment.ts",
|
|
11925
|
+
"line": 116
|
|
11926
|
+
},
|
|
11927
|
+
"name": "alarms",
|
|
11928
|
+
"optional": true,
|
|
11929
|
+
"type": {
|
|
11930
|
+
"collection": {
|
|
11931
|
+
"elementtype": {
|
|
11932
|
+
"fqn": "aws-cdk-lib.aws_cloudwatch.IAlarm"
|
|
11933
|
+
},
|
|
11934
|
+
"kind": "array"
|
|
11935
|
+
}
|
|
11936
|
+
}
|
|
11937
|
+
},
|
|
11938
|
+
{
|
|
11939
|
+
"abstract": true,
|
|
11940
|
+
"docs": {
|
|
11941
|
+
"default": "- no endpoint alarms",
|
|
11942
|
+
"remarks": "They stop the deployment like `alarms` (both can be used together).",
|
|
11943
|
+
"stability": "experimental",
|
|
11944
|
+
"summary": "Alarms on the endpoint's own error rates, created by the endpoint in every region it serves from."
|
|
11945
|
+
},
|
|
11946
|
+
"immutable": true,
|
|
11947
|
+
"locationInModule": {
|
|
11948
|
+
"filename": "src/web-function-deployment.ts",
|
|
11949
|
+
"line": 124
|
|
11950
|
+
},
|
|
11951
|
+
"name": "rollbackOn",
|
|
11952
|
+
"optional": true,
|
|
11953
|
+
"type": {
|
|
11954
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions"
|
|
11955
|
+
}
|
|
11956
|
+
}
|
|
11957
|
+
],
|
|
11958
|
+
"symbolId": "src/web-function-deployment:WebFunctionLinearDeploymentOptions"
|
|
11959
|
+
},
|
|
10909
11960
|
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionOptions": {
|
|
10910
11961
|
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
10911
11962
|
"datatype": true,
|
|
@@ -10917,7 +11968,7 @@
|
|
|
10917
11968
|
"kind": "interface",
|
|
10918
11969
|
"locationInModule": {
|
|
10919
11970
|
"filename": "src/web-function.ts",
|
|
10920
|
-
"line":
|
|
11971
|
+
"line": 23
|
|
10921
11972
|
},
|
|
10922
11973
|
"name": "WebFunctionOptions",
|
|
10923
11974
|
"properties": [
|
|
@@ -10930,7 +11981,7 @@
|
|
|
10930
11981
|
"immutable": true,
|
|
10931
11982
|
"locationInModule": {
|
|
10932
11983
|
"filename": "src/web-function.ts",
|
|
10933
|
-
"line":
|
|
11984
|
+
"line": 27
|
|
10934
11985
|
},
|
|
10935
11986
|
"name": "authType",
|
|
10936
11987
|
"type": {
|
|
@@ -10947,7 +11998,7 @@
|
|
|
10947
11998
|
"immutable": true,
|
|
10948
11999
|
"locationInModule": {
|
|
10949
12000
|
"filename": "src/web-function.ts",
|
|
10950
|
-
"line":
|
|
12001
|
+
"line": 116
|
|
10951
12002
|
},
|
|
10952
12003
|
"name": "applicationLogLevelV2",
|
|
10953
12004
|
"optional": true,
|
|
@@ -10965,7 +12016,7 @@
|
|
|
10965
12016
|
"immutable": true,
|
|
10966
12017
|
"locationInModule": {
|
|
10967
12018
|
"filename": "src/web-function.ts",
|
|
10968
|
-
"line":
|
|
12019
|
+
"line": 62
|
|
10969
12020
|
},
|
|
10970
12021
|
"name": "description",
|
|
10971
12022
|
"optional": true,
|
|
@@ -10976,14 +12027,14 @@
|
|
|
10976
12027
|
{
|
|
10977
12028
|
"abstract": true,
|
|
10978
12029
|
"docs": {
|
|
10979
|
-
"default": "- a HOME_REGION endpoint",
|
|
12030
|
+
"default": "- a HOME_REGION endpoint serving the current revision",
|
|
10980
12031
|
"stability": "experimental",
|
|
10981
|
-
"summary": "The endpoint: where it serves from,
|
|
12032
|
+
"summary": "The default endpoint (`fn.endpoint`): where it serves from, its name and limits. It serves the current revision; route it elsewhere with `fn.endpoint.routeTraffic()`. Add more endpoints with `addEndpoint`."
|
|
10982
12033
|
},
|
|
10983
12034
|
"immutable": true,
|
|
10984
12035
|
"locationInModule": {
|
|
10985
12036
|
"filename": "src/web-function.ts",
|
|
10986
|
-
"line":
|
|
12037
|
+
"line": 36
|
|
10987
12038
|
},
|
|
10988
12039
|
"name": "endpoint",
|
|
10989
12040
|
"optional": true,
|
|
@@ -11002,7 +12053,7 @@
|
|
|
11002
12053
|
"immutable": true,
|
|
11003
12054
|
"locationInModule": {
|
|
11004
12055
|
"filename": "src/web-function.ts",
|
|
11005
|
-
"line":
|
|
12056
|
+
"line": 79
|
|
11006
12057
|
},
|
|
11007
12058
|
"name": "environment",
|
|
11008
12059
|
"optional": true,
|
|
@@ -11026,7 +12077,7 @@
|
|
|
11026
12077
|
"immutable": true,
|
|
11027
12078
|
"locationInModule": {
|
|
11028
12079
|
"filename": "src/web-function.ts",
|
|
11029
|
-
"line":
|
|
12080
|
+
"line": 109
|
|
11030
12081
|
},
|
|
11031
12082
|
"name": "logRemovalPolicy",
|
|
11032
12083
|
"optional": true,
|
|
@@ -11044,7 +12095,7 @@
|
|
|
11044
12095
|
"immutable": true,
|
|
11045
12096
|
"locationInModule": {
|
|
11046
12097
|
"filename": "src/web-function.ts",
|
|
11047
|
-
"line":
|
|
12098
|
+
"line": 101
|
|
11048
12099
|
},
|
|
11049
12100
|
"name": "logRetention",
|
|
11050
12101
|
"optional": true,
|
|
@@ -11063,7 +12114,7 @@
|
|
|
11063
12114
|
"immutable": true,
|
|
11064
12115
|
"locationInModule": {
|
|
11065
12116
|
"filename": "src/web-function.ts",
|
|
11066
|
-
"line":
|
|
12117
|
+
"line": 94
|
|
11067
12118
|
},
|
|
11068
12119
|
"name": "maxConcurrencyPerEnvironment",
|
|
11069
12120
|
"optional": true,
|
|
@@ -11071,6 +12122,25 @@
|
|
|
11071
12122
|
"primitive": "number"
|
|
11072
12123
|
}
|
|
11073
12124
|
},
|
|
12125
|
+
{
|
|
12126
|
+
"abstract": true,
|
|
12127
|
+
"docs": {
|
|
12128
|
+
"default": "20",
|
|
12129
|
+
"remarks": "Each deployment that changes the code or\nconfiguration creates a revision; older ones stay available to roll back to or route traffic to,\nand the oldest beyond this count are deleted after each deployment.\n\nRevisions that an endpoint routes to are never deleted, and neither are those the previous\ndeployment used (a rollback returns to them).",
|
|
12130
|
+
"stability": "experimental",
|
|
12131
|
+
"summary": "How many of the newest revisions to keep (1-50)."
|
|
12132
|
+
},
|
|
12133
|
+
"immutable": true,
|
|
12134
|
+
"locationInModule": {
|
|
12135
|
+
"filename": "src/web-function.ts",
|
|
12136
|
+
"line": 48
|
|
12137
|
+
},
|
|
12138
|
+
"name": "revisionRetention",
|
|
12139
|
+
"optional": true,
|
|
12140
|
+
"type": {
|
|
12141
|
+
"primitive": "number"
|
|
12142
|
+
}
|
|
12143
|
+
},
|
|
11074
12144
|
{
|
|
11075
12145
|
"abstract": true,
|
|
11076
12146
|
"docs": {
|
|
@@ -11082,7 +12152,7 @@
|
|
|
11082
12152
|
"immutable": true,
|
|
11083
12153
|
"locationInModule": {
|
|
11084
12154
|
"filename": "src/web-function.ts",
|
|
11085
|
-
"line":
|
|
12155
|
+
"line": 72
|
|
11086
12156
|
},
|
|
11087
12157
|
"name": "role",
|
|
11088
12158
|
"optional": true,
|
|
@@ -11100,7 +12170,7 @@
|
|
|
11100
12170
|
"immutable": true,
|
|
11101
12171
|
"locationInModule": {
|
|
11102
12172
|
"filename": "src/web-function.ts",
|
|
11103
|
-
"line":
|
|
12173
|
+
"line": 123
|
|
11104
12174
|
},
|
|
11105
12175
|
"name": "systemLogLevelV2",
|
|
11106
12176
|
"optional": true,
|
|
@@ -11118,7 +12188,7 @@
|
|
|
11118
12188
|
"immutable": true,
|
|
11119
12189
|
"locationInModule": {
|
|
11120
12190
|
"filename": "src/web-function.ts",
|
|
11121
|
-
"line":
|
|
12191
|
+
"line": 86
|
|
11122
12192
|
},
|
|
11123
12193
|
"name": "timeout",
|
|
11124
12194
|
"optional": true,
|
|
@@ -11137,7 +12207,7 @@
|
|
|
11137
12207
|
"immutable": true,
|
|
11138
12208
|
"locationInModule": {
|
|
11139
12209
|
"filename": "src/web-function.ts",
|
|
11140
|
-
"line":
|
|
12210
|
+
"line": 55
|
|
11141
12211
|
},
|
|
11142
12212
|
"name": "webFunctionName",
|
|
11143
12213
|
"optional": true,
|
|
@@ -11162,7 +12232,7 @@
|
|
|
11162
12232
|
"kind": "interface",
|
|
11163
12233
|
"locationInModule": {
|
|
11164
12234
|
"filename": "src/web-function.ts",
|
|
11165
|
-
"line":
|
|
12235
|
+
"line": 129
|
|
11166
12236
|
},
|
|
11167
12237
|
"name": "WebFunctionProps",
|
|
11168
12238
|
"properties": [
|
|
@@ -11176,7 +12246,7 @@
|
|
|
11176
12246
|
"immutable": true,
|
|
11177
12247
|
"locationInModule": {
|
|
11178
12248
|
"filename": "src/web-function.ts",
|
|
11179
|
-
"line":
|
|
12249
|
+
"line": 141
|
|
11180
12250
|
},
|
|
11181
12251
|
"name": "code",
|
|
11182
12252
|
"type": {
|
|
@@ -11192,7 +12262,7 @@
|
|
|
11192
12262
|
"immutable": true,
|
|
11193
12263
|
"locationInModule": {
|
|
11194
12264
|
"filename": "src/web-function.ts",
|
|
11195
|
-
"line":
|
|
12265
|
+
"line": 133
|
|
11196
12266
|
},
|
|
11197
12267
|
"name": "runtime",
|
|
11198
12268
|
"type": {
|
|
@@ -11209,7 +12279,7 @@
|
|
|
11209
12279
|
"immutable": true,
|
|
11210
12280
|
"locationInModule": {
|
|
11211
12281
|
"filename": "src/web-function.ts",
|
|
11212
|
-
"line":
|
|
12282
|
+
"line": 148
|
|
11213
12283
|
},
|
|
11214
12284
|
"name": "entrypoint",
|
|
11215
12285
|
"optional": true,
|
|
@@ -11219,8 +12289,328 @@
|
|
|
11219
12289
|
}
|
|
11220
12290
|
],
|
|
11221
12291
|
"symbolId": "src/web-function:WebFunctionProps"
|
|
12292
|
+
},
|
|
12293
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision": {
|
|
12294
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
12295
|
+
"base": "constructs.Construct",
|
|
12296
|
+
"docs": {
|
|
12297
|
+
"remarks": "`WebFunction` creates its current revision (`fn.currentRevision`) from its code and configuration.\nUse `fromRevisionAttributes` to route an endpoint to an earlier one, which must still exist:\nonly revisions within `revisionRetention`, or that an endpoint routes to, are kept.",
|
|
12298
|
+
"stability": "experimental",
|
|
12299
|
+
"summary": "A revision of a Web Function."
|
|
12300
|
+
},
|
|
12301
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision",
|
|
12302
|
+
"interfaces": [
|
|
12303
|
+
"@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
12304
|
+
],
|
|
12305
|
+
"kind": "class",
|
|
12306
|
+
"locationInModule": {
|
|
12307
|
+
"filename": "src/web-function-revision.ts",
|
|
12308
|
+
"line": 36
|
|
12309
|
+
},
|
|
12310
|
+
"methods": [
|
|
12311
|
+
{
|
|
12312
|
+
"docs": {
|
|
12313
|
+
"stability": "experimental",
|
|
12314
|
+
"summary": "References an existing revision of `webFunction`, e.g. to pin an endpoint to it or split traffic with it."
|
|
12315
|
+
},
|
|
12316
|
+
"locationInModule": {
|
|
12317
|
+
"filename": "src/web-function-revision.ts",
|
|
12318
|
+
"line": 40
|
|
12319
|
+
},
|
|
12320
|
+
"name": "fromRevisionAttributes",
|
|
12321
|
+
"parameters": [
|
|
12322
|
+
{
|
|
12323
|
+
"name": "scope",
|
|
12324
|
+
"type": {
|
|
12325
|
+
"fqn": "constructs.Construct"
|
|
12326
|
+
}
|
|
12327
|
+
},
|
|
12328
|
+
{
|
|
12329
|
+
"name": "id",
|
|
12330
|
+
"type": {
|
|
12331
|
+
"primitive": "string"
|
|
12332
|
+
}
|
|
12333
|
+
},
|
|
12334
|
+
{
|
|
12335
|
+
"name": "attrs",
|
|
12336
|
+
"type": {
|
|
12337
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionAttributes"
|
|
12338
|
+
}
|
|
12339
|
+
}
|
|
12340
|
+
],
|
|
12341
|
+
"returns": {
|
|
12342
|
+
"type": {
|
|
12343
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
12344
|
+
}
|
|
12345
|
+
},
|
|
12346
|
+
"static": true
|
|
12347
|
+
}
|
|
12348
|
+
],
|
|
12349
|
+
"name": "WebFunctionRevision",
|
|
12350
|
+
"properties": [
|
|
12351
|
+
{
|
|
12352
|
+
"docs": {
|
|
12353
|
+
"stability": "experimental",
|
|
12354
|
+
"summary": "The revision's ARN."
|
|
12355
|
+
},
|
|
12356
|
+
"immutable": true,
|
|
12357
|
+
"locationInModule": {
|
|
12358
|
+
"filename": "src/web-function-revision.ts",
|
|
12359
|
+
"line": 57
|
|
12360
|
+
},
|
|
12361
|
+
"name": "revisionArn",
|
|
12362
|
+
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision",
|
|
12363
|
+
"type": {
|
|
12364
|
+
"primitive": "string"
|
|
12365
|
+
}
|
|
12366
|
+
},
|
|
12367
|
+
{
|
|
12368
|
+
"docs": {
|
|
12369
|
+
"stability": "experimental",
|
|
12370
|
+
"summary": "The revision's ID, e.g. `rev-a1b2c`."
|
|
12371
|
+
},
|
|
12372
|
+
"immutable": true,
|
|
12373
|
+
"locationInModule": {
|
|
12374
|
+
"filename": "src/web-function-revision.ts",
|
|
12375
|
+
"line": 56
|
|
12376
|
+
},
|
|
12377
|
+
"name": "revisionId",
|
|
12378
|
+
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision",
|
|
12379
|
+
"type": {
|
|
12380
|
+
"primitive": "string"
|
|
12381
|
+
}
|
|
12382
|
+
},
|
|
12383
|
+
{
|
|
12384
|
+
"docs": {
|
|
12385
|
+
"stability": "experimental",
|
|
12386
|
+
"summary": "The function the revision belongs to."
|
|
12387
|
+
},
|
|
12388
|
+
"immutable": true,
|
|
12389
|
+
"locationInModule": {
|
|
12390
|
+
"filename": "src/web-function-revision.ts",
|
|
12391
|
+
"line": 55
|
|
12392
|
+
},
|
|
12393
|
+
"name": "webFunction",
|
|
12394
|
+
"overrides": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision",
|
|
12395
|
+
"type": {
|
|
12396
|
+
"fqn": "aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef"
|
|
12397
|
+
}
|
|
12398
|
+
}
|
|
12399
|
+
],
|
|
12400
|
+
"symbolId": "src/web-function-revision:WebFunctionRevision"
|
|
12401
|
+
},
|
|
12402
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionAttributes": {
|
|
12403
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
12404
|
+
"datatype": true,
|
|
12405
|
+
"docs": {
|
|
12406
|
+
"stability": "experimental",
|
|
12407
|
+
"summary": "Attributes of an existing revision."
|
|
12408
|
+
},
|
|
12409
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionAttributes",
|
|
12410
|
+
"kind": "interface",
|
|
12411
|
+
"locationInModule": {
|
|
12412
|
+
"filename": "src/web-function-revision.ts",
|
|
12413
|
+
"line": 21
|
|
12414
|
+
},
|
|
12415
|
+
"name": "WebFunctionRevisionAttributes",
|
|
12416
|
+
"properties": [
|
|
12417
|
+
{
|
|
12418
|
+
"abstract": true,
|
|
12419
|
+
"docs": {
|
|
12420
|
+
"stability": "experimental",
|
|
12421
|
+
"summary": "The revision's ID, e.g. `rev-a1b2c` (the `revisionId` of an earlier deployment)."
|
|
12422
|
+
},
|
|
12423
|
+
"immutable": true,
|
|
12424
|
+
"locationInModule": {
|
|
12425
|
+
"filename": "src/web-function-revision.ts",
|
|
12426
|
+
"line": 26
|
|
12427
|
+
},
|
|
12428
|
+
"name": "revisionId",
|
|
12429
|
+
"type": {
|
|
12430
|
+
"primitive": "string"
|
|
12431
|
+
}
|
|
12432
|
+
},
|
|
12433
|
+
{
|
|
12434
|
+
"abstract": true,
|
|
12435
|
+
"docs": {
|
|
12436
|
+
"stability": "experimental",
|
|
12437
|
+
"summary": "The function the revision belongs to."
|
|
12438
|
+
},
|
|
12439
|
+
"immutable": true,
|
|
12440
|
+
"locationInModule": {
|
|
12441
|
+
"filename": "src/web-function-revision.ts",
|
|
12442
|
+
"line": 23
|
|
12443
|
+
},
|
|
12444
|
+
"name": "webFunction",
|
|
12445
|
+
"type": {
|
|
12446
|
+
"fqn": "aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef"
|
|
12447
|
+
}
|
|
12448
|
+
}
|
|
12449
|
+
],
|
|
12450
|
+
"symbolId": "src/web-function-revision:WebFunctionRevisionAttributes"
|
|
12451
|
+
},
|
|
12452
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionWeight": {
|
|
12453
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
12454
|
+
"datatype": true,
|
|
12455
|
+
"docs": {
|
|
12456
|
+
"stability": "experimental",
|
|
12457
|
+
"summary": "A revision and the share of an endpoint's traffic it receives."
|
|
12458
|
+
},
|
|
12459
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionWeight",
|
|
12460
|
+
"kind": "interface",
|
|
12461
|
+
"locationInModule": {
|
|
12462
|
+
"filename": "src/web-function-endpoint.ts",
|
|
12463
|
+
"line": 25
|
|
12464
|
+
},
|
|
12465
|
+
"name": "WebFunctionRevisionWeight",
|
|
12466
|
+
"properties": [
|
|
12467
|
+
{
|
|
12468
|
+
"abstract": true,
|
|
12469
|
+
"docs": {
|
|
12470
|
+
"stability": "experimental",
|
|
12471
|
+
"summary": "The revision."
|
|
12472
|
+
},
|
|
12473
|
+
"immutable": true,
|
|
12474
|
+
"locationInModule": {
|
|
12475
|
+
"filename": "src/web-function-endpoint.ts",
|
|
12476
|
+
"line": 27
|
|
12477
|
+
},
|
|
12478
|
+
"name": "revision",
|
|
12479
|
+
"type": {
|
|
12480
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision"
|
|
12481
|
+
}
|
|
12482
|
+
},
|
|
12483
|
+
{
|
|
12484
|
+
"abstract": true,
|
|
12485
|
+
"docs": {
|
|
12486
|
+
"stability": "experimental",
|
|
12487
|
+
"summary": "The revision's share of the endpoint's traffic, as a fraction (like `lambda.Alias` `additionalVersions`). Must be a whole percentage from 0.01 to 0.99."
|
|
12488
|
+
},
|
|
12489
|
+
"immutable": true,
|
|
12490
|
+
"locationInModule": {
|
|
12491
|
+
"filename": "src/web-function-endpoint.ts",
|
|
12492
|
+
"line": 33
|
|
12493
|
+
},
|
|
12494
|
+
"name": "weight",
|
|
12495
|
+
"type": {
|
|
12496
|
+
"primitive": "number"
|
|
12497
|
+
}
|
|
12498
|
+
}
|
|
12499
|
+
],
|
|
12500
|
+
"symbolId": "src/web-function-endpoint:WebFunctionRevisionWeight"
|
|
12501
|
+
},
|
|
12502
|
+
"@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions": {
|
|
12503
|
+
"assembly": "@ashishpandeyone/cdk-lambda-web-function",
|
|
12504
|
+
"datatype": true,
|
|
12505
|
+
"docs": {
|
|
12506
|
+
"remarks": "The endpoint creates one alarm per threshold in every region it serves from (metrics are published\nin the region that served the request, and an alarm can only watch metrics in its own region).\nLambda Web Function metrics have no revision dimension, so the alarms watch the whole endpoint: while\nthe new revision gets 10% of the traffic, its errors are about a tenth of the endpoint's.",
|
|
12507
|
+
"stability": "experimental",
|
|
12508
|
+
"summary": "Alarms an endpoint creates on its own metrics to stop a canary or linear deployment."
|
|
12509
|
+
},
|
|
12510
|
+
"fqn": "@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions",
|
|
12511
|
+
"kind": "interface",
|
|
12512
|
+
"locationInModule": {
|
|
12513
|
+
"filename": "src/web-function-deployment.ts",
|
|
12514
|
+
"line": 18
|
|
12515
|
+
},
|
|
12516
|
+
"name": "WebFunctionRollbackOptions",
|
|
12517
|
+
"properties": [
|
|
12518
|
+
{
|
|
12519
|
+
"abstract": true,
|
|
12520
|
+
"docs": {
|
|
12521
|
+
"default": "- no client error alarm",
|
|
12522
|
+
"remarks": "Requests over `rateLimit` or `maxEnvironments` get 429, which counts here.",
|
|
12523
|
+
"stability": "experimental",
|
|
12524
|
+
"summary": "Roll back when more than this percent of the endpoint's requests get a 4XX response (0-100)."
|
|
12525
|
+
},
|
|
12526
|
+
"immutable": true,
|
|
12527
|
+
"locationInModule": {
|
|
12528
|
+
"filename": "src/web-function-deployment.ts",
|
|
12529
|
+
"line": 34
|
|
12530
|
+
},
|
|
12531
|
+
"name": "clientErrorRate",
|
|
12532
|
+
"optional": true,
|
|
12533
|
+
"type": {
|
|
12534
|
+
"primitive": "number"
|
|
12535
|
+
}
|
|
12536
|
+
},
|
|
12537
|
+
{
|
|
12538
|
+
"abstract": true,
|
|
12539
|
+
"docs": {
|
|
12540
|
+
"default": "2",
|
|
12541
|
+
"stability": "experimental",
|
|
12542
|
+
"summary": "How many consecutive periods must breach a threshold before the deployment rolls back."
|
|
12543
|
+
},
|
|
12544
|
+
"immutable": true,
|
|
12545
|
+
"locationInModule": {
|
|
12546
|
+
"filename": "src/web-function-deployment.ts",
|
|
12547
|
+
"line": 55
|
|
12548
|
+
},
|
|
12549
|
+
"name": "evaluationPeriods",
|
|
12550
|
+
"optional": true,
|
|
12551
|
+
"type": {
|
|
12552
|
+
"primitive": "number"
|
|
12553
|
+
}
|
|
12554
|
+
},
|
|
12555
|
+
{
|
|
12556
|
+
"abstract": true,
|
|
12557
|
+
"docs": {
|
|
12558
|
+
"default": "10",
|
|
12559
|
+
"stability": "experimental",
|
|
12560
|
+
"summary": "Periods with fewer requests than this don't count, so one failed request out of two doesn't roll back."
|
|
12561
|
+
},
|
|
12562
|
+
"immutable": true,
|
|
12563
|
+
"locationInModule": {
|
|
12564
|
+
"filename": "src/web-function-deployment.ts",
|
|
12565
|
+
"line": 41
|
|
12566
|
+
},
|
|
12567
|
+
"name": "minimumRequests",
|
|
12568
|
+
"optional": true,
|
|
12569
|
+
"type": {
|
|
12570
|
+
"primitive": "number"
|
|
12571
|
+
}
|
|
12572
|
+
},
|
|
12573
|
+
{
|
|
12574
|
+
"abstract": true,
|
|
12575
|
+
"docs": {
|
|
12576
|
+
"default": "Duration.minutes(1)",
|
|
12577
|
+
"stability": "experimental",
|
|
12578
|
+
"summary": "The period each rate is measured over (at least 1 minute, in whole minutes)."
|
|
12579
|
+
},
|
|
12580
|
+
"immutable": true,
|
|
12581
|
+
"locationInModule": {
|
|
12582
|
+
"filename": "src/web-function-deployment.ts",
|
|
12583
|
+
"line": 48
|
|
12584
|
+
},
|
|
12585
|
+
"name": "period",
|
|
12586
|
+
"optional": true,
|
|
12587
|
+
"type": {
|
|
12588
|
+
"fqn": "aws-cdk-lib.Duration"
|
|
12589
|
+
}
|
|
12590
|
+
},
|
|
12591
|
+
{
|
|
12592
|
+
"abstract": true,
|
|
12593
|
+
"docs": {
|
|
12594
|
+
"default": "- no server error alarm",
|
|
12595
|
+
"remarks": "5XX includes the platform's 503s while an endpoint scales up for a sudden burst, not only your application's errors.",
|
|
12596
|
+
"stability": "experimental",
|
|
12597
|
+
"summary": "Roll back when more than this percent of the endpoint's requests get a 5XX response (0-100)."
|
|
12598
|
+
},
|
|
12599
|
+
"immutable": true,
|
|
12600
|
+
"locationInModule": {
|
|
12601
|
+
"filename": "src/web-function-deployment.ts",
|
|
12602
|
+
"line": 26
|
|
12603
|
+
},
|
|
12604
|
+
"name": "serverErrorRate",
|
|
12605
|
+
"optional": true,
|
|
12606
|
+
"type": {
|
|
12607
|
+
"primitive": "number"
|
|
12608
|
+
}
|
|
12609
|
+
}
|
|
12610
|
+
],
|
|
12611
|
+
"symbolId": "src/web-function-deployment:WebFunctionRollbackOptions"
|
|
11222
12612
|
}
|
|
11223
12613
|
},
|
|
11224
|
-
"version": "0.1.
|
|
11225
|
-
"fingerprint": "
|
|
12614
|
+
"version": "0.1.3",
|
|
12615
|
+
"fingerprint": "F4xpSs8RKEtfPPB2ssJBW33WiisXtZt7E1UR0EZcJQs="
|
|
11226
12616
|
}
|