Skip to content

create_instance async

create_instance(
    identity_management_type: DirectoryType,
    inbound_calls_enabled: InboundCallsEnabled,
    outbound_calls_enabled: OutboundCallsEnabled,
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional[ClientToken] = None,
    instance_alias: Optional[DirectoryAlias] = None,
    directory_id: Optional[DirectoryId] = None,
    tags: Optional[TagMap] = None,
) -> CreateInstanceResponse

This API is in preview release for Connect Customer and is subject to change.

Initiates an Connect Customer instance with all the supported channels enabled. It does not attach any storage, such as Amazon Simple Storage Service (Amazon S3) or Amazon Kinesis. It also does not allow for any configurations on features, such as Contact Lens for Connect Customer.

For more information, see Create an Connect Customer instance in the Connect Customer Administrator Guide.

Connect Customer enforces a limit on the total number of instances that you can create or delete in 30 days. If you exceed this limit, you will get an error message indicating there has been an excessive number of attempts at creating or deleting instances. You must wait 30 days before you can restart creating and deleting instances in your account.

Parameters:

  • client_token (Optional[ClientToken], default: None ) –

    The idempotency token.

  • identity_management_type (DirectoryType) –

    The type of identity management for your Connect Customer users.

  • instance_alias (Optional[DirectoryAlias], default: None ) –

    The name for your instance.

  • directory_id (Optional[DirectoryId], default: None ) –

    The identifier for the directory.

  • inbound_calls_enabled (InboundCallsEnabled) –

    Your contact center handles incoming contacts.

  • outbound_calls_enabled (OutboundCallsEnabled) –

    Your contact center allows outbound calls.

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

    The tags used to organize, track, or control access for this resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

Raises:

Source code in docs_src/capo_connect/_services/async_connect.py
async def create_instance(
    self,
    identity_management_type: "capo_connect.types.directory_type.DirectoryType",
    inbound_calls_enabled: "capo_connect.types.inbound_calls_enabled.InboundCallsEnabled",
    outbound_calls_enabled: "capo_connect.types.outbound_calls_enabled.OutboundCallsEnabled",
    *,
    config_overrides: Optional[AsyncConnectClientConfig] = None,
    client_token: Optional["capo_connect.types.client_token.ClientToken"] = None,
    instance_alias: Optional[
        "capo_connect.types.directory_alias.DirectoryAlias"
    ] = None,
    directory_id: Optional["capo_connect.types.directory_id.DirectoryId"] = None,
    tags: Optional["capo_connect.types.tag_map.TagMap"] = None,
) -> "capo_connect.types.create_instance_response.CreateInstanceResponse":
    """<p>This API is in preview release for Connect Customer and is subject to change.</p> <p>Initiates an Connect Customer instance with all the supported channels enabled. It does not attach any storage, such as Amazon Simple Storage Service (Amazon S3) or Amazon Kinesis. It also does not allow for any configurations on features, such as Contact Lens for Connect Customer. </p> <p>For more information, see <a href="https://docs.aws.amazon.com/connect/latest/adminguide/amazon-connect-instances.html">Create an Connect Customer instance</a> in the <i>Connect Customer Administrator Guide</i>.</p> <p>Connect Customer enforces a limit on the total number of instances that you can create or delete in 30 days. If you exceed this limit, you will get an error message indicating there has been an excessive number of attempts at creating or deleting instances. You must wait 30 days before you can restart creating and deleting instances in your account.</p>

    Args:
        client_token: <p>The idempotency token.</p>
        identity_management_type: <p>The type of identity management for your Connect Customer users.</p>
        instance_alias: <p>The name for your instance.</p>
        directory_id: <p>The identifier for the directory.</p>
        inbound_calls_enabled: <p>Your contact center handles incoming contacts.</p>
        outbound_calls_enabled: <p>Your contact center allows outbound calls.</p>
        tags: <p>The tags used to organize, track, or control access for this resource. For example, <code>{ "tags": {"key1":"value1", "key2":"value2"} }</code>.</p>

    Raises:
        capo_connect.errors.internal_service_exception.InternalServiceException: <p>Request processing failed because of an error or failure with the service.</p>
        capo_connect.errors.invalid_request_exception.InvalidRequestException: <p>The request is not valid.</p>
        capo_connect.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_connect.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The service quota has been exceeded.</p>
        capo_connect.errors.throttling_exception.ThrottlingException: <p>The throttling limit has been exceeded.</p>
        capo_connect.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_connect.types.create_instance_request.CreateInstanceRequest]",
    ) -> AsyncOperationResponse[
        "capo_connect.types.create_instance_response.CreateInstanceResponse"
    ]:
        import capo_connect._operations.amazon_connect_service.create_instance

        (
            output,
            http_response,
        ) = await capo_connect._operations.amazon_connect_service.create_instance.async_create_instance(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_connect.types.create_instance_request.CreateInstanceRequest",
    ) -> dict[str, Any]:
        import capo_connect.types.create_instance_request

        return capo_connect.types.create_instance_request.redact_sensitive(input_)

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging("CreateInstance", redact_input=_redact_input),
    )
    input_: capo_connect.types.create_instance_request.CreateInstanceRequest = {
        "identity_management_type": identity_management_type,
        "inbound_calls_enabled": inbound_calls_enabled,
        "outbound_calls_enabled": outbound_calls_enabled,
    }
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token
    if instance_alias is not None:
        input_["instance_alias"] = instance_alias
    if directory_id is not None:
        input_["directory_id"] = directory_id
    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