Skip to content

create_endpoint_group async

create_endpoint_group(
    listener_arn: GenericString,
    endpoint_group_region: GenericString,
    idempotency_token: IdempotencyToken,
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    endpoint_configurations: Optional[EndpointConfigurations] = None,
    traffic_dial_percentage: Optional[TrafficDialPercentage] = None,
    health_check_port: Optional[HealthCheckPort] = None,
    health_check_protocol: Optional[HealthCheckProtocol] = None,
    health_check_path: Optional[HealthCheckPath] = None,
    health_check_interval_seconds: Optional[HealthCheckIntervalSeconds] = None,
    threshold_count: Optional[ThresholdCount] = None,
    port_overrides: Optional[PortOverrides] = None,
) -> CreateEndpointGroupResponse

Create an endpoint group for the specified listener. An endpoint group is a collection of endpoints in one Amazon Web Services Region. A resource must be valid and active when you add it as an endpoint.

For more information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see Endpoints for standard accelerators in the Global Accelerator Developer Guide.

Parameters:

  • listener_arn (GenericString) –

    The Amazon Resource Name (ARN) of the listener.

  • endpoint_group_region (GenericString) –

    The Amazon Web Services Region where the endpoint group is located. A listener can have only one endpoint group in a specific Region.

  • endpoint_configurations (Optional[EndpointConfigurations], default: None ) –

    The list of endpoint objects.

  • traffic_dial_percentage (Optional[TrafficDialPercentage], default: None ) –

    The percentage of traffic to send to an Amazon Web Services Region. Additional traffic is distributed to other endpoint groups for this listener.

    Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing.

    The default value is 100.

  • health_check_port (Optional[HealthCheckPort], default: None ) –

    The port that 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.

  • health_check_protocol (Optional[HealthCheckProtocol], default: None ) –

    The protocol that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.

  • health_check_path (Optional[HealthCheckPath], default: None ) –

    If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/).

  • health_check_interval_seconds (Optional[HealthCheckIntervalSeconds], default: None ) –

    The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.

  • threshold_count (Optional[ThresholdCount], default: 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. The default value is 3.

  • idempotency_token (IdempotencyToken) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.

  • port_overrides (Optional[PortOverrides], default: None ) –

    Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.

    For more information, see Overriding listener ports in the Global Accelerator Developer Guide.

Raises:

Source code in docs_src/capo_global_accelerator/_services/async_global_accelerator.py
async def create_endpoint_group(
    self,
    listener_arn: "capo_global_accelerator.types.generic_string.GenericString",
    endpoint_group_region: "capo_global_accelerator.types.generic_string.GenericString",
    idempotency_token: "capo_global_accelerator.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    endpoint_configurations: Optional[
        "capo_global_accelerator.types.endpoint_configurations.EndpointConfigurations"
    ] = None,
    traffic_dial_percentage: Optional[
        "capo_global_accelerator.types.traffic_dial_percentage.TrafficDialPercentage"
    ] = None,
    health_check_port: Optional[
        "capo_global_accelerator.types.health_check_port.HealthCheckPort"
    ] = None,
    health_check_protocol: Optional[
        "capo_global_accelerator.types.health_check_protocol.HealthCheckProtocol"
    ] = None,
    health_check_path: Optional[
        "capo_global_accelerator.types.health_check_path.HealthCheckPath"
    ] = None,
    health_check_interval_seconds: Optional[
        "capo_global_accelerator.types.health_check_interval_seconds.HealthCheckIntervalSeconds"
    ] = None,
    threshold_count: Optional[
        "capo_global_accelerator.types.threshold_count.ThresholdCount"
    ] = None,
    port_overrides: Optional[
        "capo_global_accelerator.types.port_overrides.PortOverrides"
    ] = None,
) -> "capo_global_accelerator.types.create_endpoint_group_response.CreateEndpointGroupResponse":
    """<p>Create an endpoint group for the specified listener. An endpoint group is a collection of endpoints in one Amazon Web Services Region. A resource must be valid and active when you add it as an endpoint.</p> <p>For more information about endpoint types and requirements for endpoints that you can add to Global Accelerator, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoints.html"> Endpoints for standard accelerators</a> in the <i>Global Accelerator Developer Guide</i>.</p>

    Args:
        listener_arn: <p>The Amazon Resource Name (ARN) of the listener.</p>
        endpoint_group_region: <p>The Amazon Web Services Region where the endpoint group is located. A listener can have only one endpoint group in a specific Region.</p>
        endpoint_configurations: <p>The list of endpoint objects.</p>
        traffic_dial_percentage: <p>The percentage of traffic to send to an Amazon Web Services Region. Additional traffic is distributed to other endpoint groups for this listener. </p> <p>Use this action to increase (dial up) or decrease (dial down) traffic to a specific Region. The percentage is applied to the traffic that would otherwise have been routed to the Region based on optimal routing.</p> <p>The default value is 100.</p>
        health_check_port: <p>The port that 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.</p>
        health_check_protocol: <p>The protocol that Global Accelerator uses to check the health of endpoints that are part of this endpoint group. The default value is TCP.</p>
        health_check_path: <p>If the protocol is HTTP/S, then this specifies the path that is the destination for health check targets. The default value is slash (/).</p>
        health_check_interval_seconds: <p>The time—10 seconds or 30 seconds—between each health check for an endpoint. The default value is 30.</p>
        threshold_count: <p>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.</p>
        idempotency_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
        port_overrides: <p>Override specific listener ports used to route traffic to endpoints that are part of this endpoint group. For example, you can create a port override in which the listener receives user traffic on ports 80 and 443, but your accelerator routes that traffic to ports 1080 and 1443, respectively, on the endpoints.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/about-endpoint-groups-port-override.html"> Overriding listener ports</a> in the <i>Global Accelerator Developer Guide</i>.</p>

    Raises:
        capo_global_accelerator.errors.accelerator_not_found_exception.AcceleratorNotFoundException: <p>The accelerator that you specified doesn't exist.</p>
        capo_global_accelerator.errors.access_denied_exception.AccessDeniedException: <p>You don't have access permission.</p>
        capo_global_accelerator.errors.endpoint_group_already_exists_exception.EndpointGroupAlreadyExistsException: <p>The endpoint group that you specified already exists.</p>
        capo_global_accelerator.errors.internal_service_error_exception.InternalServiceErrorException: <p>There was an internal error for Global Accelerator.</p>
        capo_global_accelerator.errors.invalid_argument_exception.InvalidArgumentException: <p>An argument that you specified is invalid.</p>
        capo_global_accelerator.errors.limit_exceeded_exception.LimitExceededException: <p>Processing your request would cause you to exceed an Global Accelerator limit.</p>
        capo_global_accelerator.errors.listener_not_found_exception.ListenerNotFoundException: <p>The listener that you specified doesn't exist.</p>
        capo_global_accelerator.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_global_accelerator.types.create_endpoint_group_request.CreateEndpointGroupRequest]",
    ) -> AsyncOperationResponse[
        "capo_global_accelerator.types.create_endpoint_group_response.CreateEndpointGroupResponse"
    ]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.create_endpoint_group

        (
            output,
            http_response,
        ) = await capo_global_accelerator._operations.global_accelerator_v20180706.create_endpoint_group.async_create_endpoint_group(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateEndpointGroup")
    )
    input_: capo_global_accelerator.types.create_endpoint_group_request.CreateEndpointGroupRequest = {
        "listener_arn": listener_arn,
        "endpoint_group_region": endpoint_group_region,
        "idempotency_token": idempotency_token,
    }
    if endpoint_configurations is not None:
        input_["endpoint_configurations"] = endpoint_configurations
    if traffic_dial_percentage is not None:
        input_["traffic_dial_percentage"] = traffic_dial_percentage
    if health_check_port is not None:
        input_["health_check_port"] = health_check_port
    if health_check_protocol is not None:
        input_["health_check_protocol"] = health_check_protocol
    if health_check_path is not None:
        input_["health_check_path"] = health_check_path
    if health_check_interval_seconds is not None:
        input_["health_check_interval_seconds"] = health_check_interval_seconds
    if threshold_count is not None:
        input_["threshold_count"] = threshold_count
    if port_overrides is not None:
        input_["port_overrides"] = port_overrides

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output