Skip to content

Resource: awsGlobalacceleratorEndpointGroup

Provides a Global Accelerator endpoint group.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.globalacceleratorEndpointGroup.GlobalacceleratorEndpointGroup(
  this,
  "example",
  {
    endpointConfiguration: [
      {
        endpointId: "${aws_lb.example.arn}",
        weight: 100,
      },
    ],
    listenerArn: "${aws_globalaccelerator_listener.example.id}",
  }
);

Argument Reference

The following arguments are supported:

  • listenerArn - (Required) The Amazon Resource Name (ARN) of the listener.
  • endpointGroupRegion (Optional) - The name of the AWS Region where the endpoint group is located.
  • healthCheckIntervalSeconds - (Optional) The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.
  • healthCheckPath - (Optional) If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/). Terraform will only perform drift detection of its value when present in a configuration.
  • healthCheckPort - (Optional) The port that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default port is the listener port that this endpoint group is associated with. If listener port is a list of ports, Global Accelerator uses the first port in the list. Terraform will only perform drift detection of its value when present in a configuration.
  • healthCheckProtocol - (Optional) The protocol that AWS Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.
  • thresholdCount - (Optional) 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. The default value is 3.
  • trafficDialPercentage - (Optional) The percentage of traffic to send to an AWS Region. Additional traffic is distributed to other endpoint groups for this listener. The default value is 100.
  • endpointConfiguration - (Optional) The list of endpoint objects. Fields documented below.
  • portOverride - (Optional) Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. Fields documented below.

endpoint_configuration supports the following attributes:

  • clientIpPreservationEnabled - (Optional) Indicates whether client IP address preservation is enabled for an Application Load Balancer endpoint. See the AWS documentation for more details. The default value is false. Note: When client IP address preservation is enabled, the Global Accelerator service creates an EC2 Security Group in the VPC named globalAccelerator that must be deleted (potentially outside of Terraform) before the VPC will successfully delete. If this EC2 Security Group is not deleted, Terraform will retry the VPC deletion for a few minutes before reporting a dependencyViolation error. This cannot be resolved by re-running Terraform.
  • endpointId - (Optional) An ID for the endpoint. If the endpoint is a Network Load Balancer or Application Load Balancer, this is the Amazon Resource Name (ARN) of the resource. If the endpoint is an Elastic IP address, this is the Elastic IP address allocation ID.
  • weight - (Optional) The weight associated with the endpoint. When you add weights to endpoints, you configure AWS Global Accelerator to route traffic based on proportions that you specify.

port_override supports the following attributes:

  • endpointPort - (Required) The endpoint port that you want a listener port to be mapped to. This is the port on the endpoint, such as the Application Load Balancer or Amazon EC2 instance.
  • listenerPort - (Required) The listener port that you want to map to a specific endpoint port. This is the port that user traffic arrives to the Global Accelerator on.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - The Amazon Resource Name (ARN) of the endpoint group.
  • arn - The Amazon Resource Name (ARN) of the endpoint group.

Timeouts

Configuration options:

  • create - (Default 30M)
  • update - (Default 30M)
  • delete - (Default 30M)

Import

Global Accelerator endpoint groups can be imported using the id, e.g.,

$ terraform import aws_globalaccelerator_endpoint_group.example arn:aws:globalaccelerator::111111111111:accelerator/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx/listener/xxxxxxx/endpoint-group/xxxxxxxx