EndpointGroup

class aws_cdk.aws_globalaccelerator.EndpointGroup(scope, id, *, listener, 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: Resource

EndpointGroup construct.

ExampleMetadata:

infused

Example:

# listener: globalaccelerator.Listener

# Non-open ALB
# alb: elbv2.ApplicationLoadBalancer

# Remember that there is only one AGA security group per VPC.
# vpc: ec2.Vpc


endpoint_group = listener.add_endpoint_group("Group",
    endpoints=[
        ga_endpoints.ApplicationLoadBalancerEndpoint(alb,
            preserve_client_ip=True
        )
    ]
)
aga_sg = endpoint_group.connections_peer("GlobalAcceleratorSG", vpc)

# Allow connections from the AGA to the ALB
alb.connections.allow_from(aga_sg, ec2.Port.tcp(443))
Parameters:
  • scope (Construct) –

  • id (str) –

  • listener (IListener) – The Amazon Resource Name (ARN) of the listener.

  • 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[Union[PortOverride, Dict[str, Any]]]]) – 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

Methods

add_endpoint(endpoint)

Add an endpoint.

Parameters:

endpoint (IEndpoint) –

Return type:

None

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy) –

Return type:

None

connections_peer(id, vpc)

Return an object that represents the Accelerator’s Security Group.

Uses a Custom Resource to look up the Security Group that Accelerator creates at deploy time. Requires your VPC ID to perform the lookup.

The Security Group will only be created if you enable Client IP Preservation on any of the endpoints.

You cannot manipulate the rules inside this security group, but you can use this security group as a Peer in Connections rules on other constructs.

Parameters:
  • id (str) –

  • vpc (IVpc) –

Return type:

IPeer

to_string()

Returns a string representation of this construct.

Return type:

str

Attributes

endpoint_group_arn

EndpointGroup ARN.

endpoint_group_name

The name of the endpoint group.

Attribute:

true

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

node

The construct tree node associated with this construct.

stack

The stack in which this resource is defined.

Static Methods

classmethod from_endpoint_group_arn(scope, id, endpoint_group_arn)

import from ARN.

Parameters:
  • scope (Construct) –

  • id (str) –

  • endpoint_group_arn (str) –

Return type:

IEndpointGroup

classmethod is_construct(x)

Return whether the given object is a Construct.

Parameters:

x (Any) –

Return type:

bool

classmethod is_resource(construct)

Check whether the given construct is a Resource.

Parameters:

construct (IConstruct) –

Return type:

bool