Skip to content

create_accelerator

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

Create an accelerator. An accelerator includes one or more listeners that process inbound connections and direct traffic to one or more endpoint groups, each of which includes endpoints, such as Network Load Balancers.

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 the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.

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

    The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.

  • 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 an accelerator.

  • 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/global_accelerator.py
def create_accelerator(
    self,
    name: "capo_global_accelerator.types.generic_string.GenericString",
    idempotency_token: "capo_global_accelerator.types.idempotency_token.IdempotencyToken",
    *,
    config_overrides: Optional[GlobalAcceleratorClientConfig] = 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_accelerator_response.CreateAcceleratorResponse":
    """<p>Create an accelerator. An accelerator includes one or more listeners that process inbound connections and direct traffic to one or more endpoint groups, each of which includes endpoints, such as Network Load Balancers. </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 the accelerator. The name can have a maximum of 64 characters, must contain only alphanumeric characters, periods (.), or hyphens (-), and must not begin or end with a hyphen or period.</p>
        ip_address_type: <p>The IP address type that an accelerator supports. For a standard accelerator, the value can be IPV4 or DUAL_STACK.</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 an accelerator.</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.
    """

    def _handler(
        req: "OperationRequest[capo_global_accelerator.types.create_accelerator_request.CreateAcceleratorRequest]",
    ) -> OperationResponse[
        "capo_global_accelerator.types.create_accelerator_response.CreateAcceleratorResponse"
    ]:
        import capo_global_accelerator._operations.global_accelerator_v20180706.create_accelerator

        output, http_response = (
            capo_global_accelerator._operations.global_accelerator_v20180706.create_accelerator.create_accelerator(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateAccelerator")
    )
    input_: capo_global_accelerator.types.create_accelerator_request.CreateAcceleratorRequest = {
        "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 = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output