Skip to content

create_kx_environment async

create_kx_environment(
    name: KxEnvironmentName,
    kms_key_id: KmsKeyARN,
    *,
    config_overrides: Optional[AsyncfinspaceClientConfig] = None,
    description: Optional[Description] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateKxEnvironmentResponse

Creates a managed kdb environment for the account.

Parameters:

  • name (KxEnvironmentName) –

    The name of the kdb environment that you want to create.

  • description (Optional[Description], default: None ) –

    A description for the kdb environment.

  • kms_key_id (KmsKeyARN) –

    The KMS key ID to encrypt your data in the FinSpace environment.

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

    A list of key-value pairs to label the kdb environment. You can add up to 50 tags to your kdb environment.

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

    A token that ensures idempotency. This token expires in 10 minutes.

Raises:

Source code in docs_src/capo_finspace/_services/async_finspace.py
async def create_kx_environment(
    self,
    name: "capo_finspace.types.kx_environment_name.KxEnvironmentName",
    kms_key_id: "capo_finspace.types.kms_key_arn.KmsKeyARN",
    *,
    config_overrides: Optional[AsyncfinspaceClientConfig] = None,
    description: Optional["capo_finspace.types.description.Description"] = None,
    tags: Optional["capo_finspace.types.tag_map.TagMap"] = None,
    client_token: Optional["capo_finspace.types.client_token.ClientToken"] = None,
) -> (
    "capo_finspace.types.create_kx_environment_response.CreateKxEnvironmentResponse"
):
    """<p>Creates a managed kdb environment for the account.</p>

    Args:
        name: <p>The name of the kdb environment that you want to create.</p>
        description: <p>A description for the kdb environment.</p>
        kms_key_id: <p>The KMS key ID to encrypt your data in the FinSpace environment.</p>
        tags: <p>A list of key-value pairs to label the kdb environment. You can add up to 50 tags to your kdb environment.</p>
        client_token: <p>A token that ensures idempotency. This token expires in 10 minutes.</p>

    Raises:
        capo_finspace.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_finspace.errors.conflict_exception.ConflictException: <p>There was a conflict with this action, and it could not be completed.</p>
        capo_finspace.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception or failure.</p>
        capo_finspace.errors.limit_exceeded_exception.LimitExceededException: <p>A service limit or quota is exceeded.</p>
        capo_finspace.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p> You have exceeded your service quota. To perform the requested action, remove some of the relevant resources, or use Service Quotas to request a service quota increase.</p>
        capo_finspace.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_finspace.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by an AWS service.</p>
        capo_finspace.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_finspace.types.create_kx_environment_request.CreateKxEnvironmentRequest]",
    ) -> AsyncOperationResponse[
        "capo_finspace.types.create_kx_environment_response.CreateKxEnvironmentResponse"
    ]:
        import capo_finspace._operations.aws_habanero_management_service.create_kx_environment

        (
            output,
            http_response,
        ) = await capo_finspace._operations.aws_habanero_management_service.create_kx_environment.async_create_kx_environment(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateKxEnvironment")
    )
    input_: capo_finspace.types.create_kx_environment_request.CreateKxEnvironmentRequest = {
        "name": name,
        "kms_key_id": kms_key_id,
    }
    if description is not None:
        input_["description"] = description
    if tags is not None:
        input_["tags"] = tags
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

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