@ashishpandeyone/cdk-lambda-web-function 0.1.0 → 0.1.1

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.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":"c611534d14c806098ee86fa5c04c48704155964782043c7102a0fe5446bd6107"},"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":70}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"f6eddbd361eb60cda0435c8e4e1492dff6993bcb1d952f7098153440889469a8"},"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":106}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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"},"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":133}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"2a1f1e55f165bdd107eef9307ae5b744e53fcad9a6993efb6e6df3685df714f2"},"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":179}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 logs from 'aws-cdk-lib/aws-logs';\nimport { Construct } from 'constructs';\nimport { WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"090dd58b14dc07e468cade9bd41198b45d73150a220fdb6f4d554362ec7eca23"}}}
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":"62e32327312fb8345e09abbfcb38ef9228bda99ac4a4751b6fc063fec0f276b3"},"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":70}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 { NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"02f23878e8f03f01d96430834c7d8ac2a0be6fcbe52f0c12ee0ea379ee3a0383"},"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":106}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 { NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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"},"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":133}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 { NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"f15a38aed2611cf1fadfb11dbaf5545d254548605f6262e87e398d48aff2b376"},"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":158}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 { NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"2afc389d27fe9cbec255639284879b8a9abffd980f00413555e1a00ebbb53eae"},"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":203}},"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, Duration, RemovalPolicy, Stack } from 'aws-cdk-lib';\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 { NodejsWebFunction, WebFunction, WebFunctionAuthType, WebFunctionEndpointType } from '@ashishpandeyone/cdk-lambda-web-function';\n\ndeclare const fn: WebFunction;\ndeclare const table: dynamodb.Table;\ndeclare const consumerRole: iam.IRole;\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":"68a7d8bd8dbca887308974a9418a4da3db67160f4db9f80fc73c3ef48d514f50"}}}