# ApplicationLoadBalancerEndpointOptions

Properties for a ApplicationLoadBalancerEndpoint.

Used as props by: [ApplicationLoadBalancerEndpoint](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_globalaccelerator_endpoints.ApplicationLoadBalancerEndpoint.html)

- Source: [`aws-globalaccelerator-endpoints/lib/alb.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-globalaccelerator-endpoints/lib/alb.ts#L8)

## Example

TypeScript:

```ts
declare const alb: elbv2.ApplicationLoadBalancer;
declare const listener: globalaccelerator.Listener;

listener.addEndpointGroup('Group', {
  endpoints: [
    new ga_endpoints.ApplicationLoadBalancerEndpoint(alb, {
      weight: 128,
      preserveClientIp: true,
    }),
  ],
});
```

Python:

```python
# alb: elbv2.ApplicationLoadBalancer
# listener: globalaccelerator.Listener

listener.add_endpoint_group("Group",
    endpoints=[
        ga_endpoints.ApplicationLoadBalancerEndpoint(alb,
            weight=128,
            preserve_client_ip=True
        )
    ]
)
```

Java:

```java
ApplicationLoadBalancer alb;
Listener listener;

listener.addEndpointGroup("Group", EndpointGroupOptions.builder()
        .endpoints(List.of(
            ApplicationLoadBalancerEndpoint.Builder.create(alb)
                    .weight(128)
                    .preserveClientIp(true)
                    .build()))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
ApplicationLoadBalancer alb;
Listener listener;

listener.AddEndpointGroup("Group", new EndpointGroupOptions {
    Endpoints = new [] {
        new ApplicationLoadBalancerEndpoint(alb, new ApplicationLoadBalancerEndpointOptions {
            Weight = 128,
            PreserveClientIp = true
        }) }
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
var alb ApplicationLoadBalancer
var listener Listener

listener.AddEndpointGroup(jsii.String("Group"), &EndpointGroupOptions{
	Endpoints: []IEndpoint{
		ga_endpoints.NewApplicationLoadBalancerEndpoint(alb, &ApplicationLoadBalancerEndpointOptions{
			Weight: jsii.Number(128),
			PreserveClientIp: jsii.Boolean(true),
		}),
	},
})
```

## Properties

- `preserveClientIp`: boolean — Forward the client IP address in an `X-Forwarded-For` header.

  **Default:** true if available

  GlobalAccelerator will create Network Interfaces in your VPC in order
  to preserve the client IP address.

  Client IP address preservation is supported only in specific AWS Regions.
  See the GlobalAccelerator Developer Guide for a list.

- `weight`: number = 128 — Endpoint weight across all endpoints in the group.

  Must be a value between 0 and 255.
