@ashishpandeyone/cdk-lambda-web-function 0.1.8 → 0.1.9
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 +71 -71
- package/.jsii.tabl.json +1 -1
- package/README.md +18 -2
- package/lib/nodejs-web-function.js +1 -1
- package/lib/private/code-bucket.js +3 -1
- package/lib/private/nag.d.ts +19 -0
- package/lib/private/nag.js +139 -0
- package/lib/private/traffic-shift.js +10 -6
- package/lib/web-function-deployment.js +1 -1
- package/lib/web-function-endpoint.js +1 -1
- package/lib/web-function-grants.js +1 -1
- package/lib/web-function-origin.js +1 -1
- package/lib/web-function-revision.js +1 -1
- package/lib/web-function.d.ts +6 -0
- package/lib/web-function.js +30 -8
- package/package.json +1 -1
package/.jsii.tabl.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2","toolVersion":"6.0.19","snippets":{"b722e8cfc284c4ad172d3c0845a1e12986655461f32df0e464aeccc8774b0a91":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\nimport aws_cdk.aws_lambda as lambda_\nfrom ashishpandeyone.cdk_lambda_web_function import WebFunction, WebFunctionAuthType, WebFunctionEndpointType\n\n\nfn = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\n endpoint_type=WebFunctionEndpointType.MULTI_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"]\n )\n)\n\nCfnOutput(self, \"Url\", value=fn.endpoint.url)","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Lambda;\nusing Ashishpandeyone.Cdk.Lambda.Web.Function;\n\n\nvar fn = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\n EndpointType = WebFunctionEndpointType.MULTI_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" }\n }\n});\n\nnew CfnOutput(this, \"Url\", new CfnOutputProps { Value = fn.Endpoint.Url });","version":"2"},"java":{"source":"import software.amazon.awscdk.services.lambda.*;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunction;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunctionAuthType;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunctionEndpointType;\n\n\nWebFunction fn = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\n .endpointType(WebFunctionEndpointType.MULTI_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .build())\n .build();\n\nCfnOutput.Builder.create(this, \"Url\").value(fn.getEndpoint().getUrl()).build();","version":"1"},"go":{"source":"import \"github.com/aws/aws-cdk-go/awscdk\"\nimport \"github.com/aws-samples/dummy/ashishpandeyonecdklambdawebfunction\"\n\n\nfn := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_MULTI_REGION,\n\t\tRegions: []*string{\n\t\t\tjsii.String(\"us-east-1\"),\n\t\t\tjsii.String(\"eu-west-1\"),\n\t\t},\n\t},\n})\n\nawscdk.NewCfnOutput(this, jsii.String(\"Url\"), &CfnOutputProps{\n\tValue: fn.Endpoint.Url,\n})","version":"2"},"$":{"source":"import * 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","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":21}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#url","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#MULTI_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture for examples that show their own imports.\nimport { Construct } from 'constructs';\nimport { CfnOutput, Stack } from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\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 });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":27,"110":2,"210":1,"211":3,"212":8,"214":1,"215":2,"244":1,"245":1,"261":1,"262":1,"273":2,"274":2,"275":1,"276":1,"277":3,"304":7,"308":1},"fqnsFingerprint":"4e5fc5d44a21de1b0ed2c637a7f93a37e8d9ee7e77047611aa76f9b8f043a39d"},"bb3f6414fcc3c98134fd029d5100626c240c5a2a293b9cac8457e3ad6fabedfe":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\nper_region = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\n endpoint_type=WebFunctionEndpointType.PER_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"]\n )\n)\n\nCfnOutput(self, \"UsEast1Url\", value=per_region.endpoint.regional_url(\"us-east-1\"))","version":"2"},"csharp":{"source":"var perRegion = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\n EndpointType = WebFunctionEndpointType.PER_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" }\n }\n});\n\nnew CfnOutput(this, \"UsEast1Url\", new CfnOutputProps { Value = perRegion.Endpoint.RegionalUrl(\"us-east-1\") });","version":"2"},"java":{"source":"WebFunction perRegion = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\n .endpointType(WebFunctionEndpointType.PER_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .build())\n .build();\n\nCfnOutput.Builder.create(this, \"UsEast1Url\").value(perRegion.endpoint.regionalUrl(\"us-east-1\")).build();","version":"1"},"go":{"source":"perRegion := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_PER_REGION,\n\t\tRegions: []*string{\n\t\t\tjsii.String(\"us-east-1\"),\n\t\t\tjsii.String(\"eu-west-1\"),\n\t\t},\n\t},\n})\n\nawscdk.NewCfnOutput(this, jsii.String(\"UsEast1Url\"), &CfnOutputProps{\n\tValue: perRegion.Endpoint.RegionalUrl(jsii.String(\"us-east-1\")),\n})","version":"2"},"$":{"source":"const 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']","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":78}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#regionalUrl","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#PER_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":6,"80":23,"110":2,"210":1,"211":3,"212":8,"214":2,"215":2,"244":1,"245":1,"261":1,"262":1,"304":7},"fqnsFingerprint":"fed6b94404f9811f4748975c1a35478b0b73840d2b875416c69d12f76c3969d0"},"076f6a80f55cad4801faa6bdc51de62d91e952006fd82731ca584333919e5c46":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\napi = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.NONE, # the default endpoint is public\n endpoint=WebFunctionEndpointOptions(rate_limit=1000)\n)\n\ninternal = api.add_endpoint(\"Internal\",\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint_type=WebFunctionEndpointType.MULTI_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"],\n description=\"Service-to-service traffic\",\n max_environments=50\n)\ninternal.grant_invoke(consumer_role)\nCfnOutput(self, \"InternalUrl\", value=internal.url)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.NONE, // the default endpoint is public\n Endpoint = new WebFunctionEndpointOptions { RateLimit = 1000 }\n});\n\nvar internal = api.AddEndpoint(\"Internal\", new AddWebFunctionEndpointOptions {\n AuthType = WebFunctionAuthType.AWS_IAM,\n EndpointType = WebFunctionEndpointType.MULTI_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" },\n Description = \"Service-to-service traffic\",\n MaxEnvironments = 50\n});\ninternal.GrantInvoke(consumerRole);\nnew CfnOutput(this, \"InternalUrl\", new CfnOutputProps { Value = internal.Url });","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.NONE) // the default endpoint is public\n .endpoint(WebFunctionEndpointOptions.builder().rateLimit(1000).build())\n .build();\n\nWebFunctionEndpoint internal = api.addEndpoint(\"Internal\", AddWebFunctionEndpointOptions.builder()\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpointType(WebFunctionEndpointType.MULTI_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .description(\"Service-to-service traffic\")\n .maxEnvironments(50)\n .build());\ninternal.grantInvoke(consumerRole);\nCfnOutput.Builder.create(this, \"InternalUrl\").value(internal.getUrl()).build();","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_NONE,\n\t // the default endpoint is public\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tRateLimit: jsii.Number(1000),\n\t},\n})\n\ninternal := api.AddEndpoint(jsii.String(\"Internal\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_MULTI_REGION,\n\tRegions: []*string{\n\t\tjsii.String(\"us-east-1\"),\n\t\tjsii.String(\"eu-west-1\"),\n\t},\n\tDescription: jsii.String(\"Service-to-service traffic\"),\n\tMaxEnvironments: jsii.Number(50),\n})\ninternal.GrantInvoke(consumerRole)\nawscdk.NewCfnOutput(this, jsii.String(\"InternalUrl\"), &CfnOutputProps{\n\tValue: internal.Url,\n})","version":"2"},"$":{"source":"const 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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":101}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#NONE","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#grantInvoke","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#url","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#MULTI_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":7,"80":34,"110":2,"210":1,"211":4,"212":10,"214":3,"215":2,"244":2,"245":2,"261":2,"262":2,"304":11},"fqnsFingerprint":"2ed8c9d42ebbd7c969460419144ff0567571c0c9cccab3ea633d79d90804fdad"},"cbc3e74e8a7a4d7155ceaf265ed8d4d4f9036659d4002a2038f397ca3695fd0b":{"translations":{"python":{"source":"fn.grants.invoke(consumer_role)","version":"2"},"csharp":{"source":"fn.Grants.Invoke(consumerRole);","version":"2"},"java":{"source":"fn.grants.invoke(consumerRole);","version":"1"},"go":{"source":"fn.Grants.Invoke(consumerRole)","version":"2"},"$":{"source":"fn.grants.invoke(consumerRole); // or fn.grantInvoke(consumerRole), as on lambda.Function","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":142}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#grants","@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants#invoke","aws-cdk-lib.aws_iam.IGrantable"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.grants.invoke(consumerRole);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"80":4,"212":2,"214":1,"245":1},"fqnsFingerprint":"84e03ddd0e39964df63b14d33c75eade62af31971bb8967173dff80fa5c11da4"},"f57ea40c6f4331f384cf617f69e5459b68ad5bd935e7536332543e89e138e344":{"translations":{"python":{"source":"fn.grant_invoke(iam.Role.from_role_arn(self, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"))","version":"2"},"csharp":{"source":"fn.GrantInvoke(Role.FromRoleArn(this, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"));","version":"2"},"java":{"source":"fn.grantInvoke(Role.fromRoleArn(this, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"));","version":"1"},"go":{"source":"fn.GrantInvoke(iam.Role_FromRoleArn(this, jsii.String(\"Partner\"), jsii.String(\"arn:aws:iam::444455556666:role/caller\")))","version":"2"},"$":{"source":"fn.grantInvoke(iam.Role.fromRoleArn(this, 'Partner', 'arn:aws:iam::444455556666:role/caller'));","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":172}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#grantInvoke","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_iam.Role","aws-cdk-lib.aws_iam.Role#fromRoleArn","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.grantInvoke(iam.Role.fromRoleArn(this, 'Partner', 'arn:aws:iam::444455556666:role/caller'));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":5,"110":1,"212":3,"214":2,"245":1},"fqnsFingerprint":"edc73b1162858e87f57fd65666c3aada90c2672d1cb74a91cd24c00f10132c2c"},"d0dcbf0a0cad621704eb158fcd6e109cc1f2b655443d54604472b3202638dbe0":{"translations":{"python":{"source":"fn.add_permission(\"PartnerAccount\", principal=iam.AccountPrincipal(\"444455556666\"))\nfn.add_permission(\"MyOrg\", principal=iam.OrganizationPrincipal(\"o-a1b2c3d4e5\"), endpoint=fn.endpoint)\nfn.add_permission(\"Cdn\",\n principal=iam.ServicePrincipal(\"cloudfront.amazonaws.com\"),\n source_arn=f\"arn:aws:cloudfront::{this.account}:distribution/EDFDVBD6EXAMPLE\"\n)","version":"2"},"csharp":{"source":"fn.AddPermission(\"PartnerAccount\", new WebFunctionPermission { Principal = new AccountPrincipal(\"444455556666\") });\nfn.AddPermission(\"MyOrg\", new WebFunctionPermission { Principal = new OrganizationPrincipal(\"o-a1b2c3d4e5\"), Endpoint = fn.Endpoint });\nfn.AddPermission(\"Cdn\", new WebFunctionPermission {\n Principal = new ServicePrincipal(\"cloudfront.amazonaws.com\"),\n SourceArn = $\"arn:aws:cloudfront::{this.account}:distribution/EDFDVBD6EXAMPLE\"\n});","version":"2"},"java":{"source":"fn.addPermission(\"PartnerAccount\", WebFunctionPermission.builder().principal(new AccountPrincipal(\"444455556666\")).build());\nfn.addPermission(\"MyOrg\", WebFunctionPermission.builder().principal(new OrganizationPrincipal(\"o-a1b2c3d4e5\")).endpoint(fn.getEndpoint()).build());\nfn.addPermission(\"Cdn\", WebFunctionPermission.builder()\n .principal(new ServicePrincipal(\"cloudfront.amazonaws.com\"))\n .sourceArn(String.format(\"arn:aws:cloudfront::%s:distribution/EDFDVBD6EXAMPLE\", this.account))\n .build());","version":"1"},"go":{"source":"fn.AddPermission(jsii.String(\"PartnerAccount\"), &WebFunctionPermission{\n\tPrincipal: iam.NewAccountPrincipal(jsii.String(\"444455556666\")),\n})\nfn.AddPermission(jsii.String(\"MyOrg\"), &WebFunctionPermission{\n\tPrincipal: iam.NewOrganizationPrincipal(jsii.String(\"o-a1b2c3d4e5\")),\n\tEndpoint: fn.Endpoint,\n})\nfn.AddPermission(jsii.String(\"Cdn\"), &WebFunctionPermission{\n\tPrincipal: iam.NewServicePrincipal(jsii.String(\"cloudfront.amazonaws.com\")),\n\tSourceArn: fmt.Sprintf(\"arn:aws:cloudfront::%v:distribution/EDFDVBD6EXAMPLE\", this.Account),\n})","version":"2"},"$":{"source":"fn.addPermission('PartnerAccount', { principal: new iam.AccountPrincipal('444455556666') });\nfn.addPermission('MyOrg', { principal: new iam.OrganizationPrincipal('o-a1b2c3d4e5'), endpoint: fn.endpoint });\nfn.addPermission('Cdn', {\n principal: new iam.ServicePrincipal('cloudfront.amazonaws.com'),\n sourceArn: `arn:aws:cloudfront::${this.account}:distribution/EDFDVBD6EXAMPLE`,\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":178}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#addPermission","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission","aws-cdk-lib.aws_iam.AccountPrincipal","aws-cdk-lib.aws_iam.IPrincipal","aws-cdk-lib.aws_iam.OrganizationPrincipal","aws-cdk-lib.aws_iam.ServicePrincipal"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.addPermission('PartnerAccount', { principal: new iam.AccountPrincipal('444455556666') });\nfn.addPermission('MyOrg', { principal: new iam.OrganizationPrincipal('o-a1b2c3d4e5'), endpoint: fn.endpoint });\nfn.addPermission('Cdn', {\n principal: new iam.ServicePrincipal('cloudfront.amazonaws.com'),\n sourceArn: `arn:aws:cloudfront::${this.account}:distribution/EDFDVBD6EXAMPLE`,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":6,"16":1,"18":1,"80":20,"110":1,"211":3,"212":8,"214":3,"215":3,"229":1,"240":1,"245":3,"304":5},"fqnsFingerprint":"d1ceda7c28639c0e720685694d613ad8abe8cb615ed7556528157ced57410dd4"},"222d21828ab9910a4bee85977f48a6244f37c674dbeac8852df48070f323bfdc":{"translations":{"python":{"source":"cloudfront.Distribution(self, \"Cdn\",\n default_behavior=cloudfront.BehaviorOptions(\n origin=WebFunctionOrigin.with_origin_access_control(fn.endpoint),\n viewer_protocol_policy=cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowed_methods=cloudfront.AllowedMethods.ALLOW_ALL,\n cache_policy=cloudfront.CachePolicy.CACHING_DISABLED,\n origin_request_policy=cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER\n )\n)","version":"2"},"csharp":{"source":"new Distribution(this, \"Cdn\", new DistributionProps {\n DefaultBehavior = new BehaviorOptions {\n Origin = WebFunctionOrigin.WithOriginAccessControl(fn.Endpoint),\n ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n AllowedMethods = AllowedMethods.ALLOW_ALL,\n CachePolicy = CachePolicy.CACHING_DISABLED,\n OriginRequestPolicy = OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER\n }\n});","version":"2"},"java":{"source":"Distribution.Builder.create(this, \"Cdn\")\n .defaultBehavior(BehaviorOptions.builder()\n .origin(WebFunctionOrigin.withOriginAccessControl(fn.getEndpoint()))\n .viewerProtocolPolicy(ViewerProtocolPolicy.REDIRECT_TO_HTTPS)\n .allowedMethods(AllowedMethods.ALLOW_ALL)\n .cachePolicy(CachePolicy.CACHING_DISABLED)\n .originRequestPolicy(OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER)\n .build())\n .build();","version":"1"},"go":{"source":"cloudfront.NewDistribution(this, jsii.String(\"Cdn\"), &DistributionProps{\n\tDefaultBehavior: &BehaviorOptions{\n\t\tOrigin: ashishpandeyonecdklambdawebfunction.WebFunctionOrigin_WithOriginAccessControl(fn.Endpoint),\n\t\tViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,\n\t\tAllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),\n\t\tCachePolicy: cloudfront.CachePolicy_CACHING_DISABLED(),\n\t\tOriginRequestPolicy: cloudfront.OriginRequestPolicy_ALL_VIEWER_EXCEPT_HOST_HEADER(),\n\t},\n})","version":"2"},"$":{"source":"new cloudfront.Distribution(this, 'Cdn', {\n defaultBehavior: {\n origin: WebFunctionOrigin.withOriginAccessControl(fn.endpoint),\n viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,\n cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED,\n originRequestPolicy: cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,\n },\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":200}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin#withOriginAccessControl","aws-cdk-lib.aws_cloudfront.AllowedMethods","aws-cdk-lib.aws_cloudfront.AllowedMethods#ALLOW_ALL","aws-cdk-lib.aws_cloudfront.BehaviorOptions","aws-cdk-lib.aws_cloudfront.CachePolicy","aws-cdk-lib.aws_cloudfront.CachePolicy#CACHING_DISABLED","aws-cdk-lib.aws_cloudfront.Distribution","aws-cdk-lib.aws_cloudfront.DistributionProps","aws-cdk-lib.aws_cloudfront.IOrigin","aws-cdk-lib.aws_cloudfront.OriginRequestPolicy","aws-cdk-lib.aws_cloudfront.OriginRequestPolicy#ALL_VIEWER_EXCEPT_HOST_HEADER","aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy","aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy#REDIRECT_TO_HTTPS","aws-cdk-lib.interfaces.aws_cloudfront.ICachePolicyRef","aws-cdk-lib.interfaces.aws_cloudfront.IOriginRequestPolicyRef","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew cloudfront.Distribution(this, 'Cdn', {\n defaultBehavior: {\n origin: WebFunctionOrigin.withOriginAccessControl(fn.endpoint),\n viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,\n cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED,\n originRequestPolicy: cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,\n },\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":1,"80":24,"110":1,"211":2,"212":11,"214":1,"215":1,"245":1,"304":6},"fqnsFingerprint":"3df67a32c62c4183d88326e0b821e19a19d79680f364fff4fc96d8db49215315"},"66cd362055159c5ee35ed25e7d92b05896f4e8f48e90f22869e272a3b8aaf480":{"translations":{"python":{"source":"forward_authorization = cloudfront.CachePolicy(self, \"ForwardAuthorization\",\n header_behavior=cloudfront.CacheHeaderBehavior.allow_list(\"Authorization\"),\n min_ttl=Duration.seconds(0),\n default_ttl=Duration.seconds(0),\n max_ttl=Duration.seconds(1)\n)","version":"2"},"csharp":{"source":"var forwardAuthorization = new CachePolicy(this, \"ForwardAuthorization\", new CachePolicyProps {\n HeaderBehavior = CacheHeaderBehavior.AllowList(\"Authorization\"),\n MinTtl = Duration.Seconds(0),\n DefaultTtl = Duration.Seconds(0),\n MaxTtl = Duration.Seconds(1)\n});","version":"2"},"java":{"source":"CachePolicy forwardAuthorization = CachePolicy.Builder.create(this, \"ForwardAuthorization\")\n .headerBehavior(CacheHeaderBehavior.allowList(\"Authorization\"))\n .minTtl(Duration.seconds(0))\n .defaultTtl(Duration.seconds(0))\n .maxTtl(Duration.seconds(1))\n .build();","version":"1"},"go":{"source":"forwardAuthorization := cloudfront.NewCachePolicy(this, jsii.String(\"ForwardAuthorization\"), &CachePolicyProps{\n\tHeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String(\"Authorization\")),\n\tMinTtl: awscdk.Duration_Seconds(jsii.Number(0)),\n\tDefaultTtl: awscdk.Duration_*Seconds(jsii.Number(0)),\n\tMaxTtl: awscdk.Duration_*Seconds(jsii.Number(1)),\n})","version":"2"},"$":{"source":"const forwardAuthorization = new cloudfront.CachePolicy(this, 'ForwardAuthorization', {\n headerBehavior: cloudfront.CacheHeaderBehavior.allowList('Authorization'),\n minTtl: Duration.seconds(0),\n defaultTtl: Duration.seconds(0),\n maxTtl: Duration.seconds(1), // a cache key with headers needs caching enabled; 0/0/1 keeps it off in practice\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":220}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.Duration","aws-cdk-lib.Duration#seconds","aws-cdk-lib.aws_cloudfront.CacheHeaderBehavior","aws-cdk-lib.aws_cloudfront.CacheHeaderBehavior#allowList","aws-cdk-lib.aws_cloudfront.CachePolicy","aws-cdk-lib.aws_cloudfront.CachePolicyProps","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst forwardAuthorization = new cloudfront.CachePolicy(this, 'ForwardAuthorization', {\n headerBehavior: cloudfront.CacheHeaderBehavior.allowList('Authorization'),\n minTtl: Duration.seconds(0),\n defaultTtl: Duration.seconds(0),\n maxTtl: Duration.seconds(1), // a cache key with headers needs caching enabled; 0/0/1 keeps it off in practice\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":3,"11":2,"80":16,"110":1,"211":1,"212":6,"214":4,"215":1,"244":1,"261":1,"262":1,"304":4},"fqnsFingerprint":"8b3b0b479ae90a313f45521250f0179f9cfe33b779156bb741e004a4ca2c7bf3"},"441da626377c697dff8b4bd0246c0f1ac028b55f70b07e5996276ac73b7dc523":{"translations":{"python":{"source":"orders = WebFunction.from_web_function_arn(self, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\")\norders.grant_invoke(consumer_role) # every endpoint of the function\n\nlive = WebFunction.from_web_function_attributes(self, \"Live\",\n web_function_name=\"orders\", # in this stack's account and region\n endpoint_name=\"live\"\n)\nlive.metric_concurrent_requests().create_alarm(self, \"Busy\", threshold=60, evaluation_periods=3)","version":"2"},"csharp":{"source":"var orders = WebFunction.FromWebFunctionArn(this, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\");\norders.GrantInvoke(consumerRole); // every endpoint of the function\n\nvar live = WebFunction.FromWebFunctionAttributes(this, \"Live\", new WebFunctionAttributes {\n WebFunctionName = \"orders\", // in this stack's account and region\n EndpointName = \"live\"\n});\nlive.MetricConcurrentRequests().CreateAlarm(this, \"Busy\", new CreateAlarmOptions { Threshold = 60, EvaluationPeriods = 3 });","version":"2"},"java":{"source":"IWebFunction orders = WebFunction.fromWebFunctionArn(this, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\");\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nIWebFunction live = WebFunction.fromWebFunctionAttributes(this, \"Live\", WebFunctionAttributes.builder()\n .webFunctionName(\"orders\") // in this stack's account and region\n .endpointName(\"live\")\n .build());\nlive.metricConcurrentRequests().createAlarm(this, \"Busy\", CreateAlarmOptions.builder().threshold(60).evaluationPeriods(3).build());","version":"1"},"go":{"source":"orders := ashishpandeyonecdklambdawebfunction.WebFunction_FromWebFunctionArn(this, jsii.String(\"Orders\"), jsii.String(\"arn:aws:lambda:us-east-1:111122223333:web-function/orders\"))\norders.GrantInvoke(consumerRole) // every endpoint of the function\n\nlive := ashishpandeyonecdklambdawebfunction.WebFunction_FromWebFunctionAttributes(this, jsii.String(\"Live\"), &WebFunctionAttributes{\n\tWebFunctionName: jsii.String(\"orders\"),\n\t // in this stack's account and region\n\tEndpointName: jsii.String(\"live\"),\n})\nlive.MetricConcurrentRequests().CreateAlarm(this, jsii.String(\"Busy\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(60),\n\tEvaluationPeriods: jsii.Number(3),\n})","version":"2"},"$":{"source":"const orders = WebFunction.fromWebFunctionArn(this, 'Orders', 'arn:aws:lambda:us-east-1:111122223333:web-function/orders');\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nconst live = WebFunction.fromWebFunctionAttributes(this, 'Live', {\n webFunctionName: 'orders', // in this stack's account and region\n endpointName: 'live', // grantInvoke allows this endpoint only\n});\nlive.metricConcurrentRequests().createAlarm(this, 'Busy', { threshold: 60, evaluationPeriods: 3 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":242}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.IWebFunction","@ashishpandeyone/cdk-lambda-web-function.IWebFunction#grantInvoke","@ashishpandeyone/cdk-lambda-web-function.IWebFunction#metricConcurrentRequests","@ashishpandeyone/cdk-lambda-web-function.WebFunction#fromWebFunctionArn","@ashishpandeyone/cdk-lambda-web-function.WebFunction#fromWebFunctionAttributes","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAttributes","aws-cdk-lib.aws_cloudwatch.CreateAlarmOptions","aws-cdk-lib.aws_cloudwatch.Metric#createAlarm","aws-cdk-lib.aws_iam.IGrantable","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst orders = WebFunction.fromWebFunctionArn(this, 'Orders', 'arn:aws:lambda:us-east-1:111122223333:web-function/orders');\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nconst live = WebFunction.fromWebFunctionAttributes(this, 'Live', {\n webFunctionName: 'orders', // in this stack's account and region\n endpointName: 'live', // grantInvoke allows this endpoint only\n});\nlive.metricConcurrentRequests().createAlarm(this, 'Busy', { threshold: 60, evaluationPeriods: 3 });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":6,"80":16,"110":3,"211":2,"212":5,"214":5,"244":2,"245":2,"261":2,"262":2,"304":4},"fqnsFingerprint":"9daccbbaf7d98ac267c5776c98940c70b19f4ede7bcec1d3382255409321da6f"},"3947670aa73c5690ddddaa699ab18765d47eabfad1c70d883d0d54736c159495":{"translations":{"python":{"source":"api = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"build\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n entrypoint=\"server.js\", # default index.js\n web_function_name=\"orders-api\", # default: generated from the construct path\n description=\"Orders HTTP API\",\n environment={\"TABLE_NAME\": table.table_name},\n timeout=Duration.seconds(60), # per request: 3 seconds to 15 minutes, default 30 seconds\n max_concurrency_per_environment=32\n)\n\napi.add_environment(\"FEATURE_FLAG\", \"on\")\ntable.grant_read_write_data(api)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = 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 = new Dictionary<string, string> { { \"TABLE_NAME\", table.TableName } },\n Timeout = Duration.Seconds(60), // per request: 3 seconds to 15 minutes, default 30 seconds\n MaxConcurrencyPerEnvironment = 32\n});\n\napi.AddEnvironment(\"FEATURE_FLAG\", \"on\");\ntable.GrantReadWriteData(api);","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(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(Map.of(\"TABLE_NAME\", table.getTableName()))\n .timeout(Duration.seconds(60)) // per request: 3 seconds to 15 minutes, default 30 seconds\n .maxConcurrencyPerEnvironment(32)\n .build();\n\napi.addEnvironment(\"FEATURE_FLAG\", \"on\");\ntable.grantReadWriteData(api);","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"build\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEntrypoint: jsii.String(\"server.js\"),\n\t // default index.js\n\tWebFunctionName: jsii.String(\"orders-api\"),\n\t // default: generated from the construct path\n\tDescription: jsii.String(\"Orders HTTP API\"),\n\tEnvironment: map[string]*string{\n\t\t\"TABLE_NAME\": table.tableName,\n\t},\n\tTimeout: awscdk.Duration_Seconds(jsii.Number(60)),\n\t // per request: 3 seconds to 15 minutes, default 30 seconds\n\tMaxConcurrencyPerEnvironment: jsii.Number(32),\n})\n\napi.AddEnvironment(jsii.String(\"FEATURE_FLAG\"), jsii.String(\"on\"))\ntable.GrantReadWriteData(api)","version":"2"},"$":{"source":"const 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","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":259}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEnvironment","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.Duration","aws-cdk-lib.Duration#seconds","aws-cdk-lib.aws_dynamodb.TableBase#grantReadWriteData","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":7,"80":29,"110":1,"211":2,"212":9,"214":4,"215":1,"244":1,"245":2,"261":1,"262":1,"304":10},"fqnsFingerprint":"17f3c966f2763ddea92c5f38097214d9858c73a11723968e7c752e7e9ccba00a"},"5154854c1105d400ac9c516e10f2e3f1fc48bc7fd009b0bd7c05d2d539dd6eae":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import NodejsWebFunctionBundlingOptions\nNodejsWebFunction(self, \"Api\",\n entry=\"src/server.ts\",\n auth_type=WebFunctionAuthType.AWS_IAM,\n bundling=NodejsWebFunctionBundlingOptions(\n minify=True, # default true\n source_map=True, # default true\n format=lambda_nodejs.OutputFormat.ESM, # default ESM (index.mjs); CJS gives index.js\n external_modules=[]\n )\n)","version":"2"},"csharp":{"source":"new NodejsWebFunction(this, \"Api\", new NodejsWebFunctionProps {\n Entry = \"src/server.ts\",\n AuthType = WebFunctionAuthType.AWS_IAM,\n Bundling = new NodejsWebFunctionBundlingOptions {\n Minify = true, // default true\n SourceMap = true, // default true\n Format = OutputFormat.ESM, // default ESM (index.mjs); CJS gives index.js\n ExternalModules = new [] { }\n }\n});","version":"2"},"java":{"source":"NodejsWebFunction.Builder.create(this, \"Api\")\n .entry(\"src/server.ts\")\n .authType(WebFunctionAuthType.AWS_IAM)\n .bundling(NodejsWebFunctionBundlingOptions.builder()\n .minify(true) // default true\n .sourceMap(true) // default true\n .format(OutputFormat.ESM) // default ESM (index.mjs); CJS gives index.js\n .externalModules(List.of())\n .build())\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewNodejsWebFunction(this, jsii.String(\"Api\"), &NodejsWebFunctionProps{\n\tEntry: jsii.String(\"src/server.ts\"),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tBundling: &NodejsWebFunctionBundlingOptions{\n\t\tMinify: jsii.Boolean(true),\n\t\t // default true\n\t\tSourceMap: jsii.Boolean(true),\n\t\t // default true\n\t\tFormat: lambdaNodejs.OutputFormat_ESM,\n\t\t // default ESM (index.mjs); CJS gives index.js\n\t\tExternalModules: []*string{\n\t\t},\n\t},\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":285}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction","@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunctionBundlingOptions","@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunctionProps","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","aws-cdk-lib.aws_lambda_nodejs.OutputFormat","aws-cdk-lib.aws_lambda_nodejs.OutputFormat#ESM","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":13,"110":1,"112":2,"210":1,"211":2,"212":3,"215":1,"245":1,"304":7},"fqnsFingerprint":"3c5b1acba229cf931fd70547a7f553b4f7660ecffb52819304c2e3829d80ef1e"},"33c01292193a1b51c9292f851bf127a583f7c96ba4d6c82bec6b6e9c7b62dfc7":{"translations":{"python":{"source":"WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n revision_retention=5\n)","version":"2"},"csharp":{"source":"new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n RevisionRetention = 5\n});","version":"2"},"java":{"source":"WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .revisionRetention(5)\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tRevisionRetention: jsii.Number(5),\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":319}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":1,"11":2,"80":13,"110":1,"211":1,"212":5,"214":1,"215":1,"245":1,"304":4},"fqnsFingerprint":"17e20e680288a36b4813338499f45ddad8c937b8f1c1b91fe63b0f7f22c3322e"},"db82bfd0f2e297f423ad9dcbe1c89032c8ffe6e71cce1f8b4938af348f666617":{"translations":{"python":{"source":"previous = WebFunctionRevision.from_revision_attributes(self, \"Previous\",\n web_function=fn,\n revision_id=\"rev-a1b2c\"\n)\n\n# Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.endpoint.route_traffic(previous, [revision=fn.current_revision, weight=0.1])\n\n# Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.add_endpoint(\"Stable\", auth_type=WebFunctionAuthType.AWS_IAM, revision=previous)","version":"2"},"csharp":{"source":"var previous = WebFunctionRevision.FromRevisionAttributes(this, \"Previous\", new WebFunctionRevisionAttributes {\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, new [] { new WebFunctionRevisionWeight { 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\", new AddWebFunctionEndpointOptions { AuthType = WebFunctionAuthType.AWS_IAM, Revision = previous });","version":"2"},"java":{"source":"IWebFunctionRevision previous = WebFunctionRevision.fromRevisionAttributes(this, \"Previous\", WebFunctionRevisionAttributes.builder()\n .webFunction(fn)\n .revisionId(\"rev-a1b2c\")\n .build());\n\n// Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.endpoint.routeTraffic(previous, List.of(WebFunctionRevisionWeight.builder().revision(fn.getCurrentRevision()).weight(0.1).build()));\n\n// Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.addEndpoint(\"Stable\", AddWebFunctionEndpointOptions.builder().authType(WebFunctionAuthType.AWS_IAM).revision(previous).build());","version":"1"},"go":{"source":"previous := ashishpandeyonecdklambdawebfunction.WebFunctionRevision_FromRevisionAttributes(this, jsii.String(\"Previous\"), &WebFunctionRevisionAttributes{\n\tWebFunction: fn,\n\tRevisionId: jsii.String(\"rev-a1b2c\"),\n})\n\n// Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.Endpoint.RouteTraffic(previous, []WebFunctionRevisionWeight{\n\t&WebFunctionRevisionWeight{\n\t\tRevision: fn.CurrentRevision,\n\t\tWeight: jsii.Number(0.1),\n\t},\n})\n\n// Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.AddEndpoint(jsii.String(\"Stable\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tRevision: previous,\n})","version":"2"},"$":{"source":"const 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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":332}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunction#currentRevision","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#routeTraffic","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision#fromRevisionAttributes","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionAttributes","aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":1,"11":3,"80":21,"110":1,"210":1,"211":3,"212":6,"214":3,"244":1,"245":2,"261":1,"262":1,"304":6},"fqnsFingerprint":"66c7d243eb7a2dec2a81b63baf7aac82a71bf50ca45f1795eb8fdb863fbec4ea"},"43367acfa330bb0800ebb668f1cdf635de6d7c0befe8c9ffeb6d6124e9b9cac6":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions, WebFunctionRollbackOptions\napi = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\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), rollback_on=WebFunctionRollbackOptions(server_error_rate=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.add_endpoint(\"Public\",\n auth_type=WebFunctionAuthType.NONE,\n deployment=WebFunctionDeployment.linear(percent=25, interval=Duration.minutes(5), alarms=[error_rate])\n)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\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(new WebFunctionCanaryDeploymentOptions { Percent = 10, Bake = Duration.Minutes(10), RollbackOn = new WebFunctionRollbackOptions { 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\", new AddWebFunctionEndpointOptions {\n AuthType = WebFunctionAuthType.NONE,\n Deployment = WebFunctionDeployment.Linear(new WebFunctionLinearDeploymentOptions { Percent = 25, Interval = Duration.Minutes(5), Alarms = new [] { errorRate } })\n});","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\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(WebFunctionCanaryDeploymentOptions.builder().percent(10).bake(Duration.minutes(10)).rollbackOn(WebFunctionRollbackOptions.builder().serverErrorRate(2).build()).build()))\n .build())\n .build();\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\", AddWebFunctionEndpointOptions.builder()\n .authType(WebFunctionAuthType.NONE)\n .deployment(WebFunctionDeployment.linear(WebFunctionLinearDeploymentOptions.builder().percent(25).interval(Duration.minutes(5)).alarms(List.of(errorRate)).build()))\n .build());","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\t// 10% of the traffic for 10 minutes, then all of it; back if more than 2% of requests get a 5XX.\n\t\tDeployment: *ashishpandeyonecdklambdawebfunction.WebFunctionDeployment_Canary(&WebFunctionCanaryDeploymentOptions{\n\t\t\tPercent: jsii.Number(10),\n\t\t\tBake: awscdk.Duration_Minutes(jsii.Number(10)),\n\t\t\tRollbackOn: &WebFunctionRollbackOptions{\n\t\t\t\tServerErrorRate: jsii.Number(2),\n\t\t\t},\n\t\t}),\n\t},\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(jsii.String(\"Public\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_NONE,\n\tDeployment: *ashishpandeyonecdklambdawebfunction.WebFunctionDeployment_Linear(&WebFunctionLinearDeploymentOptions{\n\t\tPercent: jsii.Number(25),\n\t\tInterval: awscdk.Duration_*Minutes(jsii.Number(5)),\n\t\tAlarms: []IAlarm{\n\t\t\terrorRate,\n\t\t},\n\t}),\n})","version":"2"},"$":{"source":"const 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":353}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#NONE","@ashishpandeyone/cdk-lambda-web-function.WebFunctionCanaryDeploymentOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment#canary","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment#linear","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionLinearDeploymentOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions","aws-cdk-lib.Duration","aws-cdk-lib.Duration#minutes","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":5,"11":3,"80":37,"110":1,"210":1,"211":6,"212":11,"214":6,"215":1,"244":1,"245":1,"261":1,"262":1,"304":14},"fqnsFingerprint":"abf0241bceb87b3482a1da306a7f95a50cb231ea1b8a949b5df50fec35eb9fe8"},"b74614e65d9f21334ceaf23e9a5511ff4d44b852c7911ae8511ede5c48f205b1":{"translations":{"python":{"source":"fn.endpoint.metric_server_error_rate().create_alarm(self, \"ErrorRate\", threshold=1, evaluation_periods=3)\nfn.endpoint.metric_request_throttles().create_alarm(self, \"Throttled\", threshold=10, evaluation_periods=3)\nfn.metric_concurrent_requests().create_alarm(self, \"Saturated\", threshold=60, evaluation_periods=3)","version":"2"},"csharp":{"source":"fn.Endpoint.MetricServerErrorRate().CreateAlarm(this, \"ErrorRate\", new CreateAlarmOptions { Threshold = 1, EvaluationPeriods = 3 });\nfn.Endpoint.MetricRequestThrottles().CreateAlarm(this, \"Throttled\", new CreateAlarmOptions { Threshold = 10, EvaluationPeriods = 3 });\nfn.MetricConcurrentRequests().CreateAlarm(this, \"Saturated\", new CreateAlarmOptions { Threshold = 60, EvaluationPeriods = 3 });","version":"2"},"java":{"source":"fn.endpoint.metricServerErrorRate().createAlarm(this, \"ErrorRate\", CreateAlarmOptions.builder().threshold(1).evaluationPeriods(3).build());\nfn.endpoint.metricRequestThrottles().createAlarm(this, \"Throttled\", CreateAlarmOptions.builder().threshold(10).evaluationPeriods(3).build());\nfn.metricConcurrentRequests().createAlarm(this, \"Saturated\", CreateAlarmOptions.builder().threshold(60).evaluationPeriods(3).build());","version":"1"},"go":{"source":"fn.Endpoint.MetricServerErrorRate().CreateAlarm(this, jsii.String(\"ErrorRate\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(1),\n\tEvaluationPeriods: jsii.Number(3),\n})\nfn.Endpoint.MetricRequestThrottles().CreateAlarm(this, jsii.String(\"Throttled\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(10),\n\tEvaluationPeriods: jsii.Number(3),\n})\nfn.MetricConcurrentRequests().CreateAlarm(this, jsii.String(\"Saturated\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(60),\n\tEvaluationPeriods: jsii.Number(3),\n})","version":"2"},"$":{"source":"fn.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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":410}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase#metricConcurrentRequests","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#metricRequestThrottles","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#metricServerErrorRate","aws-cdk-lib.aws_cloudwatch.CreateAlarmOptions","aws-cdk-lib.aws_cloudwatch.MathExpression#createAlarm","aws-cdk-lib.aws_cloudwatch.Metric#createAlarm","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":6,"11":3,"80":17,"110":3,"211":3,"212":8,"214":6,"245":3,"304":6},"fqnsFingerprint":"17dafda2e00aa683b89ffed1a845e7dfeca595ea68afc75a8039ac1eb69b9c47"},"3c352cab55b922183fc2fdeed968c86af6f90a6e1f7aa5c2587f46a38e2b0968":{"translations":{"python":{"source":"WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n log_retention=logs.RetentionDays.THREE_MONTHS, # default ONE_MONTH, every group in every region\n log_removal_policy=RemovalPolicy.DESTROY, # default RETAIN\n application_log_level_v2=lambda_.ApplicationLogLevel.WARN,\n system_log_level_v2=lambda_.SystemLogLevel.INFO\n)","version":"2"},"csharp":{"source":"new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n LogRetention = RetentionDays.THREE_MONTHS, // default ONE_MONTH, every group in every region\n LogRemovalPolicy = RemovalPolicy.DESTROY, // default RETAIN\n ApplicationLogLevelV2 = ApplicationLogLevel.WARN,\n SystemLogLevelV2 = SystemLogLevel.INFO\n});","version":"2"},"java":{"source":"WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .logRetention(RetentionDays.THREE_MONTHS) // default ONE_MONTH, every group in every region\n .logRemovalPolicy(RemovalPolicy.DESTROY) // default RETAIN\n .applicationLogLevelV2(ApplicationLogLevel.WARN)\n .systemLogLevelV2(SystemLogLevel.INFO)\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tLogRetention: logs.RetentionDays_THREE_MONTHS,\n\t // default ONE_MONTH, every group in every region\n\tLogRemovalPolicy: awscdk.RemovalPolicy_DESTROY,\n\t // default RETAIN\n\tApplicationLogLevelV2: lambda.ApplicationLogLevel_WARN,\n\tSystemLogLevelV2: lambda.SystemLogLevel_INFO,\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":449}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.RemovalPolicy","aws-cdk-lib.RemovalPolicy#DESTROY","aws-cdk-lib.aws_lambda.ApplicationLogLevel","aws-cdk-lib.aws_lambda.ApplicationLogLevel#WARN","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","aws-cdk-lib.aws_lambda.SystemLogLevel","aws-cdk-lib.aws_lambda.SystemLogLevel#INFO","aws-cdk-lib.aws_logs.RetentionDays","aws-cdk-lib.aws_logs.RetentionDays#THREE_MONTHS","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":27,"110":1,"211":1,"212":12,"214":1,"215":1,"245":1,"304":7},"fqnsFingerprint":"7b771b952e48b542f78c82437700661d8a719f3670cef227637742a63bac77af"},"7678112ceb1faa7befc87dd9133f9321801d1545644522d64e6f6b4fd20bb987":{"translations":{"python":{"source":"(fn.node.find_child(\"ResourcePolicy\")).apply_removal_policy(RemovalPolicy.RETAIN)","version":"2"},"csharp":{"source":"((CfnResource)fn.Node.FindChild(\"ResourcePolicy\")).ApplyRemovalPolicy(RemovalPolicy.RETAIN);","version":"2"},"java":{"source":"((CfnResource)fn.node.findChild(\"ResourcePolicy\")).applyRemovalPolicy(RemovalPolicy.RETAIN);","version":"1"},"go":{"source":"(fn.Node.FindChild(jsii.String(\"ResourcePolicy\")).(CfnResource)).ApplyRemovalPolicy(awscdk.RemovalPolicy_RETAIN)","version":"2"},"$":{"source":"(fn.node.findChild('ResourcePolicy') as CfnResource).applyRemovalPolicy(RemovalPolicy.RETAIN);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":474}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.CfnResource#applyRemovalPolicy","aws-cdk-lib.RemovalPolicy","aws-cdk-lib.RemovalPolicy#RETAIN","constructs.Construct#node","constructs.Node#findChild"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n(fn.node.findChild('ResourcePolicy') as CfnResource).applyRemovalPolicy(RemovalPolicy.RETAIN);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":1,"80":7,"184":1,"212":4,"214":2,"218":1,"235":1,"245":1},"fqnsFingerprint":"2ae251cb0bb88a2c1d253b3c0346beedabb4524f779a38a11e400eb553699881"}}}
|
|
1
|
+
{"version":"2","toolVersion":"6.0.19","snippets":{"b722e8cfc284c4ad172d3c0845a1e12986655461f32df0e464aeccc8774b0a91":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\nimport aws_cdk.aws_lambda as lambda_\nfrom ashishpandeyone.cdk_lambda_web_function import WebFunction, WebFunctionAuthType, WebFunctionEndpointType\n\n\nfn = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\n endpoint_type=WebFunctionEndpointType.MULTI_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"]\n )\n)\n\nCfnOutput(self, \"Url\", value=fn.endpoint.url)","version":"2"},"csharp":{"source":"using Amazon.CDK.AWS.Lambda;\nusing Ashishpandeyone.Cdk.Lambda.Web.Function;\n\n\nvar fn = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\n EndpointType = WebFunctionEndpointType.MULTI_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" }\n }\n});\n\nnew CfnOutput(this, \"Url\", new CfnOutputProps { Value = fn.Endpoint.Url });","version":"2"},"java":{"source":"import software.amazon.awscdk.services.lambda.*;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunction;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunctionAuthType;\nimport ashishpandeyone.cdk.lambda.web.function.WebFunctionEndpointType;\n\n\nWebFunction fn = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\n .endpointType(WebFunctionEndpointType.MULTI_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .build())\n .build();\n\nCfnOutput.Builder.create(this, \"Url\").value(fn.getEndpoint().getUrl()).build();","version":"1"},"go":{"source":"import \"github.com/aws/aws-cdk-go/awscdk\"\nimport \"github.com/aws-samples/dummy/ashishpandeyonecdklambdawebfunction\"\n\n\nfn := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_MULTI_REGION,\n\t\tRegions: []*string{\n\t\t\tjsii.String(\"us-east-1\"),\n\t\t\tjsii.String(\"eu-west-1\"),\n\t\t},\n\t},\n})\n\nawscdk.NewCfnOutput(this, jsii.String(\"Url\"), &CfnOutputProps{\n\tValue: fn.Endpoint.Url,\n})","version":"2"},"$":{"source":"import * 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","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":21}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#url","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#MULTI_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Hoisted imports begin after !show marker below\n/// !show\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n/// !hide\n// Hoisted imports ended before !hide marker above\n// Fixture for examples that show their own imports.\nimport { Construct } from 'constructs';\nimport { CfnOutput, Stack } from 'aws-cdk-lib';\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n\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 });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":7,"80":27,"110":2,"210":1,"211":3,"212":8,"214":1,"215":2,"244":1,"245":1,"261":1,"262":1,"273":2,"274":2,"275":1,"276":1,"277":3,"304":7,"308":1},"fqnsFingerprint":"4e5fc5d44a21de1b0ed2c637a7f93a37e8d9ee7e77047611aa76f9b8f043a39d"},"bb3f6414fcc3c98134fd029d5100626c240c5a2a293b9cac8457e3ad6fabedfe":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\nper_region = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\n endpoint_type=WebFunctionEndpointType.PER_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"]\n )\n)\n\nCfnOutput(self, \"UsEast1Url\", value=per_region.endpoint.regional_url(\"us-east-1\"))","version":"2"},"csharp":{"source":"var perRegion = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\n EndpointType = WebFunctionEndpointType.PER_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" }\n }\n});\n\nnew CfnOutput(this, \"UsEast1Url\", new CfnOutputProps { Value = perRegion.Endpoint.RegionalUrl(\"us-east-1\") });","version":"2"},"java":{"source":"WebFunction perRegion = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\n .endpointType(WebFunctionEndpointType.PER_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .build())\n .build();\n\nCfnOutput.Builder.create(this, \"UsEast1Url\").value(perRegion.endpoint.regionalUrl(\"us-east-1\")).build();","version":"1"},"go":{"source":"perRegion := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_PER_REGION,\n\t\tRegions: []*string{\n\t\t\tjsii.String(\"us-east-1\"),\n\t\t\tjsii.String(\"eu-west-1\"),\n\t\t},\n\t},\n})\n\nawscdk.NewCfnOutput(this, jsii.String(\"UsEast1Url\"), &CfnOutputProps{\n\tValue: perRegion.Endpoint.RegionalUrl(jsii.String(\"us-east-1\")),\n})","version":"2"},"$":{"source":"const 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']","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":78}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#regionalUrl","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#PER_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":6,"80":23,"110":2,"210":1,"211":3,"212":8,"214":2,"215":2,"244":1,"245":1,"261":1,"262":1,"304":7},"fqnsFingerprint":"fed6b94404f9811f4748975c1a35478b0b73840d2b875416c69d12f76c3969d0"},"076f6a80f55cad4801faa6bdc51de62d91e952006fd82731ca584333919e5c46":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions\napi = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.NONE, # the default endpoint is public\n endpoint=WebFunctionEndpointOptions(rate_limit=1000)\n)\n\ninternal = api.add_endpoint(\"Internal\",\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint_type=WebFunctionEndpointType.MULTI_REGION,\n regions=[\"us-east-1\", \"eu-west-1\"],\n description=\"Service-to-service traffic\",\n max_environments=50\n)\ninternal.grant_invoke(consumer_role)\nCfnOutput(self, \"InternalUrl\", value=internal.url)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.NONE, // the default endpoint is public\n Endpoint = new WebFunctionEndpointOptions { RateLimit = 1000 }\n});\n\nvar internal = api.AddEndpoint(\"Internal\", new AddWebFunctionEndpointOptions {\n AuthType = WebFunctionAuthType.AWS_IAM,\n EndpointType = WebFunctionEndpointType.MULTI_REGION,\n Regions = new [] { \"us-east-1\", \"eu-west-1\" },\n Description = \"Service-to-service traffic\",\n MaxEnvironments = 50\n});\ninternal.GrantInvoke(consumerRole);\nnew CfnOutput(this, \"InternalUrl\", new CfnOutputProps { Value = internal.Url });","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.NONE) // the default endpoint is public\n .endpoint(WebFunctionEndpointOptions.builder().rateLimit(1000).build())\n .build();\n\nWebFunctionEndpoint internal = api.addEndpoint(\"Internal\", AddWebFunctionEndpointOptions.builder()\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpointType(WebFunctionEndpointType.MULTI_REGION)\n .regions(List.of(\"us-east-1\", \"eu-west-1\"))\n .description(\"Service-to-service traffic\")\n .maxEnvironments(50)\n .build());\ninternal.grantInvoke(consumerRole);\nCfnOutput.Builder.create(this, \"InternalUrl\").value(internal.getUrl()).build();","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_NONE,\n\t // the default endpoint is public\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\tRateLimit: jsii.Number(1000),\n\t},\n})\n\ninternal := api.AddEndpoint(jsii.String(\"Internal\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpointType: *ashishpandeyonecdklambdawebfunction.WebFunctionEndpointType_MULTI_REGION,\n\tRegions: []*string{\n\t\tjsii.String(\"us-east-1\"),\n\t\tjsii.String(\"eu-west-1\"),\n\t},\n\tDescription: jsii.String(\"Service-to-service traffic\"),\n\tMaxEnvironments: jsii.Number(50),\n})\ninternal.GrantInvoke(consumerRole)\nawscdk.NewCfnOutput(this, jsii.String(\"InternalUrl\"), &CfnOutputProps{\n\tValue: internal.Url,\n})","version":"2"},"$":{"source":"const 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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":101}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#NONE","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#grantInvoke","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#url","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointType#MULTI_REGION","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.CfnOutput","aws-cdk-lib.CfnOutputProps","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":7,"80":34,"110":2,"210":1,"211":4,"212":10,"214":3,"215":2,"244":2,"245":2,"261":2,"262":2,"304":11},"fqnsFingerprint":"2ed8c9d42ebbd7c969460419144ff0567571c0c9cccab3ea633d79d90804fdad"},"cbc3e74e8a7a4d7155ceaf265ed8d4d4f9036659d4002a2038f397ca3695fd0b":{"translations":{"python":{"source":"fn.grants.invoke(consumer_role)","version":"2"},"csharp":{"source":"fn.Grants.Invoke(consumerRole);","version":"2"},"java":{"source":"fn.grants.invoke(consumerRole);","version":"1"},"go":{"source":"fn.Grants.Invoke(consumerRole)","version":"2"},"$":{"source":"fn.grants.invoke(consumerRole); // or fn.grantInvoke(consumerRole), as on lambda.Function","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":142}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#grants","@ashishpandeyone/cdk-lambda-web-function.WebFunctionGrants#invoke","aws-cdk-lib.aws_iam.IGrantable"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.grants.invoke(consumerRole);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"80":4,"212":2,"214":1,"245":1},"fqnsFingerprint":"84e03ddd0e39964df63b14d33c75eade62af31971bb8967173dff80fa5c11da4"},"f57ea40c6f4331f384cf617f69e5459b68ad5bd935e7536332543e89e138e344":{"translations":{"python":{"source":"fn.grant_invoke(iam.Role.from_role_arn(self, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"))","version":"2"},"csharp":{"source":"fn.GrantInvoke(Role.FromRoleArn(this, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"));","version":"2"},"java":{"source":"fn.grantInvoke(Role.fromRoleArn(this, \"Partner\", \"arn:aws:iam::444455556666:role/caller\"));","version":"1"},"go":{"source":"fn.GrantInvoke(iam.Role_FromRoleArn(this, jsii.String(\"Partner\"), jsii.String(\"arn:aws:iam::444455556666:role/caller\")))","version":"2"},"$":{"source":"fn.grantInvoke(iam.Role.fromRoleArn(this, 'Partner', 'arn:aws:iam::444455556666:role/caller'));","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":172}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#grantInvoke","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_iam.Role","aws-cdk-lib.aws_iam.Role#fromRoleArn","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.grantInvoke(iam.Role.fromRoleArn(this, 'Partner', 'arn:aws:iam::444455556666:role/caller'));\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":5,"110":1,"212":3,"214":2,"245":1},"fqnsFingerprint":"edc73b1162858e87f57fd65666c3aada90c2672d1cb74a91cd24c00f10132c2c"},"d0dcbf0a0cad621704eb158fcd6e109cc1f2b655443d54604472b3202638dbe0":{"translations":{"python":{"source":"fn.add_permission(\"PartnerAccount\", principal=iam.AccountPrincipal(\"444455556666\"))\nfn.add_permission(\"MyOrg\", principal=iam.OrganizationPrincipal(\"o-a1b2c3d4e5\"), endpoint=fn.endpoint)\nfn.add_permission(\"Cdn\",\n principal=iam.ServicePrincipal(\"cloudfront.amazonaws.com\"),\n source_arn=f\"arn:aws:cloudfront::{this.account}:distribution/EDFDVBD6EXAMPLE\"\n)","version":"2"},"csharp":{"source":"fn.AddPermission(\"PartnerAccount\", new WebFunctionPermission { Principal = new AccountPrincipal(\"444455556666\") });\nfn.AddPermission(\"MyOrg\", new WebFunctionPermission { Principal = new OrganizationPrincipal(\"o-a1b2c3d4e5\"), Endpoint = fn.Endpoint });\nfn.AddPermission(\"Cdn\", new WebFunctionPermission {\n Principal = new ServicePrincipal(\"cloudfront.amazonaws.com\"),\n SourceArn = $\"arn:aws:cloudfront::{this.account}:distribution/EDFDVBD6EXAMPLE\"\n});","version":"2"},"java":{"source":"fn.addPermission(\"PartnerAccount\", WebFunctionPermission.builder().principal(new AccountPrincipal(\"444455556666\")).build());\nfn.addPermission(\"MyOrg\", WebFunctionPermission.builder().principal(new OrganizationPrincipal(\"o-a1b2c3d4e5\")).endpoint(fn.getEndpoint()).build());\nfn.addPermission(\"Cdn\", WebFunctionPermission.builder()\n .principal(new ServicePrincipal(\"cloudfront.amazonaws.com\"))\n .sourceArn(String.format(\"arn:aws:cloudfront::%s:distribution/EDFDVBD6EXAMPLE\", this.account))\n .build());","version":"1"},"go":{"source":"fn.AddPermission(jsii.String(\"PartnerAccount\"), &WebFunctionPermission{\n\tPrincipal: iam.NewAccountPrincipal(jsii.String(\"444455556666\")),\n})\nfn.AddPermission(jsii.String(\"MyOrg\"), &WebFunctionPermission{\n\tPrincipal: iam.NewOrganizationPrincipal(jsii.String(\"o-a1b2c3d4e5\")),\n\tEndpoint: fn.Endpoint,\n})\nfn.AddPermission(jsii.String(\"Cdn\"), &WebFunctionPermission{\n\tPrincipal: iam.NewServicePrincipal(jsii.String(\"cloudfront.amazonaws.com\")),\n\tSourceArn: fmt.Sprintf(\"arn:aws:cloudfront::%v:distribution/EDFDVBD6EXAMPLE\", this.Account),\n})","version":"2"},"$":{"source":"fn.addPermission('PartnerAccount', { principal: new iam.AccountPrincipal('444455556666') });\nfn.addPermission('MyOrg', { principal: new iam.OrganizationPrincipal('o-a1b2c3d4e5'), endpoint: fn.endpoint });\nfn.addPermission('Cdn', {\n principal: new iam.ServicePrincipal('cloudfront.amazonaws.com'),\n sourceArn: `arn:aws:cloudfront::${this.account}:distribution/EDFDVBD6EXAMPLE`,\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":178}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#addPermission","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionPermission","aws-cdk-lib.aws_iam.AccountPrincipal","aws-cdk-lib.aws_iam.IPrincipal","aws-cdk-lib.aws_iam.OrganizationPrincipal","aws-cdk-lib.aws_iam.ServicePrincipal"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nfn.addPermission('PartnerAccount', { principal: new iam.AccountPrincipal('444455556666') });\nfn.addPermission('MyOrg', { principal: new iam.OrganizationPrincipal('o-a1b2c3d4e5'), endpoint: fn.endpoint });\nfn.addPermission('Cdn', {\n principal: new iam.ServicePrincipal('cloudfront.amazonaws.com'),\n sourceArn: `arn:aws:cloudfront::${this.account}:distribution/EDFDVBD6EXAMPLE`,\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":6,"16":1,"18":1,"80":20,"110":1,"211":3,"212":8,"214":3,"215":3,"229":1,"240":1,"245":3,"304":5},"fqnsFingerprint":"d1ceda7c28639c0e720685694d613ad8abe8cb615ed7556528157ced57410dd4"},"222d21828ab9910a4bee85977f48a6244f37c674dbeac8852df48070f323bfdc":{"translations":{"python":{"source":"cloudfront.Distribution(self, \"Cdn\",\n default_behavior=cloudfront.BehaviorOptions(\n origin=WebFunctionOrigin.with_origin_access_control(fn.endpoint),\n viewer_protocol_policy=cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowed_methods=cloudfront.AllowedMethods.ALLOW_ALL,\n cache_policy=cloudfront.CachePolicy.CACHING_DISABLED,\n origin_request_policy=cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER\n )\n)","version":"2"},"csharp":{"source":"new Distribution(this, \"Cdn\", new DistributionProps {\n DefaultBehavior = new BehaviorOptions {\n Origin = WebFunctionOrigin.WithOriginAccessControl(fn.Endpoint),\n ViewerProtocolPolicy = ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n AllowedMethods = AllowedMethods.ALLOW_ALL,\n CachePolicy = CachePolicy.CACHING_DISABLED,\n OriginRequestPolicy = OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER\n }\n});","version":"2"},"java":{"source":"Distribution.Builder.create(this, \"Cdn\")\n .defaultBehavior(BehaviorOptions.builder()\n .origin(WebFunctionOrigin.withOriginAccessControl(fn.getEndpoint()))\n .viewerProtocolPolicy(ViewerProtocolPolicy.REDIRECT_TO_HTTPS)\n .allowedMethods(AllowedMethods.ALLOW_ALL)\n .cachePolicy(CachePolicy.CACHING_DISABLED)\n .originRequestPolicy(OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER)\n .build())\n .build();","version":"1"},"go":{"source":"cloudfront.NewDistribution(this, jsii.String(\"Cdn\"), &DistributionProps{\n\tDefaultBehavior: &BehaviorOptions{\n\t\tOrigin: ashishpandeyonecdklambdawebfunction.WebFunctionOrigin_WithOriginAccessControl(fn.Endpoint),\n\t\tViewerProtocolPolicy: cloudfront.ViewerProtocolPolicy_REDIRECT_TO_HTTPS,\n\t\tAllowedMethods: cloudfront.AllowedMethods_ALLOW_ALL(),\n\t\tCachePolicy: cloudfront.CachePolicy_CACHING_DISABLED(),\n\t\tOriginRequestPolicy: cloudfront.OriginRequestPolicy_ALL_VIEWER_EXCEPT_HOST_HEADER(),\n\t},\n})","version":"2"},"$":{"source":"new cloudfront.Distribution(this, 'Cdn', {\n defaultBehavior: {\n origin: WebFunctionOrigin.withOriginAccessControl(fn.endpoint),\n viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,\n cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED,\n originRequestPolicy: cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,\n },\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":200}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionOrigin#withOriginAccessControl","aws-cdk-lib.aws_cloudfront.AllowedMethods","aws-cdk-lib.aws_cloudfront.AllowedMethods#ALLOW_ALL","aws-cdk-lib.aws_cloudfront.BehaviorOptions","aws-cdk-lib.aws_cloudfront.CachePolicy","aws-cdk-lib.aws_cloudfront.CachePolicy#CACHING_DISABLED","aws-cdk-lib.aws_cloudfront.Distribution","aws-cdk-lib.aws_cloudfront.DistributionProps","aws-cdk-lib.aws_cloudfront.IOrigin","aws-cdk-lib.aws_cloudfront.OriginRequestPolicy","aws-cdk-lib.aws_cloudfront.OriginRequestPolicy#ALL_VIEWER_EXCEPT_HOST_HEADER","aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy","aws-cdk-lib.aws_cloudfront.ViewerProtocolPolicy#REDIRECT_TO_HTTPS","aws-cdk-lib.interfaces.aws_cloudfront.ICachePolicyRef","aws-cdk-lib.interfaces.aws_cloudfront.IOriginRequestPolicyRef","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nnew cloudfront.Distribution(this, 'Cdn', {\n defaultBehavior: {\n origin: WebFunctionOrigin.withOriginAccessControl(fn.endpoint),\n viewerProtocolPolicy: cloudfront.ViewerProtocolPolicy.REDIRECT_TO_HTTPS,\n allowedMethods: cloudfront.AllowedMethods.ALLOW_ALL,\n cachePolicy: cloudfront.CachePolicy.CACHING_DISABLED,\n originRequestPolicy: cloudfront.OriginRequestPolicy.ALL_VIEWER_EXCEPT_HOST_HEADER,\n },\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":1,"80":24,"110":1,"211":2,"212":11,"214":1,"215":1,"245":1,"304":6},"fqnsFingerprint":"3df67a32c62c4183d88326e0b821e19a19d79680f364fff4fc96d8db49215315"},"66cd362055159c5ee35ed25e7d92b05896f4e8f48e90f22869e272a3b8aaf480":{"translations":{"python":{"source":"forward_authorization = cloudfront.CachePolicy(self, \"ForwardAuthorization\",\n header_behavior=cloudfront.CacheHeaderBehavior.allow_list(\"Authorization\"),\n min_ttl=Duration.seconds(0),\n default_ttl=Duration.seconds(0),\n max_ttl=Duration.seconds(1)\n)","version":"2"},"csharp":{"source":"var forwardAuthorization = new CachePolicy(this, \"ForwardAuthorization\", new CachePolicyProps {\n HeaderBehavior = CacheHeaderBehavior.AllowList(\"Authorization\"),\n MinTtl = Duration.Seconds(0),\n DefaultTtl = Duration.Seconds(0),\n MaxTtl = Duration.Seconds(1)\n});","version":"2"},"java":{"source":"CachePolicy forwardAuthorization = CachePolicy.Builder.create(this, \"ForwardAuthorization\")\n .headerBehavior(CacheHeaderBehavior.allowList(\"Authorization\"))\n .minTtl(Duration.seconds(0))\n .defaultTtl(Duration.seconds(0))\n .maxTtl(Duration.seconds(1))\n .build();","version":"1"},"go":{"source":"forwardAuthorization := cloudfront.NewCachePolicy(this, jsii.String(\"ForwardAuthorization\"), &CachePolicyProps{\n\tHeaderBehavior: cloudfront.CacheHeaderBehavior_AllowList(jsii.String(\"Authorization\")),\n\tMinTtl: awscdk.Duration_Seconds(jsii.Number(0)),\n\tDefaultTtl: awscdk.Duration_*Seconds(jsii.Number(0)),\n\tMaxTtl: awscdk.Duration_*Seconds(jsii.Number(1)),\n})","version":"2"},"$":{"source":"const forwardAuthorization = new cloudfront.CachePolicy(this, 'ForwardAuthorization', {\n headerBehavior: cloudfront.CacheHeaderBehavior.allowList('Authorization'),\n minTtl: Duration.seconds(0),\n defaultTtl: Duration.seconds(0),\n maxTtl: Duration.seconds(1), // a cache key with headers needs caching enabled; 0/0/1 keeps it off in practice\n});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":220}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.Duration","aws-cdk-lib.Duration#seconds","aws-cdk-lib.aws_cloudfront.CacheHeaderBehavior","aws-cdk-lib.aws_cloudfront.CacheHeaderBehavior#allowList","aws-cdk-lib.aws_cloudfront.CachePolicy","aws-cdk-lib.aws_cloudfront.CachePolicyProps","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst forwardAuthorization = new cloudfront.CachePolicy(this, 'ForwardAuthorization', {\n headerBehavior: cloudfront.CacheHeaderBehavior.allowList('Authorization'),\n minTtl: Duration.seconds(0),\n defaultTtl: Duration.seconds(0),\n maxTtl: Duration.seconds(1), // a cache key with headers needs caching enabled; 0/0/1 keeps it off in practice\n});\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":3,"11":2,"80":16,"110":1,"211":1,"212":6,"214":4,"215":1,"244":1,"261":1,"262":1,"304":4},"fqnsFingerprint":"8b3b0b479ae90a313f45521250f0179f9cfe33b779156bb741e004a4ca2c7bf3"},"441da626377c697dff8b4bd0246c0f1ac028b55f70b07e5996276ac73b7dc523":{"translations":{"python":{"source":"orders = WebFunction.from_web_function_arn(self, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\")\norders.grant_invoke(consumer_role) # every endpoint of the function\n\nlive = WebFunction.from_web_function_attributes(self, \"Live\",\n web_function_name=\"orders\", # in this stack's account and region\n endpoint_name=\"live\"\n)\nlive.metric_concurrent_requests().create_alarm(self, \"Busy\", threshold=60, evaluation_periods=3)","version":"2"},"csharp":{"source":"var orders = WebFunction.FromWebFunctionArn(this, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\");\norders.GrantInvoke(consumerRole); // every endpoint of the function\n\nvar live = WebFunction.FromWebFunctionAttributes(this, \"Live\", new WebFunctionAttributes {\n WebFunctionName = \"orders\", // in this stack's account and region\n EndpointName = \"live\"\n});\nlive.MetricConcurrentRequests().CreateAlarm(this, \"Busy\", new CreateAlarmOptions { Threshold = 60, EvaluationPeriods = 3 });","version":"2"},"java":{"source":"IWebFunction orders = WebFunction.fromWebFunctionArn(this, \"Orders\", \"arn:aws:lambda:us-east-1:111122223333:web-function/orders\");\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nIWebFunction live = WebFunction.fromWebFunctionAttributes(this, \"Live\", WebFunctionAttributes.builder()\n .webFunctionName(\"orders\") // in this stack's account and region\n .endpointName(\"live\")\n .build());\nlive.metricConcurrentRequests().createAlarm(this, \"Busy\", CreateAlarmOptions.builder().threshold(60).evaluationPeriods(3).build());","version":"1"},"go":{"source":"orders := ashishpandeyonecdklambdawebfunction.WebFunction_FromWebFunctionArn(this, jsii.String(\"Orders\"), jsii.String(\"arn:aws:lambda:us-east-1:111122223333:web-function/orders\"))\norders.GrantInvoke(consumerRole) // every endpoint of the function\n\nlive := ashishpandeyonecdklambdawebfunction.WebFunction_FromWebFunctionAttributes(this, jsii.String(\"Live\"), &WebFunctionAttributes{\n\tWebFunctionName: jsii.String(\"orders\"),\n\t // in this stack's account and region\n\tEndpointName: jsii.String(\"live\"),\n})\nlive.MetricConcurrentRequests().CreateAlarm(this, jsii.String(\"Busy\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(60),\n\tEvaluationPeriods: jsii.Number(3),\n})","version":"2"},"$":{"source":"const orders = WebFunction.fromWebFunctionArn(this, 'Orders', 'arn:aws:lambda:us-east-1:111122223333:web-function/orders');\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nconst live = WebFunction.fromWebFunctionAttributes(this, 'Live', {\n webFunctionName: 'orders', // in this stack's account and region\n endpointName: 'live', // grantInvoke allows this endpoint only\n});\nlive.metricConcurrentRequests().createAlarm(this, 'Busy', { threshold: 60, evaluationPeriods: 3 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":242}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.IWebFunction","@ashishpandeyone/cdk-lambda-web-function.IWebFunction#grantInvoke","@ashishpandeyone/cdk-lambda-web-function.IWebFunction#metricConcurrentRequests","@ashishpandeyone/cdk-lambda-web-function.WebFunction#fromWebFunctionArn","@ashishpandeyone/cdk-lambda-web-function.WebFunction#fromWebFunctionAttributes","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAttributes","aws-cdk-lib.aws_cloudwatch.CreateAlarmOptions","aws-cdk-lib.aws_cloudwatch.Metric#createAlarm","aws-cdk-lib.aws_iam.IGrantable","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\nconst orders = WebFunction.fromWebFunctionArn(this, 'Orders', 'arn:aws:lambda:us-east-1:111122223333:web-function/orders');\norders.grantInvoke(consumerRole); // every endpoint of the function\n\nconst live = WebFunction.fromWebFunctionAttributes(this, 'Live', {\n webFunctionName: 'orders', // in this stack's account and region\n endpointName: 'live', // grantInvoke allows this endpoint only\n});\nlive.metricConcurrentRequests().createAlarm(this, 'Busy', { threshold: 60, evaluationPeriods: 3 });\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":6,"80":16,"110":3,"211":2,"212":5,"214":5,"244":2,"245":2,"261":2,"262":2,"304":4},"fqnsFingerprint":"9daccbbaf7d98ac267c5776c98940c70b19f4ede7bcec1d3382255409321da6f"},"3947670aa73c5690ddddaa699ab18765d47eabfad1c70d883d0d54736c159495":{"translations":{"python":{"source":"api = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"build\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n entrypoint=\"server.js\", # default index.js\n web_function_name=\"orders-api\", # default: generated from the construct path\n description=\"Orders HTTP API\",\n environment={\"TABLE_NAME\": table.table_name},\n timeout=Duration.seconds(60), # per request: 3 seconds to 15 minutes, default 30 seconds\n max_concurrency_per_environment=32\n)\n\napi.add_environment(\"FEATURE_FLAG\", \"on\")\ntable.grant_read_write_data(api)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = 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 = new Dictionary<string, string> { { \"TABLE_NAME\", table.TableName } },\n Timeout = Duration.Seconds(60), // per request: 3 seconds to 15 minutes, default 30 seconds\n MaxConcurrencyPerEnvironment = 32\n});\n\napi.AddEnvironment(\"FEATURE_FLAG\", \"on\");\ntable.GrantReadWriteData(api);","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(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(Map.of(\"TABLE_NAME\", table.getTableName()))\n .timeout(Duration.seconds(60)) // per request: 3 seconds to 15 minutes, default 30 seconds\n .maxConcurrencyPerEnvironment(32)\n .build();\n\napi.addEnvironment(\"FEATURE_FLAG\", \"on\");\ntable.grantReadWriteData(api);","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"build\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEntrypoint: jsii.String(\"server.js\"),\n\t // default index.js\n\tWebFunctionName: jsii.String(\"orders-api\"),\n\t // default: generated from the construct path\n\tDescription: jsii.String(\"Orders HTTP API\"),\n\tEnvironment: map[string]*string{\n\t\t\"TABLE_NAME\": table.tableName,\n\t},\n\tTimeout: awscdk.Duration_Seconds(jsii.Number(60)),\n\t // per request: 3 seconds to 15 minutes, default 30 seconds\n\tMaxConcurrencyPerEnvironment: jsii.Number(32),\n})\n\napi.AddEnvironment(jsii.String(\"FEATURE_FLAG\"), jsii.String(\"on\"))\ntable.GrantReadWriteData(api)","version":"2"},"$":{"source":"const 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","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":259}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEnvironment","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.Duration","aws-cdk-lib.Duration#seconds","aws-cdk-lib.aws_dynamodb.TableBase#grantReadWriteData","aws-cdk-lib.aws_iam.IGrantable","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":2,"11":7,"80":29,"110":1,"211":2,"212":9,"214":4,"215":1,"244":1,"245":2,"261":1,"262":1,"304":10},"fqnsFingerprint":"17f3c966f2763ddea92c5f38097214d9858c73a11723968e7c752e7e9ccba00a"},"5154854c1105d400ac9c516e10f2e3f1fc48bc7fd009b0bd7c05d2d539dd6eae":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import NodejsWebFunctionBundlingOptions\nNodejsWebFunction(self, \"Api\",\n entry=\"src/server.ts\",\n auth_type=WebFunctionAuthType.AWS_IAM,\n bundling=NodejsWebFunctionBundlingOptions(\n minify=True, # default true\n source_map=True, # default true\n format=lambda_nodejs.OutputFormat.ESM, # default ESM (index.mjs); CJS gives index.js\n external_modules=[]\n )\n)","version":"2"},"csharp":{"source":"new NodejsWebFunction(this, \"Api\", new NodejsWebFunctionProps {\n Entry = \"src/server.ts\",\n AuthType = WebFunctionAuthType.AWS_IAM,\n Bundling = new NodejsWebFunctionBundlingOptions {\n Minify = true, // default true\n SourceMap = true, // default true\n Format = OutputFormat.ESM, // default ESM (index.mjs); CJS gives index.js\n ExternalModules = new [] { }\n }\n});","version":"2"},"java":{"source":"NodejsWebFunction.Builder.create(this, \"Api\")\n .entry(\"src/server.ts\")\n .authType(WebFunctionAuthType.AWS_IAM)\n .bundling(NodejsWebFunctionBundlingOptions.builder()\n .minify(true) // default true\n .sourceMap(true) // default true\n .format(OutputFormat.ESM) // default ESM (index.mjs); CJS gives index.js\n .externalModules(List.of())\n .build())\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewNodejsWebFunction(this, jsii.String(\"Api\"), &NodejsWebFunctionProps{\n\tEntry: jsii.String(\"src/server.ts\"),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tBundling: &NodejsWebFunctionBundlingOptions{\n\t\tMinify: jsii.Boolean(true),\n\t\t // default true\n\t\tSourceMap: jsii.Boolean(true),\n\t\t // default true\n\t\tFormat: lambdaNodejs.OutputFormat_ESM,\n\t\t // default ESM (index.mjs); CJS gives index.js\n\t\tExternalModules: []*string{\n\t\t},\n\t},\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":286}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction","@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunctionBundlingOptions","@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunctionProps","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","aws-cdk-lib.aws_lambda_nodejs.OutputFormat","aws-cdk-lib.aws_lambda_nodejs.OutputFormat#ESM","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":13,"110":1,"112":2,"210":1,"211":2,"212":3,"215":1,"245":1,"304":7},"fqnsFingerprint":"3c5b1acba229cf931fd70547a7f553b4f7660ecffb52819304c2e3829d80ef1e"},"33c01292193a1b51c9292f851bf127a583f7c96ba4d6c82bec6b6e9c7b62dfc7":{"translations":{"python":{"source":"WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n revision_retention=5\n)","version":"2"},"csharp":{"source":"new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n RevisionRetention = 5\n});","version":"2"},"java":{"source":"WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .revisionRetention(5)\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tRevisionRetention: jsii.Number(5),\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":320}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":1,"11":2,"80":13,"110":1,"211":1,"212":5,"214":1,"215":1,"245":1,"304":4},"fqnsFingerprint":"17e20e680288a36b4813338499f45ddad8c937b8f1c1b91fe63b0f7f22c3322e"},"db82bfd0f2e297f423ad9dcbe1c89032c8ffe6e71cce1f8b4938af348f666617":{"translations":{"python":{"source":"previous = WebFunctionRevision.from_revision_attributes(self, \"Previous\",\n web_function=fn,\n revision_id=\"rev-a1b2c\"\n)\n\n# Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.endpoint.route_traffic(previous, [revision=fn.current_revision, weight=0.1])\n\n# Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.add_endpoint(\"Stable\", auth_type=WebFunctionAuthType.AWS_IAM, revision=previous)","version":"2"},"csharp":{"source":"var previous = WebFunctionRevision.FromRevisionAttributes(this, \"Previous\", new WebFunctionRevisionAttributes {\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, new [] { new WebFunctionRevisionWeight { 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\", new AddWebFunctionEndpointOptions { AuthType = WebFunctionAuthType.AWS_IAM, Revision = previous });","version":"2"},"java":{"source":"IWebFunctionRevision previous = WebFunctionRevision.fromRevisionAttributes(this, \"Previous\", WebFunctionRevisionAttributes.builder()\n .webFunction(fn)\n .revisionId(\"rev-a1b2c\")\n .build());\n\n// Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.endpoint.routeTraffic(previous, List.of(WebFunctionRevisionWeight.builder().revision(fn.getCurrentRevision()).weight(0.1).build()));\n\n// Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.addEndpoint(\"Stable\", AddWebFunctionEndpointOptions.builder().authType(WebFunctionAuthType.AWS_IAM).revision(previous).build());","version":"1"},"go":{"source":"previous := ashishpandeyonecdklambdawebfunction.WebFunctionRevision_FromRevisionAttributes(this, jsii.String(\"Previous\"), &WebFunctionRevisionAttributes{\n\tWebFunction: fn,\n\tRevisionId: jsii.String(\"rev-a1b2c\"),\n})\n\n// Keep the default endpoint on the previous revision, and send 10% to the new one:\nfn.Endpoint.RouteTraffic(previous, []WebFunctionRevisionWeight{\n\t&WebFunctionRevisionWeight{\n\t\tRevision: fn.CurrentRevision,\n\t\tWeight: jsii.Number(0.1),\n\t},\n})\n\n// Or a second endpoint that stays on the previous revision while fn.endpoint moves on:\nfn.AddEndpoint(jsii.String(\"Stable\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tRevision: previous,\n})","version":"2"},"$":{"source":"const 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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":333}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.IWebFunctionRevision","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunction#currentRevision","@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#routeTraffic","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevision#fromRevisionAttributes","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRevisionAttributes","aws-cdk-lib.interfaces.aws_lambda.IWebFunctionRef","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":1,"11":3,"80":21,"110":1,"210":1,"211":3,"212":6,"214":3,"244":1,"245":2,"261":1,"262":1,"304":6},"fqnsFingerprint":"66c7d243eb7a2dec2a81b63baf7aac82a71bf50ca45f1795eb8fdb863fbec4ea"},"43367acfa330bb0800ebb668f1cdf635de6d7c0befe8c9ffeb6d6124e9b9cac6":{"translations":{"python":{"source":"from ashishpandeyone.cdk_lambda_web_function import WebFunctionEndpointOptions, WebFunctionRollbackOptions\napi = WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n endpoint=WebFunctionEndpointOptions(\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), rollback_on=WebFunctionRollbackOptions(server_error_rate=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.add_endpoint(\"Public\",\n auth_type=WebFunctionAuthType.NONE,\n deployment=WebFunctionDeployment.linear(percent=25, interval=Duration.minutes(5), alarms=[error_rate])\n)","version":"2"},"csharp":{"source":"var api = new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n Endpoint = new WebFunctionEndpointOptions {\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(new WebFunctionCanaryDeploymentOptions { Percent = 10, Bake = Duration.Minutes(10), RollbackOn = new WebFunctionRollbackOptions { 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\", new AddWebFunctionEndpointOptions {\n AuthType = WebFunctionAuthType.NONE,\n Deployment = WebFunctionDeployment.Linear(new WebFunctionLinearDeploymentOptions { Percent = 25, Interval = Duration.Minutes(5), Alarms = new [] { errorRate } })\n});","version":"2"},"java":{"source":"WebFunction api = WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .endpoint(WebFunctionEndpointOptions.builder()\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(WebFunctionCanaryDeploymentOptions.builder().percent(10).bake(Duration.minutes(10)).rollbackOn(WebFunctionRollbackOptions.builder().serverErrorRate(2).build()).build()))\n .build())\n .build();\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\", AddWebFunctionEndpointOptions.builder()\n .authType(WebFunctionAuthType.NONE)\n .deployment(WebFunctionDeployment.linear(WebFunctionLinearDeploymentOptions.builder().percent(25).interval(Duration.minutes(5)).alarms(List.of(errorRate)).build()))\n .build());","version":"1"},"go":{"source":"api := ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tEndpoint: &WebFunctionEndpointOptions{\n\t\t// 10% of the traffic for 10 minutes, then all of it; back if more than 2% of requests get a 5XX.\n\t\tDeployment: *ashishpandeyonecdklambdawebfunction.WebFunctionDeployment_Canary(&WebFunctionCanaryDeploymentOptions{\n\t\t\tPercent: jsii.Number(10),\n\t\t\tBake: awscdk.Duration_Minutes(jsii.Number(10)),\n\t\t\tRollbackOn: &WebFunctionRollbackOptions{\n\t\t\t\tServerErrorRate: jsii.Number(2),\n\t\t\t},\n\t\t}),\n\t},\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(jsii.String(\"Public\"), &AddWebFunctionEndpointOptions{\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_NONE,\n\tDeployment: *ashishpandeyonecdklambdawebfunction.WebFunctionDeployment_Linear(&WebFunctionLinearDeploymentOptions{\n\t\tPercent: jsii.Number(25),\n\t\tInterval: awscdk.Duration_*Minutes(jsii.Number(5)),\n\t\tAlarms: []IAlarm{\n\t\t\terrorRate,\n\t\t},\n\t}),\n})","version":"2"},"$":{"source":"const 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":354}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.AddWebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunction#addEndpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#NONE","@ashishpandeyone/cdk-lambda-web-function.WebFunctionCanaryDeploymentOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment#canary","@ashishpandeyone/cdk-lambda-web-function.WebFunctionDeployment#linear","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpointOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionLinearDeploymentOptions","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","@ashishpandeyone/cdk-lambda-web-function.WebFunctionRollbackOptions","aws-cdk-lib.Duration","aws-cdk-lib.Duration#minutes","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":5,"11":3,"80":37,"110":1,"210":1,"211":6,"212":11,"214":6,"215":1,"244":1,"245":1,"261":1,"262":1,"304":14},"fqnsFingerprint":"abf0241bceb87b3482a1da306a7f95a50cb231ea1b8a949b5df50fec35eb9fe8"},"b74614e65d9f21334ceaf23e9a5511ff4d44b852c7911ae8511ede5c48f205b1":{"translations":{"python":{"source":"fn.endpoint.metric_server_error_rate().create_alarm(self, \"ErrorRate\", threshold=1, evaluation_periods=3)\nfn.endpoint.metric_request_throttles().create_alarm(self, \"Throttled\", threshold=10, evaluation_periods=3)\nfn.metric_concurrent_requests().create_alarm(self, \"Saturated\", threshold=60, evaluation_periods=3)","version":"2"},"csharp":{"source":"fn.Endpoint.MetricServerErrorRate().CreateAlarm(this, \"ErrorRate\", new CreateAlarmOptions { Threshold = 1, EvaluationPeriods = 3 });\nfn.Endpoint.MetricRequestThrottles().CreateAlarm(this, \"Throttled\", new CreateAlarmOptions { Threshold = 10, EvaluationPeriods = 3 });\nfn.MetricConcurrentRequests().CreateAlarm(this, \"Saturated\", new CreateAlarmOptions { Threshold = 60, EvaluationPeriods = 3 });","version":"2"},"java":{"source":"fn.endpoint.metricServerErrorRate().createAlarm(this, \"ErrorRate\", CreateAlarmOptions.builder().threshold(1).evaluationPeriods(3).build());\nfn.endpoint.metricRequestThrottles().createAlarm(this, \"Throttled\", CreateAlarmOptions.builder().threshold(10).evaluationPeriods(3).build());\nfn.metricConcurrentRequests().createAlarm(this, \"Saturated\", CreateAlarmOptions.builder().threshold(60).evaluationPeriods(3).build());","version":"1"},"go":{"source":"fn.Endpoint.MetricServerErrorRate().CreateAlarm(this, jsii.String(\"ErrorRate\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(1),\n\tEvaluationPeriods: jsii.Number(3),\n})\nfn.Endpoint.MetricRequestThrottles().CreateAlarm(this, jsii.String(\"Throttled\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(10),\n\tEvaluationPeriods: jsii.Number(3),\n})\nfn.MetricConcurrentRequests().CreateAlarm(this, jsii.String(\"Saturated\"), &CreateAlarmOptions{\n\tThreshold: jsii.Number(60),\n\tEvaluationPeriods: jsii.Number(3),\n})","version":"2"},"$":{"source":"fn.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 });","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":411}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction#endpoint","@ashishpandeyone/cdk-lambda-web-function.WebFunctionBase#metricConcurrentRequests","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#metricRequestThrottles","@ashishpandeyone/cdk-lambda-web-function.WebFunctionEndpoint#metricServerErrorRate","aws-cdk-lib.aws_cloudwatch.CreateAlarmOptions","aws-cdk-lib.aws_cloudwatch.MathExpression#createAlarm","aws-cdk-lib.aws_cloudwatch.Metric#createAlarm","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"9":6,"11":3,"80":17,"110":3,"211":3,"212":8,"214":6,"245":3,"304":6},"fqnsFingerprint":"17dafda2e00aa683b89ffed1a845e7dfeca595ea68afc75a8039ac1eb69b9c47"},"3c352cab55b922183fc2fdeed968c86af6f90a6e1f7aa5c2587f46a38e2b0968":{"translations":{"python":{"source":"WebFunction(self, \"Api\",\n runtime=lambda_.Runtime.NODEJS_24_X,\n code=lambda_.Code.from_asset(\"dist\"),\n auth_type=WebFunctionAuthType.AWS_IAM,\n log_retention=logs.RetentionDays.THREE_MONTHS, # default ONE_MONTH, every group in every region\n log_removal_policy=RemovalPolicy.DESTROY, # default RETAIN\n application_log_level_v2=lambda_.ApplicationLogLevel.WARN,\n system_log_level_v2=lambda_.SystemLogLevel.INFO\n)","version":"2"},"csharp":{"source":"new WebFunction(this, \"Api\", new WebFunctionProps {\n Runtime = Runtime.NODEJS_24_X,\n Code = Code.FromAsset(\"dist\"),\n AuthType = WebFunctionAuthType.AWS_IAM,\n LogRetention = RetentionDays.THREE_MONTHS, // default ONE_MONTH, every group in every region\n LogRemovalPolicy = RemovalPolicy.DESTROY, // default RETAIN\n ApplicationLogLevelV2 = ApplicationLogLevel.WARN,\n SystemLogLevelV2 = SystemLogLevel.INFO\n});","version":"2"},"java":{"source":"WebFunction.Builder.create(this, \"Api\")\n .runtime(Runtime.NODEJS_24_X)\n .code(Code.fromAsset(\"dist\"))\n .authType(WebFunctionAuthType.AWS_IAM)\n .logRetention(RetentionDays.THREE_MONTHS) // default ONE_MONTH, every group in every region\n .logRemovalPolicy(RemovalPolicy.DESTROY) // default RETAIN\n .applicationLogLevelV2(ApplicationLogLevel.WARN)\n .systemLogLevelV2(SystemLogLevel.INFO)\n .build();","version":"1"},"go":{"source":"ashishpandeyonecdklambdawebfunction.NewWebFunction(this, jsii.String(\"Api\"), &WebFunctionProps{\n\tRuntime: lambda.Runtime_NODEJS_24_X(),\n\tCode: lambda.Code_FromAsset(jsii.String(\"dist\")),\n\tAuthType: *ashishpandeyonecdklambdawebfunction.WebFunctionAuthType_AWS_IAM,\n\tLogRetention: logs.RetentionDays_THREE_MONTHS,\n\t // default ONE_MONTH, every group in every region\n\tLogRemovalPolicy: awscdk.RemovalPolicy_DESTROY,\n\t // default RETAIN\n\tApplicationLogLevelV2: lambda.ApplicationLogLevel_WARN,\n\tSystemLogLevelV2: lambda.SystemLogLevel_INFO,\n})","version":"2"},"$":{"source":"new 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});","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":450}},"didCompile":true,"fqnsReferenced":["@ashishpandeyone/cdk-lambda-web-function.WebFunction","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType","@ashishpandeyone/cdk-lambda-web-function.WebFunctionAuthType#AWS_IAM","@ashishpandeyone/cdk-lambda-web-function.WebFunctionProps","aws-cdk-lib.RemovalPolicy","aws-cdk-lib.RemovalPolicy#DESTROY","aws-cdk-lib.aws_lambda.ApplicationLogLevel","aws-cdk-lib.aws_lambda.ApplicationLogLevel#WARN","aws-cdk-lib.aws_lambda.Code","aws-cdk-lib.aws_lambda.Code#fromAsset","aws-cdk-lib.aws_lambda.Runtime","aws-cdk-lib.aws_lambda.Runtime#NODEJS_24_X","aws-cdk-lib.aws_lambda.SystemLogLevel","aws-cdk-lib.aws_lambda.SystemLogLevel#INFO","aws-cdk-lib.aws_logs.RetentionDays","aws-cdk-lib.aws_logs.RetentionDays#THREE_MONTHS","constructs.Construct"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\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/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":2,"80":27,"110":1,"211":1,"212":12,"214":1,"215":1,"245":1,"304":7},"fqnsFingerprint":"7b771b952e48b542f78c82437700661d8a719f3670cef227637742a63bac77af"},"7678112ceb1faa7befc87dd9133f9321801d1545644522d64e6f6b4fd20bb987":{"translations":{"python":{"source":"(fn.node.find_child(\"ResourcePolicy\")).apply_removal_policy(RemovalPolicy.RETAIN)","version":"2"},"csharp":{"source":"((CfnResource)fn.Node.FindChild(\"ResourcePolicy\")).ApplyRemovalPolicy(RemovalPolicy.RETAIN);","version":"2"},"java":{"source":"((CfnResource)fn.node.findChild(\"ResourcePolicy\")).applyRemovalPolicy(RemovalPolicy.RETAIN);","version":"1"},"go":{"source":"(fn.Node.FindChild(jsii.String(\"ResourcePolicy\")).(CfnResource)).ApplyRemovalPolicy(awscdk.RemovalPolicy_RETAIN)","version":"2"},"$":{"source":"(fn.node.findChild('ResourcePolicy') as CfnResource).applyRemovalPolicy(RemovalPolicy.RETAIN);","version":"0"}},"location":{"api":{"api":"moduleReadme","moduleFqn":"@ashishpandeyone/cdk-lambda-web-function"},"field":{"field":"markdown","line":490}},"didCompile":true,"fqnsReferenced":["aws-cdk-lib.CfnResource#applyRemovalPolicy","aws-cdk-lib.RemovalPolicy","aws-cdk-lib.RemovalPolicy#RETAIN","constructs.Construct#node","constructs.Node#findChild"],"fullSource":"// Fixture for README examples: imports and a few declared values; the example replaces \"/// here\".\nimport { CfnOutput, CfnResource, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\nimport * as cloudfront from 'aws-cdk-lib/aws-cloudfront';\nimport * as cloudwatch from 'aws-cdk-lib/aws-cloudwatch';\nimport * as dynamodb from 'aws-cdk-lib/aws-dynamodb';\nimport * as iam from 'aws-cdk-lib/aws-iam';\nimport * as lambda from 'aws-cdk-lib/aws-lambda';\nimport * as lambdaNodejs from 'aws-cdk-lib/aws-lambda-nodejs';\nimport * as logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport {\n NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionDeployment, WebFunctionEndpointType, WebFunctionOrigin, WebFunctionRevision,\n} from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\ndeclare const errorRate: cloudwatch.IAlarm;\n\nclass Fixture extends Stack {\n constructor(scope: Construct, id: string) {\n super(scope, id);\n\n // Code snippet begins after !show marker below\n/// !show\n(fn.node.findChild('ResourcePolicy') as CfnResource).applyRemovalPolicy(RemovalPolicy.RETAIN);\n/// !hide\n// Code snippet ended before !hide marker above\n }\n}\n","syntaxKindCounter":{"11":1,"80":7,"184":1,"212":4,"214":2,"218":1,"235":1,"245":1},"fqnsFingerprint":"2ae251cb0bb88a2c1d253b3c0346beedabb4524f779a38a11e400eb553699881"}}}
|
package/README.md
CHANGED
|
@@ -276,6 +276,7 @@ table.grantReadWriteData(api); // the default role trusts lambda.amazo
|
|
|
276
276
|
- **Each execution environment has 2 vCPUs and 2 GB of memory.** There's no memory setting as on Lambda functions; scale with `maxConcurrencyPerEnvironment` and more environments instead.
|
|
277
277
|
- Requests handled by one environment share module-level state, so keep handlers concurrency-safe.
|
|
278
278
|
- Environment variable names starting with `AWS_` are reserved.
|
|
279
|
+
- **The default execution role can only write to the function's own log groups**: the home region's, and the `.local` copy in every region it serves from. That's the minimum AWS documents for Web Functions. It doesn't use `AWSLambdaBasicExecutionRole`, which can also create any log group. Pass `role` to use your own, and include those log permissions.
|
|
279
280
|
- **Renaming the function replaces it and changes its URL.** A generated name depends on the construct path, so moving the construct renames it too.
|
|
280
281
|
|
|
281
282
|
### Bundling TypeScript with `NodejsWebFunction`
|
|
@@ -463,11 +464,26 @@ new WebFunction(this, 'Api', {
|
|
|
463
464
|
- With `DESTROY`, deletion waits about a minute after the function is gone, because environments flush their last lines late.
|
|
464
465
|
- Subscribe only to `fn.logGroup`: subscribing to the `.local` groups as well delivers every event twice.
|
|
465
466
|
|
|
467
|
+
## cdk-nag
|
|
468
|
+
|
|
469
|
+
The library acknowledges the [cdk-nag](https://github.com/cdklabs/cdk-nag) AwsSolutions findings on the resources it creates, each with a reason, so they don't show up in your reports:
|
|
470
|
+
|
|
471
|
+
| Finding | Resource | Reason |
|
|
472
|
+
|---|---|---|
|
|
473
|
+
| IAM5 (wildcards) | the default execution role | log streams of the function's own log groups, in every region it serves from |
|
|
474
|
+
| IAM5 | the deployment handlers' role (canary and linear deployments) | their own log group, `cloudwatch:DescribeAlarms` (composite alarms need `*`), and the revisions and endpoints of the functions they deploy |
|
|
475
|
+
| IAM4, IAM5, SF1, SF2 | the CDK Provider framework behind deployments | CDK's own functions and waiter state machine |
|
|
476
|
+
| S1 (access logs) | the stack's code bucket | it only holds copies of the stack's code assets |
|
|
477
|
+
|
|
478
|
+
- **This works with both cdk-nag versions**, without depending on cdk-nag. cdk-nag 3 reads CDK's `Validations.of(...).acknowledge()`, one ID per finding. cdk-nag 2 reads `cdk_nag` metadata in the template.
|
|
479
|
+
- **Your own statements and resources are still checked.** That includes statements you add to the function's role (`addToRolePolicy`, grants) and your CloudFront distribution's settings.
|
|
480
|
+
- Only the AwsSolutions pack is covered; findings from the HIPAA, NIST and PCI packs aren't acknowledged.
|
|
481
|
+
|
|
466
482
|
## Upgrading
|
|
467
483
|
|
|
468
|
-
### From 0.1.5
|
|
484
|
+
### From 0.1.5 to 0.1.7, with a resource policy
|
|
469
485
|
|
|
470
|
-
Versions 0.1.5
|
|
486
|
+
Versions 0.1.5 to 0.1.7 wrote the function's resource policy with an `AWS::Lambda::ResourcePolicy`. Later versions don't (0.1.7 has the same code as 0.1.6). When an update removes that resource, CloudFormation deletes the function's **whole** resource policy at the end of the update, including the statements the new version just wrote. Callers that rely on the policy then get 403: other accounts, AWS services, and CloudFront.
|
|
471
487
|
|
|
472
488
|
If your function has a resource policy (from `addPermission`, a grant to another account or an AWS service, or `WebFunctionOrigin`), first deploy once on the version you have, with the old resource retained:
|
|
473
489
|
|
|
@@ -49,7 +49,7 @@ const web_function_1 = require("./web-function");
|
|
|
49
49
|
* bundle, and `NODE_OPTIONS=--enable-source-maps` when source maps are on.
|
|
50
50
|
*/
|
|
51
51
|
class NodejsWebFunction extends web_function_1.WebFunction {
|
|
52
|
-
static [JSII_RTTI_SYMBOL_1] = { fqn: "@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction", version: "0.1.
|
|
52
|
+
static [JSII_RTTI_SYMBOL_1] = { fqn: "@ashishpandeyone/cdk-lambda-web-function.NodejsWebFunction", version: "0.1.9" };
|
|
53
53
|
constructor(scope, id, props) {
|
|
54
54
|
const runtime = props.runtime ?? lambda.Runtime.NODEJS_24_X;
|
|
55
55
|
const entry = (0, bundling_1.resolveEntry)(props.entry);
|