Skip to content

create_virtual_cluster async

create_virtual_cluster(
    name: ResourceNameString,
    container_provider: ContainerProvider,
    client_token: ClientToken,
    *,
    config_overrides: Optional[AsyncEMRcontainersClientConfig] = None,
    tags: Optional[TagMap] = None,
    security_configuration_id: Optional[ResourceIdString] = None,
    session_enabled: Optional[Boolean] = None,
    scheduler_configuration: Optional[SchedulerConfiguration] = None,
) -> CreateVirtualClusterResponse

Creates a virtual cluster. Virtual cluster is a managed entity on Amazon EMR on EKS. You can create, update, describe, list and delete virtual clusters. They do not consume any additional resource in your system. A single virtual cluster maps to a single Kubernetes namespace. Given this relationship, you can model virtual clusters the same way you model Kubernetes namespaces to meet your requirements.

Parameters:

  • name (ResourceNameString) –

    The specified name of the virtual cluster.

  • container_provider (ContainerProvider) –

    The container provider of the virtual cluster.

  • client_token (ClientToken) –

    The client token of the virtual cluster.

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

    The tags assigned to the virtual cluster.

  • security_configuration_id (Optional[ResourceIdString], default: None ) –

    The ID of the security configuration.

  • session_enabled (Optional[Boolean], default: None ) –

    Indicates whether the virtual cluster has session support enabled.

  • scheduler_configuration (Optional[SchedulerConfiguration], default: None ) –

    The scheduler configuration (concurrency and queue limits) to apply to the virtual cluster at creation time. When omitted, no limits are applied.

Raises:

Source code in docs_src/capo_emr_containers/_services/async_em_rcontainers.py
async def create_virtual_cluster(
    self,
    name: "capo_emr_containers.types.resource_name_string.ResourceNameString",
    container_provider: "capo_emr_containers.types.container_provider.ContainerProvider",
    client_token: "capo_emr_containers.types.client_token.ClientToken",
    *,
    config_overrides: Optional[AsyncEMRcontainersClientConfig] = None,
    tags: Optional["capo_emr_containers.types.tag_map.TagMap"] = None,
    security_configuration_id: Optional[
        "capo_emr_containers.types.resource_id_string.ResourceIdString"
    ] = None,
    session_enabled: Optional["capo_emr_containers.types.boolean.Boolean"] = None,
    scheduler_configuration: Optional[
        "capo_emr_containers.types.scheduler_configuration.SchedulerConfiguration"
    ] = None,
) -> "capo_emr_containers.types.create_virtual_cluster_response.CreateVirtualClusterResponse":
    """<p>Creates a virtual cluster. Virtual cluster is a managed entity on Amazon EMR on EKS. You can create, update, describe, list and delete virtual clusters. They do not consume any additional resource in your system. A single virtual cluster maps to a single Kubernetes namespace. Given this relationship, you can model virtual clusters the same way you model Kubernetes namespaces to meet your requirements.</p>

    Args:
        name: <p>The specified name of the virtual cluster.</p>
        container_provider: <p>The container provider of the virtual cluster.</p>
        client_token: <p>The client token of the virtual cluster.</p>
        tags: <p>The tags assigned to the virtual cluster.</p>
        security_configuration_id: <p>The ID of the security configuration.</p>
        session_enabled: <p>Indicates whether the virtual cluster has session support enabled.</p>
        scheduler_configuration: <p>The scheduler configuration (concurrency and queue limits) to apply to the virtual cluster at creation time. When omitted, no limits are applied.</p>

    Raises:
        capo_emr_containers.errors.eks_request_throttled_exception.EKSRequestThrottledException: <p>The request exceeded the Amazon EKS API operation limits.</p>
        capo_emr_containers.errors.internal_server_exception.InternalServerException: <p>This is an internal server exception.</p>
        capo_emr_containers.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource was not found.</p>
        capo_emr_containers.errors.validation_exception.ValidationException: <p>There are invalid parameters in the client request.</p>
        capo_emr_containers.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr_containers.types.create_virtual_cluster_request.CreateVirtualClusterRequest]",
    ) -> AsyncOperationResponse[
        "capo_emr_containers.types.create_virtual_cluster_response.CreateVirtualClusterResponse"
    ]:
        import capo_emr_containers._operations.aws_chicago_web_service.create_virtual_cluster

        (
            output,
            http_response,
        ) = await capo_emr_containers._operations.aws_chicago_web_service.create_virtual_cluster.async_create_virtual_cluster(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateVirtualCluster")
    )
    input_: capo_emr_containers.types.create_virtual_cluster_request.CreateVirtualClusterRequest = {
        "name": name,
        "container_provider": container_provider,
        "client_token": client_token,
    }
    if tags is not None:
        input_["tags"] = tags
    if security_configuration_id is not None:
        input_["security_configuration_id"] = security_configuration_id
    if session_enabled is not None:
        input_["session_enabled"] = session_enabled
    if scheduler_configuration is not None:
        input_["scheduler_configuration"] = scheduler_configuration

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