Skip to content

list_custom_routing_port_mappings async

list_custom_routing_port_mappings(
    accelerator_arn: GenericString,
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    endpoint_group_arn: Optional[GenericString] = None,
    max_results: Optional[PortMappingsMaxResults] = None,
    next_token: Optional[GenericString] = None,
) -> ListCustomRoutingPortMappingsResponse

Provides a complete mapping from the public accelerator IP address and port to destination EC2 instance IP addresses and ports in the virtual public cloud (VPC) subnet endpoint for a custom routing accelerator. For each subnet endpoint that you add, Global Accelerator creates a new static port mapping for the accelerator. The port mappings don't change after Global Accelerator generates them, so you can retrieve and cache the full mapping on your servers.

If you remove a subnet from your accelerator, Global Accelerator removes (reclaims) the port mappings. If you add a subnet to your accelerator, Global Accelerator creates new port mappings (the existing ones don't change). If you add or remove EC2 instances in your subnet, the port mappings don't change, because the mappings are created when you add the subnet to Global Accelerator.

The mappings also include a flag for each destination denoting which destination IP addresses and ports are allowed or denied traffic.

Parameters:

  • accelerator_arn (GenericString) –

    The Amazon Resource Name (ARN) of the accelerator to list the custom routing port mappings for.

  • endpoint_group_arn (Optional[GenericString], default: None ) –

    The Amazon Resource Name (ARN) of the endpoint group to list the custom routing port mappings for.

  • max_results (Optional[PortMappingsMaxResults], default: None ) –

    The number of destination port mappings that you want to return with this call. The default value is 10.

  • next_token (Optional[GenericString], default: None ) –

    The token for the next set of results. You receive this token from a previous call.

Raises:

Source code in docs_src/capo_global_accelerator/_services/async_global_accelerator.py
async def list_custom_routing_port_mappings(
    self,
    accelerator_arn: "capo_global_accelerator.types.generic_string.GenericString",
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    endpoint_group_arn: Optional[
        "capo_global_accelerator.types.generic_string.GenericString"
    ] = None,
    max_results: Optional[
        "capo_global_accelerator.types.port_mappings_max_results.PortMappingsMaxResults"
    ] = None,
    next_token: Optional[
        "capo_global_accelerator.types.generic_string.GenericString"
    ] = None,
) -> "capo_global_accelerator.types.list_custom_routing_port_mappings_response.ListCustomRoutingPortMappingsResponse":
    """<p>Provides a complete mapping from the public accelerator IP address and port to destination EC2 instance IP addresses and ports in the virtual public cloud (VPC) subnet endpoint for a custom routing accelerator. For each subnet endpoint that you add, Global Accelerator creates a new static port mapping for the accelerator. The port mappings don't change after Global Accelerator generates them, so you can retrieve and cache the full mapping on your servers. </p> <p>If you remove a subnet from your accelerator, Global Accelerator removes (reclaims) the port mappings. If you add a subnet to your accelerator, Global Accelerator creates new port mappings (the existing ones don't change). If you add or remove EC2 instances in your subnet, the port mappings don't change, because the mappings are created when you add the subnet to Global Accelerator.</p> <p>The mappings also include a flag for each destination denoting which destination IP addresses and ports are allowed or denied traffic.</p>

    Args:
        accelerator_arn: <p>The Amazon Resource Name (ARN) of the accelerator to list the custom routing port mappings for.</p>
        endpoint_group_arn: <p>The Amazon Resource Name (ARN) of the endpoint group to list the custom routing port mappings for.</p>
        max_results: <p>The number of destination port mappings that you want to return with this call. The default value is 10.</p>
        next_token: <p>The token for the next set of results. You receive this token from a previous call.</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.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.invalid_next_token_exception.InvalidNextTokenException: <p>There isn't another item to return.</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.list_custom_routing_port_mappings_request.ListCustomRoutingPortMappingsRequest]",
    ) -> AsyncOperationResponse[
        "capo_global_accelerator.types.list_custom_routing_port_mappings_response.ListCustomRoutingPortMappingsResponse"
    ]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.list_custom_routing_port_mappings

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListCustomRoutingPortMappings")
    )
    input_: capo_global_accelerator.types.list_custom_routing_port_mappings_request.ListCustomRoutingPortMappingsRequest = {
        "accelerator_arn": accelerator_arn
    }
    if endpoint_group_arn is not None:
        input_["endpoint_group_arn"] = endpoint_group_arn
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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