Skip to content
v2.276.0

WebFunctionDefaultEndpointOptions Struct Added in v2.276.0 ​

Settings of a WebFunction endpoint other than its auth type.

Used for the endpoint a WebFunction creates for itself, whose auth type is set by WebFunctionProps.defaultEndpointAuth.

Example ​

ts
import * as s3 from 'aws-cdk-lib/aws-s3';

declare const codeBucket: s3.IBucket;

new lambda.WebFunction(this, 'GlobalApi', {
  code: lambda.WebFunctionCode.fromBucket(codeBucket, 'app.zip', 'version-id'),
  runtime: lambda.WebFunctionRuntime.NODEJS_24_X,
  defaultEndpointAuth: lambda.WebFunctionAuthType.IAM_AUTH,
  defaultEndpoint: {
    endpointLocation: lambda.WebFunctionEndpointLocation.multiRegion(['us-east-1', 'eu-west-1', 'ap-northeast-1']),
  },
});

Properties ​

endpointDescriptionoptionalstringendpoint_descriptionoptionalstrendpointDescriptionoptionalStringEndpointDescriptionoptionalstringEndpointDescriptionoptional*string#
A description of the endpoint.

Default: No description.

Up to 256 characters.

endpointLocationoptionalWebFunctionEndpointLocationendpoint_locationoptionalWebFunctionEndpointLocationendpointLocationoptionalWebFunctionEndpointLocationEndpointLocationoptionalWebFunctionEndpointLocationEndpointLocationoptionalWebFunctionEndpointLocation#
Where the endpoint serves traffic: the home Region only, or a set of replica Regions.

Default: WebFunctionEndpointLocation.homeRegion()

Changing it replaces the endpoint, which yields a new domainName. If you set endpointName, change it at the same time.

endpointNameoptionalstringendpoint_nameoptionalstrendpointNameoptionalStringEndpointNameoptionalstringEndpointNameoptional*string#
The name of the WebFunction endpoint.

Default: for the endpoint a WebFunction creates, prod in the home Region and, for a regional endpoint, prod- followed by a hash of its location; for any other endpoint, a name derived from its construct path and location

notes

Must be 2 to 64 characters of letters, numbers, hyphens or underscores, starting and ending with a letter or number.

Changing this property replaces the endpoint, which yields a new domainName.

endpointLocation also replaces the endpoint when it changes, and CloudFormation cannot replace a resource that keeps its name. Without this property the name is derived from the location, so that works. With it, change the name together with the location, or the deployment fails.

maxEnvironmentsoptionalnumbermax_environmentsoptionalint | floatmaxEnvironmentsoptionalNumberMaxEnvironmentsoptionaldoubleMaxEnvironmentsoptional*float64#
The maximum number of concurrent execution environments for the endpoint.

Default: Scaling is limited only by your account's vCPU quota.

This is an optional cap on top of your account's vCPU quota, not a reservation: it further constrains how far the endpoint scales. Must be 2 or greater.

rateLimitoptionalnumberrate_limitoptionalint | floatrateLimitoptionalNumberRateLimitoptionaldoubleRateLimitoptional*float64#
The maximum request rate per second for the endpoint, up to 10000.

Default: The request rate is limited only by your account's rate limit quota.

notes

This is an optional cap on top of your account's rate limit quota. Specify 0 to reject all new requests.

The service accepts only certain values: 0, 100 through 1000 in increments of 100, and 2000 through 10000 in increments of 1000. Which of those are available varies by Region, and an unsupported value is rejected at deploy time with the values that Region does accept. Only the lower bound is checked at synth, since the schema declares nothing more.