Skip to content

create_domain async

create_domain(
    name: str,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional[str] = None,
    single_sign_on: Optional[SingleSignOn] = None,
    domain_execution_role: Optional[RoleArn] = None,
    kms_key_identifier: Optional[KmsKeyArn] = None,
    tags: Optional[Tags] = None,
    domain_version: Optional[DomainVersion] = None,
    service_role: Optional[RoleArn] = None,
    client_token: Optional[str] = None,
) -> CreateDomainOutput

Creates an Amazon DataZone domain.

Parameters:

  • name (str) –

    The name of the Amazon DataZone domain.

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

    The description of the Amazon DataZone domain.

  • single_sign_on (Optional[SingleSignOn], default: None ) –

    The single-sign on configuration of the Amazon DataZone domain.

  • domain_execution_role (Optional[RoleArn], default: None ) –

    The domain execution role that is created when an Amazon DataZone domain is created. The domain execution role is created in the Amazon Web Services account that houses the Amazon DataZone domain.

  • kms_key_identifier (Optional[KmsKeyArn], default: None ) –

    The identifier of the Amazon Web Services Key Management Service (KMS) key that is used to encrypt the Amazon DataZone domain, metadata, and reporting data.

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

    The tags specified for the Amazon DataZone domain.

  • domain_version (Optional[DomainVersion], default: None ) –

    The version of the domain that is created.

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

    The service role of the domain that is created.

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

    A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.

Raises:

Source code in docs_src/capo_datazone/_services/async_data_zone.py
async def create_domain(
    self,
    name: str,
    *,
    config_overrides: Optional[AsyncDataZoneClientConfig] = None,
    description: Optional[str] = None,
    single_sign_on: Optional[
        "capo_datazone.types.single_sign_on.SingleSignOn"
    ] = None,
    domain_execution_role: Optional["capo_datazone.types.role_arn.RoleArn"] = None,
    kms_key_identifier: Optional[
        "capo_datazone.types.kms_key_arn.KmsKeyArn"
    ] = None,
    tags: Optional["capo_datazone.types.tags.Tags"] = None,
    domain_version: Optional[
        "capo_datazone.types.domain_version.DomainVersion"
    ] = None,
    service_role: Optional["capo_datazone.types.role_arn.RoleArn"] = None,
    client_token: Optional[str] = None,
) -> "capo_datazone.types.create_domain_output.CreateDomainOutput":
    """<p>Creates an Amazon DataZone domain.</p>

    Args:
        name: <p>The name of the Amazon DataZone domain.</p>
        description: <p>The description of the Amazon DataZone domain.</p>
        single_sign_on: <p>The single-sign on configuration of the Amazon DataZone domain.</p>
        domain_execution_role: <p>The domain execution role that is created when an Amazon DataZone domain is created. The domain execution role is created in the Amazon Web Services account that houses the Amazon DataZone domain.</p>
        kms_key_identifier: <p>The identifier of the Amazon Web Services Key Management Service (KMS) key that is used to encrypt the Amazon DataZone domain, metadata, and reporting data. </p>
        tags: <p>The tags specified for the Amazon DataZone domain.</p>
        domain_version: <p>The version of the domain that is created.</p>
        service_role: <p>The service role of the domain that is created.</p>
        client_token: <p>A unique, case-sensitive identifier that is provided to ensure the idempotency of the request.</p>

    Raises:
        capo_datazone.errors.access_denied_exception.AccessDeniedException: <p>You do not have sufficient access to perform this action.</p>
        capo_datazone.errors.throttling_exception.ThrottlingException: <p>The request was denied due to request throttling.</p>
        capo_datazone.errors.unauthorized_exception.UnauthorizedException: <p>You do not have permission to perform this action.</p>
        capo_datazone.errors.conflict_exception.ConflictException: <p>There is a conflict while performing this action.</p>
        capo_datazone.errors.internal_server_exception.InternalServerException: <p>The request has failed because of an unknown error, exception or failure.</p>
        capo_datazone.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified resource cannot be found.</p>
        capo_datazone.errors.service_quota_exceeded_exception.ServiceQuotaExceededException: <p>The request has exceeded the specified service quota.</p>
        capo_datazone.errors.validation_exception.ValidationException: <p>The input fails to satisfy the constraints specified by the Amazon Web Services service.</p>
        capo_datazone.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_datazone.types.create_domain_input.CreateDomainInput]",
    ) -> AsyncOperationResponse[
        "capo_datazone.types.create_domain_output.CreateDomainOutput"
    ]:
        import capo_datazone._operations.data_zone.create_domain

        (
            output,
            http_response,
        ) = await capo_datazone._operations.data_zone.create_domain.async_create_domain(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("CreateDomain")
    )
    input_: capo_datazone.types.create_domain_input.CreateDomainInput = {
        "name": name
    }
    if description is not None:
        input_["description"] = description
    if single_sign_on is not None:
        input_["single_sign_on"] = single_sign_on
    if domain_execution_role is not None:
        input_["domain_execution_role"] = domain_execution_role
    if kms_key_identifier is not None:
        input_["kms_key_identifier"] = kms_key_identifier
    if tags is not None:
        input_["tags"] = tags
    if domain_version is not None:
        input_["domain_version"] = domain_version
    if service_role is not None:
        input_["service_role"] = service_role
    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