Skip to content

deny_custom_routing_traffic async

deny_custom_routing_traffic(
    endpoint_group_arn: GenericString,
    endpoint_id: GenericString,
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    destination_addresses: Optional[DestinationAddresses] = None,
    destination_ports: Optional[DestinationPorts] = None,
    deny_all_traffic_to_endpoint: Optional[GenericBoolean] = None,
) -> None

Specify the Amazon EC2 instance (destination) IP addresses and ports for a VPC subnet endpoint that cannot receive traffic for a custom routing accelerator. You can deny traffic to all destinations in the VPC endpoint, or deny traffic to a specified list of destination IP addresses and ports. Note that you cannot specify IP addresses or ports outside of the range that you configured for the endpoint group.

After you make changes, you can verify that the updates are complete by checking the status of your accelerator: the status changes from IN_PROGRESS to DEPLOYED.

Parameters:

  • endpoint_group_arn (GenericString) –

    The Amazon Resource Name (ARN) of the endpoint group.

  • endpoint_id (GenericString) –

    An ID for the endpoint. For custom routing accelerators, this is the virtual private cloud (VPC) subnet ID.

  • destination_addresses (Optional[DestinationAddresses], default: None ) –

    A list of specific Amazon EC2 instance IP addresses (destination addresses) in a subnet that you want to prevent from receiving traffic. The IP addresses must be a subset of the IP addresses allowed for the VPC subnet associated with the endpoint group.

  • destination_ports (Optional[DestinationPorts], default: None ) –

    A list of specific Amazon EC2 instance ports (destination ports) in a subnet endpoint that you want to prevent from receiving traffic.

  • deny_all_traffic_to_endpoint (Optional[GenericBoolean], default: None ) –

    Indicates whether all destination IP addresses and ports for a specified VPC subnet endpoint cannot receive traffic from a custom routing accelerator. The value is TRUE or FALSE.

    When set to TRUE, no destinations in the custom routing VPC subnet can receive traffic. Note that you cannot specify destination IP addresses and ports when the value is set to TRUE.

    When set to FALSE (or not specified), you must specify a list of destination IP addresses that cannot receive traffic. A list of ports is optional. If you don't specify a list of ports, the ports that can accept traffic is the same as the ports configured for the endpoint group.

    The default value is FALSE.

Raises:

Source code in docs_src/capo_global_accelerator/_services/async_global_accelerator.py
async def deny_custom_routing_traffic(
    self,
    endpoint_group_arn: "capo_global_accelerator.types.generic_string.GenericString",
    endpoint_id: "capo_global_accelerator.types.generic_string.GenericString",
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    destination_addresses: Optional[
        "capo_global_accelerator.types.destination_addresses.DestinationAddresses"
    ] = None,
    destination_ports: Optional[
        "capo_global_accelerator.types.destination_ports.DestinationPorts"
    ] = None,
    deny_all_traffic_to_endpoint: Optional[
        "capo_global_accelerator.types.generic_boolean.GenericBoolean"
    ] = None,
) -> None:
    """<p>Specify the Amazon EC2 instance (destination) IP addresses and ports for a VPC subnet endpoint that cannot receive traffic for a custom routing accelerator. You can deny traffic to all destinations in the VPC endpoint, or deny traffic to a specified list of destination IP addresses and ports. Note that you cannot specify IP addresses or ports outside of the range that you configured for the endpoint group.</p> <p>After you make changes, you can verify that the updates are complete by checking the status of your accelerator: the status changes from IN_PROGRESS to DEPLOYED.</p>

    Args:
        endpoint_group_arn: <p>The Amazon Resource Name (ARN) of the endpoint group.</p>
        endpoint_id: <p>An ID for the endpoint. For custom routing accelerators, this is the virtual private cloud (VPC) subnet ID.</p>
        destination_addresses: <p>A list of specific Amazon EC2 instance IP addresses (destination addresses) in a subnet that you want to prevent from receiving traffic. The IP addresses must be a subset of the IP addresses allowed for the VPC subnet associated with the endpoint group.</p>
        destination_ports: <p>A list of specific Amazon EC2 instance ports (destination ports) in a subnet endpoint that you want to prevent from receiving traffic.</p>
        deny_all_traffic_to_endpoint: <p>Indicates whether all destination IP addresses and ports for a specified VPC subnet endpoint <i>cannot</i> receive traffic from a custom routing accelerator. The value is TRUE or FALSE. </p> <p>When set to TRUE, <i>no</i> destinations in the custom routing VPC subnet can receive traffic. Note that you cannot specify destination IP addresses and ports when the value is set to TRUE.</p> <p>When set to FALSE (or not specified), you <i>must</i> specify a list of destination IP addresses that cannot receive traffic. A list of ports is optional. If you don't specify a list of ports, the ports that can accept traffic is the same as the ports configured for the endpoint group.</p> <p>The default value is FALSE.</p>

    Raises:
        capo_global_accelerator.errors.endpoint_group_not_found_exception.EndpointGroupNotFoundException: <p>The endpoint group that you specified doesn't exist.</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.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_global_accelerator.types.deny_custom_routing_traffic_request.DenyCustomRoutingTrafficRequest]",
    ) -> AsyncOperationResponse[None]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.deny_custom_routing_traffic

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("DenyCustomRoutingTraffic")
    )
    input_: capo_global_accelerator.types.deny_custom_routing_traffic_request.DenyCustomRoutingTrafficRequest = {
        "endpoint_group_arn": endpoint_group_arn,
        "endpoint_id": endpoint_id,
    }
    if destination_addresses is not None:
        input_["destination_addresses"] = destination_addresses
    if destination_ports is not None:
        input_["destination_ports"] = destination_ports
    if deny_all_traffic_to_endpoint is not None:
        input_["deny_all_traffic_to_endpoint"] = deny_all_traffic_to_endpoint

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