Skip to content

create_studio async

create_studio(
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    name: Optional[XmlStringMaxLen256] = None,
    description: Optional[XmlStringMaxLen256] = None,
    auth_mode: Optional[AuthMode] = None,
    vpc_id: Optional[XmlStringMaxLen256] = None,
    subnet_ids: Optional[SubnetIdList] = None,
    service_role: Optional[XmlString] = None,
    user_role: Optional[XmlString] = None,
    workspace_security_group_id: Optional[XmlStringMaxLen256] = None,
    engine_security_group_id: Optional[XmlStringMaxLen256] = None,
    default_s3_location: Optional[XmlString] = None,
    idp_auth_url: Optional[XmlString] = None,
    idp_relay_state_parameter_name: Optional[XmlStringMaxLen256] = None,
    tags: Optional[TagList] = None,
    trusted_identity_propagation_enabled: Optional[BooleanObject] = None,
    idc_user_assignment: Optional[IdcUserAssignment] = None,
    idc_instance_arn: Optional[ArnType] = None,
    encryption_key_arn: Optional[XmlString] = None,
) -> CreateStudioOutput

Creates a new Amazon EMR Studio.

Parameters:

  • name (Optional[XmlStringMaxLen256], default: None ) –

    A descriptive name for the Amazon EMR Studio.

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

    A detailed description of the Amazon EMR Studio.

  • auth_mode (Optional[AuthMode], default: None ) –

    Specifies whether the Studio authenticates users using IAM or IAM Identity Center.

  • vpc_id (Optional[XmlStringMaxLen256], default: None ) –

    The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.

  • subnet_ids (Optional[SubnetIdList], default: None ) –

    A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by VpcId. Studio users can create a Workspace in any of the specified subnets.

  • service_role (Optional[XmlString], default: None ) –

    The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.

  • user_role (Optional[XmlString], default: None ) –

    The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a UserRole when you use IAM Identity Center authentication. The permissions attached to the UserRole can be scoped down for each user or group using session policies.

  • workspace_security_group_id (Optional[XmlStringMaxLen256], default: None ) –

    The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by VpcId.

  • engine_security_group_id (Optional[XmlStringMaxLen256], default: None ) –

    The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by VpcId.

  • default_s3_location (Optional[XmlString], default: None ) –

    The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.

  • idp_auth_url (Optional[XmlString], default: None ) –

    The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.

  • idp_relay_state_parameter_name (Optional[XmlStringMaxLen256], default: None ) –

    The name that your identity provider (IdP) uses for its RelayState parameter. For example, RelayState or TargetSource. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The RelayState parameter differs by IdP.

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

    A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.

  • trusted_identity_propagation_enabled (Optional[BooleanObject], default: None ) –

    A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value is false.

  • idc_user_assignment (Optional[IdcUserAssignment], default: None ) –

    Specifies whether IAM Identity Center user assignment is REQUIRED or OPTIONAL. If the value is set to REQUIRED, users must be explicitly assigned to the Studio application to access the Studio.

  • idc_instance_arn (Optional[ArnType], default: None ) –

    The ARN of the IAM Identity Center instance to create the Studio application.

  • encryption_key_arn (Optional[XmlString], default: None ) –

    The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when backed up to Amazon S3.

Raises:

Source code in docs_src/capo_emr/_services/async_emr.py
async def create_studio(
    self,
    *,
    config_overrides: Optional[AsyncEMRClientConfig] = None,
    name: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    description: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    auth_mode: Optional["capo_emr.types.auth_mode.AuthMode"] = None,
    vpc_id: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    subnet_ids: Optional["capo_emr.types.subnet_id_list.SubnetIdList"] = None,
    service_role: Optional["capo_emr.types.xml_string.XmlString"] = None,
    user_role: Optional["capo_emr.types.xml_string.XmlString"] = None,
    workspace_security_group_id: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    engine_security_group_id: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    default_s3_location: Optional["capo_emr.types.xml_string.XmlString"] = None,
    idp_auth_url: Optional["capo_emr.types.xml_string.XmlString"] = None,
    idp_relay_state_parameter_name: Optional[
        "capo_emr.types.xml_string_max_len256.XmlStringMaxLen256"
    ] = None,
    tags: Optional["capo_emr.types.tag_list.TagList"] = None,
    trusted_identity_propagation_enabled: Optional[
        "capo_emr.types.boolean_object.BooleanObject"
    ] = None,
    idc_user_assignment: Optional[
        "capo_emr.types.idc_user_assignment.IdcUserAssignment"
    ] = None,
    idc_instance_arn: Optional["capo_emr.types.arn_type.ArnType"] = None,
    encryption_key_arn: Optional["capo_emr.types.xml_string.XmlString"] = None,
) -> "capo_emr.types.create_studio_output.CreateStudioOutput":
    """<p>Creates a new Amazon EMR Studio.</p>

    Args:
        name: <p>A descriptive name for the Amazon EMR Studio.</p>
        description: <p>A detailed description of the Amazon EMR Studio.</p>
        auth_mode: <p>Specifies whether the Studio authenticates users using IAM or IAM Identity Center.</p>
        vpc_id: <p>The ID of the Amazon Virtual Private Cloud (Amazon VPC) to associate with the Studio.</p>
        subnet_ids: <p>A list of subnet IDs to associate with the Amazon EMR Studio. A Studio can have a maximum of 5 subnets. The subnets must belong to the VPC specified by <code>VpcId</code>. Studio users can create a Workspace in any of the specified subnets.</p>
        service_role: <p>The IAM role that the Amazon EMR Studio assumes. The service role provides a way for Amazon EMR Studio to interoperate with other Amazon Web Services services.</p>
        user_role: <p>The IAM user role that users and groups assume when logged in to an Amazon EMR Studio. Only specify a <code>UserRole</code> when you use IAM Identity Center authentication. The permissions attached to the <code>UserRole</code> can be scoped down for each user or group using session policies.</p>
        workspace_security_group_id: <p>The ID of the Amazon EMR Studio Workspace security group. The Workspace security group allows outbound network traffic to resources in the Engine security group, and it must be in the same VPC specified by <code>VpcId</code>.</p>
        engine_security_group_id: <p>The ID of the Amazon EMR Studio Engine security group. The Engine security group allows inbound network traffic from the Workspace security group, and it must be in the same VPC specified by <code>VpcId</code>.</p>
        default_s3_location: <p>The Amazon S3 location to back up Amazon EMR Studio Workspaces and notebook files.</p>
        idp_auth_url: <p>The authentication endpoint of your identity provider (IdP). Specify this value when you use IAM authentication and want to let federated users log in to a Studio with the Studio URL and credentials from your IdP. Amazon EMR Studio redirects users to this endpoint to enter credentials.</p>
        idp_relay_state_parameter_name: <p>The name that your identity provider (IdP) uses for its <code>RelayState</code> parameter. For example, <code>RelayState</code> or <code>TargetSource</code>. Specify this value when you use IAM authentication and want to let federated users log in to a Studio using the Studio URL. The <code>RelayState</code> parameter differs by IdP.</p>
        tags: <p>A list of tags to associate with the Amazon EMR Studio. Tags are user-defined key-value pairs that consist of a required key string with a maximum of 128 characters, and an optional value string with a maximum of 256 characters.</p>
        trusted_identity_propagation_enabled: <p> A Boolean indicating whether to enable Trusted identity propagation for the Studio. The default value is <code>false</code>. </p>
        idc_user_assignment: <p> Specifies whether IAM Identity Center user assignment is <code>REQUIRED</code> or <code>OPTIONAL</code>. If the value is set to <code>REQUIRED</code>, users must be explicitly assigned to the Studio application to access the Studio. </p>
        idc_instance_arn: <p> The ARN of the IAM Identity Center instance to create the Studio application. </p>
        encryption_key_arn: <p>The KMS key identifier (ARN) used to encrypt Amazon EMR Studio workspace and notebook files when backed up to Amazon S3.</p>

    Raises:
        capo_emr.errors.internal_server_exception.InternalServerException: <p>This exception occurs when there is an internal failure in the Amazon EMR service.</p>
        capo_emr.errors.invalid_request_exception.InvalidRequestException: <p>This exception occurs when there is something wrong with user input.</p>
        capo_emr.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_emr.types.create_studio_input.CreateStudioInput]",
    ) -> AsyncOperationResponse[
        "capo_emr.types.create_studio_output.CreateStudioOutput"
    ]:
        import capo_emr._operations.elastic_map_reduce.create_studio

        (
            output,
            http_response,
        ) = await capo_emr._operations.elastic_map_reduce.create_studio.async_create_studio(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateStudio")
    )
    input_: capo_emr.types.create_studio_input.CreateStudioInput = {}
    if name is not None:
        input_["name"] = name
    if description is not None:
        input_["description"] = description
    if auth_mode is not None:
        input_["auth_mode"] = auth_mode
    if vpc_id is not None:
        input_["vpc_id"] = vpc_id
    if subnet_ids is not None:
        input_["subnet_ids"] = subnet_ids
    if service_role is not None:
        input_["service_role"] = service_role
    if user_role is not None:
        input_["user_role"] = user_role
    if workspace_security_group_id is not None:
        input_["workspace_security_group_id"] = workspace_security_group_id
    if engine_security_group_id is not None:
        input_["engine_security_group_id"] = engine_security_group_id
    if default_s3_location is not None:
        input_["default_s3_location"] = default_s3_location
    if idp_auth_url is not None:
        input_["idp_auth_url"] = idp_auth_url
    if idp_relay_state_parameter_name is not None:
        input_["idp_relay_state_parameter_name"] = idp_relay_state_parameter_name
    if tags is not None:
        input_["tags"] = tags
    if trusted_identity_propagation_enabled is not None:
        input_["trusted_identity_propagation_enabled"] = (
            trusted_identity_propagation_enabled
        )
    if idc_user_assignment is not None:
        input_["idc_user_assignment"] = idc_user_assignment
    if idc_instance_arn is not None:
        input_["idc_instance_arn"] = idc_instance_arn
    if encryption_key_arn is not None:
        input_["encryption_key_arn"] = encryption_key_arn

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