Skip to content

create_data_source

create_data_source(
    name: Name,
    domain_identifier: DomainId,
    project_identifier: str,
    type: DataSourceType,
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional[Description] = None,
    environment_identifier: Optional[str] = None,
    connection_identifier: Optional[str] = None,
    configuration: Optional[DataSourceConfigurationInput] = None,
    recommendation: Optional[RecommendationConfiguration] = None,
    enable_setting: Optional[EnableSetting] = None,
    schedule: Optional[ScheduleConfiguration] = None,
    publish_on_import: Optional[bool] = None,
    asset_forms_input: Optional[FormInputList] = None,
    client_token: Optional[str] = None,
) -> CreateDataSourceOutput

Creates an Amazon DataZone data source.

Parameters:

  • name (Name) –

    The name of the data source.

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

    The description of the data source.

  • domain_identifier (DomainId) –

    The ID of the Amazon DataZone domain where the data source is created.

  • project_identifier (str) –

    The identifier of the Amazon DataZone project in which you want to add this data source.

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

    The unique identifier of the Amazon DataZone environment to which the data source publishes assets.

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

    The ID of the connection.

  • type (DataSourceType) –

    The type of the data source. In Amazon DataZone, you can use data sources to import technical metadata of assets (data) from the source databases or data warehouses into Amazon DataZone. In the current release of Amazon DataZone, you can create and run data sources for Amazon Web Services Glue and Amazon Redshift.

  • configuration (Optional[DataSourceConfigurationInput], default: None ) –

    Specifies the configuration of the data source. It can be set to either glueRunConfiguration or redshiftRunConfiguration.

  • recommendation (Optional[RecommendationConfiguration], default: None ) –

    Specifies whether the business name generation is to be enabled for this data source.

  • enable_setting (Optional[EnableSetting], default: None ) –

    Specifies whether the data source is enabled.

  • schedule (Optional[ScheduleConfiguration], default: None ) –

    The schedule of the data source runs.

  • publish_on_import (Optional[bool], default: None ) –

    Specifies whether the assets that this data source creates in the inventory are to be also automatically published to the catalog.

  • asset_forms_input (Optional[FormInputList], default: None ) –

    The metadata forms that are to be attached to the assets that this data source works with.

  • 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/data_zone.py
def create_data_source(
    self,
    name: "capo_datazone.types.name.Name",
    domain_identifier: "capo_datazone.types.domain_id.DomainId",
    project_identifier: str,
    type: "capo_datazone.types.data_source_type.DataSourceType",
    *,
    config_overrides: Optional[DataZoneClientConfig] = None,
    description: Optional["capo_datazone.types.description.Description"] = None,
    environment_identifier: Optional[str] = None,
    connection_identifier: Optional[str] = None,
    configuration: Optional[
        "capo_datazone.types.data_source_configuration_input.DataSourceConfigurationInput"
    ] = None,
    recommendation: Optional[
        "capo_datazone.types.recommendation_configuration.RecommendationConfiguration"
    ] = None,
    enable_setting: Optional[
        "capo_datazone.types.enable_setting.EnableSetting"
    ] = None,
    schedule: Optional[
        "capo_datazone.types.schedule_configuration.ScheduleConfiguration"
    ] = None,
    publish_on_import: Optional[bool] = None,
    asset_forms_input: Optional[
        "capo_datazone.types.form_input_list.FormInputList"
    ] = None,
    client_token: Optional[str] = None,
) -> "capo_datazone.types.create_data_source_output.CreateDataSourceOutput":
    """<p>Creates an Amazon DataZone data source.</p>

    Args:
        name: <p>The name of the data source.</p>
        description: <p>The description of the data source.</p>
        domain_identifier: <p>The ID of the Amazon DataZone domain where the data source is created.</p>
        project_identifier: <p>The identifier of the Amazon DataZone project in which you want to add this data source.</p>
        environment_identifier: <p>The unique identifier of the Amazon DataZone environment to which the data source publishes assets. </p>
        connection_identifier: <p>The ID of the connection.</p>
        type: <p>The type of the data source. In Amazon DataZone, you can use data sources to import technical metadata of assets (data) from the source databases or data warehouses into Amazon DataZone. In the current release of Amazon DataZone, you can create and run data sources for Amazon Web Services Glue and Amazon Redshift.</p>
        configuration: <p>Specifies the configuration of the data source. It can be set to either <code>glueRunConfiguration</code> or <code>redshiftRunConfiguration</code>.</p>
        recommendation: <p>Specifies whether the business name generation is to be enabled for this data source.</p>
        enable_setting: <p>Specifies whether the data source is enabled.</p>
        schedule: <p>The schedule of the data source runs.</p>
        publish_on_import: <p>Specifies whether the assets that this data source creates in the inventory are to be also automatically published to the catalog.</p>
        asset_forms_input: <p>The metadata forms that are to be attached to the assets that this data source works with.</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.
    """

    def _handler(
        req: "OperationRequest[capo_datazone.types.create_data_source_input.CreateDataSourceInput]",
    ) -> OperationResponse[
        "capo_datazone.types.create_data_source_output.CreateDataSourceOutput"
    ]:
        import capo_datazone._operations.data_zone.create_data_source

        output, http_response = (
            capo_datazone._operations.data_zone.create_data_source.create_data_source(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    def _redact_input(
        input_: "capo_datazone.types.create_data_source_input.CreateDataSourceInput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_data_source_input

        return capo_datazone.types.create_data_source_input.redact_sensitive(input_)

    def _redact_output(
        output: "capo_datazone.types.create_data_source_output.CreateDataSourceOutput",
    ) -> dict[str, Any]:
        import capo_datazone.types.create_data_source_output

        return capo_datazone.types.create_data_source_output.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "CreateDataSource",
            redact_input=_redact_input,
            redact_output=_redact_output,
        ),
    )
    input_: capo_datazone.types.create_data_source_input.CreateDataSourceInput = {
        "name": name,
        "domain_identifier": domain_identifier,
        "project_identifier": project_identifier,
        "type": type,
    }
    if description is not None:
        input_["description"] = description
    if environment_identifier is not None:
        input_["environment_identifier"] = environment_identifier
    if connection_identifier is not None:
        input_["connection_identifier"] = connection_identifier
    if configuration is not None:
        input_["configuration"] = configuration
    if recommendation is not None:
        input_["recommendation"] = recommendation
    if enable_setting is not None:
        input_["enable_setting"] = enable_setting
    if schedule is not None:
        input_["schedule"] = schedule
    if publish_on_import is not None:
        input_["publish_on_import"] = publish_on_import
    if asset_forms_input is not None:
        input_["asset_forms_input"] = asset_forms_input
    if client_token is None:
        client_token = str(uuid.uuid4())
    input_["client_token"] = client_token

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output