EndpointGroupOptions

class aws_cdk.aws_globalaccelerator.EndpointGroupOptions(*, endpoint_group_name=None, endpoints=None, health_check_interval=None, health_check_path=None, health_check_port=None, health_check_protocol=None, health_check_threshold=None, port_overrides=None, region=None, traffic_dial_percentage=None)

Bases: object

Basic options for creating a new EndpointGroup.

Parameters
  • endpoint_group_name (Optional[str]) – Name of the endpoint group. Default: - logical ID of the resource

  • endpoints (Optional[Sequence[IEndpoint]]) – Initial list of endpoints for this group. Default: - Group is initially empty

  • health_check_interval (Optional[Duration]) – The time between health checks for each endpoint. Must be either 10 or 30 seconds. Default: Duration.seconds(30)

  • health_check_path (Optional[str]) – The ping path for health checks (if the protocol is HTTP(S)). Default: ‘/’

  • health_check_port (Union[int, float, None]) – The port used to perform health checks. Default: - The listener’s port

  • health_check_protocol (Optional[HealthCheckProtocol]) – The protocol used to perform health checks. Default: HealthCheckProtocol.TCP

  • health_check_threshold (Union[int, float, None]) – The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy. Default: 3

  • port_overrides (Optional[Sequence[PortOverride]]) – Override the destination ports used to route traffic to an endpoint. Unless overridden, the port used to hit the endpoint will be the same as the port that traffic arrives on at the listener. Default: - No overrides

  • region (Optional[str]) – The AWS Region where the endpoint group is located. Default: - region of the first endpoint in this group, or the stack region if that region can’t be determined

  • traffic_dial_percentage (Union[int, float, None]) – The percentage of traffic to send to this AWS Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing. Additional traffic is distributed to other endpoint groups for this listener. Default: 100

Example:

# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_globalaccelerator as globalaccelerator
import aws_cdk.aws_globalaccelerator_endpoints as ga_endpoints
import aws_cdk.aws_elasticloadbalancingv2 as elbv2

# Create an Accelerator
accelerator = globalaccelerator.Accelerator(stack, "Accelerator")

# Create a Listener
listener = accelerator.add_listener("Listener",
    port_ranges=[globalaccelerator.PortRange(from_port=80), globalaccelerator.PortRange(from_port=443)
    ]
)

# Import the Load Balancers
nlb1 = elbv2.NetworkLoadBalancer.from_network_load_balancer_attributes(stack, "NLB1",
    load_balancer_arn="arn:aws:elasticloadbalancing:us-west-2:111111111111:loadbalancer/app/my-load-balancer1/e16bef66805b"
)
nlb2 = elbv2.NetworkLoadBalancer.from_network_load_balancer_attributes(stack, "NLB2",
    load_balancer_arn="arn:aws:elasticloadbalancing:ap-south-1:111111111111:loadbalancer/app/my-load-balancer2/5513dc2ea8a1"
)

# Add one EndpointGroup for each Region we are targeting
listener.add_endpoint_group("Group1",
    endpoints=[ga_endpoints.NetworkLoadBalancerEndpoint(nlb1)]
)
listener.add_endpoint_group("Group2",
    # Imported load balancers automatically calculate their Region from the ARN.
    # If you are load balancing to other resources, you must also pass a `region`
    # parameter here.
    endpoints=[ga_endpoints.NetworkLoadBalancerEndpoint(nlb2)]
)

Attributes

endpoint_group_name

Name of the endpoint group.

Default
  • logical ID of the resource

Return type

Optional[str]

endpoints

Initial list of endpoints for this group.

Default
  • Group is initially empty

Return type

Optional[List[IEndpoint]]

health_check_interval

The time between health checks for each endpoint.

Must be either 10 or 30 seconds.

Default

Duration.seconds(30)

Return type

Optional[Duration]

health_check_path

The ping path for health checks (if the protocol is HTTP(S)).

Default

‘/’

Return type

Optional[str]

health_check_port

The port used to perform health checks.

Default
  • The listener’s port

Return type

Union[int, float, None]

health_check_protocol

The protocol used to perform health checks.

Default

HealthCheckProtocol.TCP

Return type

Optional[HealthCheckProtocol]

health_check_threshold

The number of consecutive health checks required to set the state of a healthy endpoint to unhealthy, or to set an unhealthy endpoint to healthy.

Default

3

Return type

Union[int, float, None]

port_overrides

Override the destination ports used to route traffic to an endpoint.

Unless overridden, the port used to hit the endpoint will be the same as the port that traffic arrives on at the listener.

Default
  • No overrides

Return type

Optional[List[PortOverride]]

region

The AWS Region where the endpoint group is located.

Default
  • region of the first endpoint in this group, or the stack region if that region can’t be determined

Return type

Optional[str]

traffic_dial_percentage

The percentage of traffic to send to this AWS Region.

The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing. Additional traffic is distributed to other endpoint groups for this listener.

Default

100

Return type

Union[int, float, None]