# InstanceEndpointProps

Properties for a NetworkLoadBalancerEndpoint.

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

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

## Example

TypeScript:

```ts
declare const listener: globalaccelerator.Listener;
declare const instance: ec2.Instance;

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

Python:

```python
# listener: globalaccelerator.Listener
# instance: ec2.Instance

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

Java:

```java
Listener listener;
Instance instance;

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

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
Listener listener;
Instance instance;

listener.AddEndpointGroup("Group", new EndpointGroupOptions {
    Endpoints = new [] {
        new InstanceEndpoint(instance, new InstanceEndpointProps {
            Weight = 128,
            PreserveClientIp = true
        }) }
});
```

Golang:

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

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

## Properties

- `preserveClientIp`: boolean — Forward the client IP address.

  **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.
