Skip to content

create_custom_routing_accelerator async

create_custom_routing_accelerator(
    name: GenericString,
    idempotency_token: IdempotencyToken,
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    ip_address_type: Optional[IpAddressType] = None,
    ip_addresses: Optional[IpAddresses] = None,
    enabled: Optional[GenericBoolean] = None,
    tags: Optional[Tags] = None,
) -> CreateCustomRoutingAcceleratorResponse

Create a custom routing accelerator. A custom routing accelerator directs traffic to one of possibly thousands of Amazon EC2 instance destinations running in a single or multiple virtual private clouds (VPC) subnet endpoints.

Be aware that, by default, all destination EC2 instances in a VPC subnet endpoint cannot receive traffic. To enable all destinations to receive traffic, or to specify individual port mappings that can receive traffic, see the AllowCustomRoutingTraffic operation.

Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for example, specify --region us-west-2 on Amazon Web Services CLI commands.

Parameters:

  • name (GenericString) –

    The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.

  • ip_address_type (Optional[IpAddressType], default: None ) –

    The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.

  • ip_addresses (Optional[IpAddresses], default: None ) –

    Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator.

    After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global Accelerator assigns each address range to a different network zone, for high availability.

    You can specify one or two addresses, separated by a space. Do not include the /32 suffix.

    Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses.

    For more information, see Bring your own IP addresses (BYOIP) in the Global Accelerator Developer Guide.

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

    Indicates whether an accelerator is enabled. The value is true or false. The default value is true.

    If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.

  • idempotency_token (IdempotencyToken) –

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

  • tags (Optional[Tags], default: None ) –

    Create tags for an accelerator.

    For more information, see Tagging in Global Accelerator in the Global Accelerator Developer Guide.

Raises:

Source code in docs_src/capo_global_accelerator/_services/async_global_accelerator.py
async def create_custom_routing_accelerator(
    self,
    name: "capo_global_accelerator.types.generic_string.GenericString",
    idempotency_token: "capo_global_accelerator.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[AsyncGlobalAcceleratorClientConfig] = None,
    ip_address_type: Optional[
        "capo_global_accelerator.types.ip_address_type.IpAddressType"
    ] = None,
    ip_addresses: Optional[
        "capo_global_accelerator.types.ip_addresses.IpAddresses"
    ] = None,
    enabled: Optional[
        "capo_global_accelerator.types.generic_boolean.GenericBoolean"
    ] = None,
    tags: Optional["capo_global_accelerator.types.tags.Tags"] = None,
) -> "capo_global_accelerator.types.create_custom_routing_accelerator_response.CreateCustomRoutingAcceleratorResponse":
    """<p>Create a custom routing accelerator. A custom routing accelerator directs traffic to one of possibly thousands of Amazon EC2 instance destinations running in a single or multiple virtual private clouds (VPC) subnet endpoints.</p> <p>Be aware that, by default, all destination EC2 instances in a VPC subnet endpoint cannot receive traffic. To enable all destinations to receive traffic, or to specify individual port mappings that can receive traffic, see the <a href="https://docs.aws.amazon.com/global-accelerator/latest/api/API_AllowCustomRoutingTraffic.html"> AllowCustomRoutingTraffic</a> operation.</p> <important> <p>Global Accelerator is a global service that supports endpoints in multiple Amazon Web Services Regions but you must specify the US West (Oregon) Region to create, update, or otherwise work with accelerators. That is, for example, specify <code>--region us-west-2</code> on Amazon Web Services CLI commands.</p> </important>

    Args:
        name: <p>The name of a custom routing accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters or hyphens (-), and must not begin or end with a hyphen.</p>
        ip_address_type: <p>The IP address type that an accelerator supports. For a custom routing accelerator, the value must be IPV4.</p>
        ip_addresses: <p>Optionally, if you've added your own IP address pool to Global Accelerator (BYOIP), you can choose an IPv4 address from your own pool to use for the accelerator's static IPv4 address when you create an accelerator. </p> <p>After you bring an address range to Amazon Web Services, it appears in your account as an address pool. When you create an accelerator, you can assign one IPv4 address from your range to it. Global Accelerator assigns you a second static IPv4 address from an Amazon IP address range. If you bring two IPv4 address ranges to Amazon Web Services, you can assign one IPv4 address from each range to your accelerator. This restriction is because Global Accelerator assigns each address range to a different network zone, for high availability.</p> <p>You can specify one or two addresses, separated by a space. Do not include the /32 suffix.</p> <p>Note that you can't update IP addresses for an existing accelerator. To change them, you must create a new accelerator with the new addresses.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/using-byoip.html">Bring your own IP addresses (BYOIP)</a> in the <i>Global Accelerator Developer Guide</i>.</p>
        enabled: <p>Indicates whether an accelerator is enabled. The value is true or false. The default value is true. </p> <p>If the value is set to true, an accelerator cannot be deleted. If set to false, the accelerator can be deleted.</p>
        idempotency_token: <p>A unique, case-sensitive identifier that you provide to ensure the idempotency—that is, the uniqueness—of the request.</p>
        tags: <p>Create tags for an accelerator.</p> <p>For more information, see <a href="https://docs.aws.amazon.com/global-accelerator/latest/dg/tagging-in-global-accelerator.html">Tagging in Global Accelerator</a> in the <i>Global Accelerator Developer Guide</i>.</p>

    Raises:
        capo_global_accelerator.errors.access_denied_exception.AccessDeniedException: <p>You don't have access permission.</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.transaction_in_progress_exception.TransactionInProgressException: <p>There's already a transaction in progress. Another transaction can't be processed.</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_custom_routing_accelerator_request.CreateCustomRoutingAcceleratorRequest]",
    ) -> AsyncOperationResponse[
        "capo_global_accelerator.types.create_custom_routing_accelerator_response.CreateCustomRoutingAcceleratorResponse"
    ]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.create_custom_routing_accelerator

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateCustomRoutingAccelerator")
    )
    input_: capo_global_accelerator.types.create_custom_routing_accelerator_request.CreateCustomRoutingAcceleratorRequest = {
        "name": name,
        "idempotency_token": idempotency_token,
    }
    if ip_address_type is not None:
        input_["ip_address_type"] = ip_address_type
    if ip_addresses is not None:
        input_["ip_addresses"] = ip_addresses
    if enabled is not None:
        input_["enabled"] = enabled
    if tags is not None:
        input_["tags"] = tags

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