# WebFunctionEndpointLocation

Where a WebFunction endpoint serves traffic.

A regional location carries its replica Regions, and a home-Region one has none, so a
combination the service rejects cannot be expressed.

- Source: [`aws-lambda/lib/webfunction-endpoint.ts`](https://github.com/aws/aws-cdk/blob/v2.276.0/packages/aws-cdk-lib/aws-lambda/lib/webfunction-endpoint.ts#L61)
- Type last changed: v2.276.0 · 10 Nov 2026

## 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

- `endpointType`: [WebFunctionEndpointType](/cdk/api/v2/docs/aws-cdk-lib.aws_lambda.WebFunctionEndpointType.html) — The endpoint type this location maps to.

- `replicaRegions`: string[] — The replica Regions, for a regional location, as given.

## Methods

- `homeRegion(): WebFunctionEndpointLocation // chainable` (static) — Serve from the stack's Region only, under one regional domain name.

- `multiRegion(replicaRegions: string[]): WebFunctionEndpointLocation // chainable` (static) — Serve from the stack's Region and the replica Regions under one global domain name, with requests routed to the nearest Region.

  The stack's own Region always serves traffic, so listing it has no effect, and
  `replicaRegions` must hold at least one other Region. The list is treated as a set: order
  and duplicates do not matter. Adding or removing a Region replaces the endpoint; a
  deploy-time list (for example from a `CfnParameter`) cannot feed the default endpoint
  name, so changing its value at deployment also needs a new `endpointName`.

  **Parameters**

  - `replicaRegions` — the Regions to replicate to, for example `['us-east-1', 'eu-west-1']`.

- `perRegion(replicaRegions: string[]): WebFunctionEndpointLocation // chainable` (static) — Serve from the stack's Region and the replica Regions, with a separate domain name in each Region and no managed routing between them.

  The same rules for `replicaRegions` apply as for `multiRegion()`.
