Skip to content

create_kx_user async

create_kx_user(
    environment_id: IdType,
    user_name: KxUserNameString,
    iam_role: RoleArn,
    *,
    config_overrides: Optional[AsyncfinspaceClientConfig] = None,
    tags: Optional[TagMap] = None,
    client_token: Optional[ClientToken] = None,
) -> CreateKxUserResponse

Creates a user in FinSpace kdb environment with an associated IAM role.

Parameters:

  • environment_id (IdType) –

    A unique identifier for the kdb environment where you want to create a user.

  • user_name (KxUserNameString) –

    A unique identifier for the user.

  • iam_role (RoleArn) –

    The IAM role ARN that will be associated with the user.

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

    A list of key-value pairs to label the user. You can add up to 50 tags to a user.

  • 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_user(
    self,
    environment_id: "capo_finspace.types.id_type.IdType",
    user_name: "capo_finspace.types.kx_user_name_string.KxUserNameString",
    iam_role: "capo_finspace.types.role_arn.RoleArn",
    *,
    config_overrides: Optional[AsyncfinspaceClientConfig] = 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_user_response.CreateKxUserResponse":
    """<p>Creates a user in FinSpace kdb environment with an associated IAM role.</p>

    Args:
        environment_id: <p>A unique identifier for the kdb environment where you want to create a user.</p>
        user_name: <p>A unique identifier for the user.</p>
        iam_role: <p>The IAM role ARN that will be associated with the user.</p>
        tags: <p>A list of key-value pairs to label the user. You can add up to 50 tags to a user.</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.resource_already_exists_exception.ResourceAlreadyExistsException: <p>The specified resource group already exists.</p>
        capo_finspace.errors.resource_not_found_exception.ResourceNotFoundException: <p>One or more resources can't be found.</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_user_request.CreateKxUserRequest]",
    ) -> AsyncOperationResponse[
        "capo_finspace.types.create_kx_user_response.CreateKxUserResponse"
    ]:
        import capo_finspace._operations.aws_habanero_management_service.create_kx_user

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateKxUser")
    )
    input_: capo_finspace.types.create_kx_user_request.CreateKxUserRequest = {
        "environment_id": environment_id,
        "user_name": user_name,
        "iam_role": iam_role,
    }
    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