Skip to content
v2.274.0

InstanceEndpoint Class ​

Use an EC2 Instance as a Global Accelerator Endpoint.

Example ​

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
# listener: globalaccelerator.Listener
# instance: ec2.Instance


listener.add_endpoint_group("Group",
    endpoints=[
        ga_endpoints.InstanceEndpoint(instance,
            weight=128,
            preserve_client_ip=True
        )
    ]
)
java
Listener listener;
Instance instance;


listener.addEndpointGroup("Group", EndpointGroupOptions.builder()
        .endpoints(List.of(
            InstanceEndpoint.Builder.create(instance)
                    .weight(128)
                    .preserveClientIp(true)
                    .build()))
        .build());
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
        }) }
});
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),
		}),
	},
})

Initializer ​

ts
new InstanceEndpoint(instance: IInstance, options?: InstanceEndpointProps)
python
InstanceEndpoint(instance: IInstance, options: typing.Optional[InstanceEndpointProps] = None)
java
new InstanceEndpoint(IInstance instance, InstanceEndpointProps options)
csharp
new InstanceEndpoint(IInstance instance, InstanceEndpointProps? options = null)
go
NewInstanceEndpoint(Instance IInstance, Options InstanceEndpointProps)

Properties ​

regionstringregionstrregionStringRegionstringRegion*string#
The region where the endpoint is located.

If the region cannot be determined, undefined is returned

Methods ​

renderEndpointConfiguration(): anydef render_endpoint_configuration(self, ) -> Anypublic Object renderEndpointConfiguration()public object RenderEndpointConfiguration()func RenderEndpointConfiguration() interface{}#
Render the endpoint to an endpoint configuration.