- Navigation GuideYou are on a Command (operation) page with structural examples. Use the navigation breadcrumb if you would like to return to the Client landing page.
CreateDataSourceCommand
Creates an Amazon DataZone data source.
Example Syntax
Use a bare-bones client and the command you need to make an API call.
import { DataZoneClient, CreateDataSourceCommand } from "@aws-sdk/client-datazone"; // ES Modules import
// const { DataZoneClient, CreateDataSourceCommand } = require("@aws-sdk/client-datazone"); // CommonJS import
const client = new DataZoneClient(config);
const input = { // CreateDataSourceInput
name: "STRING_VALUE", // required
description: "STRING_VALUE",
domainIdentifier: "STRING_VALUE", // required
projectIdentifier: "STRING_VALUE", // required
environmentIdentifier: "STRING_VALUE",
connectionIdentifier: "STRING_VALUE",
type: "STRING_VALUE", // required
configuration: { // DataSourceConfigurationInput Union: only one key present
glueRunConfiguration: { // GlueRunConfigurationInput
dataAccessRole: "STRING_VALUE",
relationalFilterConfigurations: [ // RelationalFilterConfigurations // required
{ // RelationalFilterConfiguration
databaseName: "STRING_VALUE", // required
schemaName: "STRING_VALUE",
filterExpressions: [ // FilterExpressions
{ // FilterExpression
type: "INCLUDE" || "EXCLUDE", // required
expression: "STRING_VALUE", // required
},
],
},
],
autoImportDataQualityResult: true || false,
catalogName: "STRING_VALUE",
},
redshiftRunConfiguration: { // RedshiftRunConfigurationInput
dataAccessRole: "STRING_VALUE",
relationalFilterConfigurations: [ // required
{
databaseName: "STRING_VALUE", // required
schemaName: "STRING_VALUE",
filterExpressions: [
{
type: "INCLUDE" || "EXCLUDE", // required
expression: "STRING_VALUE", // required
},
],
},
],
redshiftCredentialConfiguration: { // RedshiftCredentialConfiguration
secretManagerArn: "STRING_VALUE", // required
},
redshiftStorage: { // RedshiftStorage Union: only one key present
redshiftClusterSource: { // RedshiftClusterStorage
clusterName: "STRING_VALUE", // required
},
redshiftServerlessSource: { // RedshiftServerlessStorage
workgroupName: "STRING_VALUE", // required
},
},
},
sageMakerRunConfiguration: { // SageMakerRunConfigurationInput
trackingAssets: { // TrackingAssets // required
"<keys>": [ // TrackingAssetArns
"STRING_VALUE",
],
},
},
},
recommendation: { // RecommendationConfiguration
enableBusinessNameGeneration: true || false,
},
enableSetting: "ENABLED" || "DISABLED",
schedule: { // ScheduleConfiguration
timezone: "UTC" || "AFRICA_JOHANNESBURG" || "AMERICA_MONTREAL" || "AMERICA_SAO_PAULO" || "ASIA_BAHRAIN" || "ASIA_BANGKOK" || "ASIA_CALCUTTA" || "ASIA_DUBAI" || "ASIA_HONG_KONG" || "ASIA_JAKARTA" || "ASIA_KUALA_LUMPUR" || "ASIA_SEOUL" || "ASIA_SHANGHAI" || "ASIA_SINGAPORE" || "ASIA_TAIPEI" || "ASIA_TOKYO" || "AUSTRALIA_MELBOURNE" || "AUSTRALIA_SYDNEY" || "CANADA_CENTRAL" || "CET" || "CST6CDT" || "ETC_GMT" || "ETC_GMT0" || "ETC_GMT_ADD_0" || "ETC_GMT_ADD_1" || "ETC_GMT_ADD_10" || "ETC_GMT_ADD_11" || "ETC_GMT_ADD_12" || "ETC_GMT_ADD_2" || "ETC_GMT_ADD_3" || "ETC_GMT_ADD_4" || "ETC_GMT_ADD_5" || "ETC_GMT_ADD_6" || "ETC_GMT_ADD_7" || "ETC_GMT_ADD_8" || "ETC_GMT_ADD_9" || "ETC_GMT_NEG_0" || "ETC_GMT_NEG_1" || "ETC_GMT_NEG_10" || "ETC_GMT_NEG_11" || "ETC_GMT_NEG_12" || "ETC_GMT_NEG_13" || "ETC_GMT_NEG_14" || "ETC_GMT_NEG_2" || "ETC_GMT_NEG_3" || "ETC_GMT_NEG_4" || "ETC_GMT_NEG_5" || "ETC_GMT_NEG_6" || "ETC_GMT_NEG_7" || "ETC_GMT_NEG_8" || "ETC_GMT_NEG_9" || "EUROPE_DUBLIN" || "EUROPE_LONDON" || "EUROPE_PARIS" || "EUROPE_STOCKHOLM" || "EUROPE_ZURICH" || "ISRAEL" || "MEXICO_GENERAL" || "MST7MDT" || "PACIFIC_AUCKLAND" || "US_CENTRAL" || "US_EASTERN" || "US_MOUNTAIN" || "US_PACIFIC",
schedule: "STRING_VALUE",
},
publishOnImport: true || false,
assetFormsInput: [ // FormInputList
{ // FormInput
formName: "STRING_VALUE", // required
typeIdentifier: "STRING_VALUE",
typeRevision: "STRING_VALUE",
content: "STRING_VALUE",
},
],
clientToken: "STRING_VALUE",
};
const command = new CreateDataSourceCommand(input);
const response = await client.send(command);
// { // CreateDataSourceOutput
// id: "STRING_VALUE", // required
// status: "CREATING" || "FAILED_CREATION" || "READY" || "UPDATING" || "FAILED_UPDATE" || "RUNNING" || "DELETING" || "FAILED_DELETION",
// type: "STRING_VALUE",
// name: "STRING_VALUE", // required
// description: "STRING_VALUE",
// domainId: "STRING_VALUE", // required
// projectId: "STRING_VALUE", // required
// environmentId: "STRING_VALUE",
// connectionId: "STRING_VALUE",
// configuration: { // DataSourceConfigurationOutput Union: only one key present
// glueRunConfiguration: { // GlueRunConfigurationOutput
// accountId: "STRING_VALUE",
// region: "STRING_VALUE",
// dataAccessRole: "STRING_VALUE",
// relationalFilterConfigurations: [ // RelationalFilterConfigurations // required
// { // RelationalFilterConfiguration
// databaseName: "STRING_VALUE", // required
// schemaName: "STRING_VALUE",
// filterExpressions: [ // FilterExpressions
// { // FilterExpression
// type: "INCLUDE" || "EXCLUDE", // required
// expression: "STRING_VALUE", // required
// },
// ],
// },
// ],
// autoImportDataQualityResult: true || false,
// catalogName: "STRING_VALUE",
// },
// redshiftRunConfiguration: { // RedshiftRunConfigurationOutput
// accountId: "STRING_VALUE",
// region: "STRING_VALUE",
// dataAccessRole: "STRING_VALUE",
// relationalFilterConfigurations: [ // required
// {
// databaseName: "STRING_VALUE", // required
// schemaName: "STRING_VALUE",
// filterExpressions: [
// {
// type: "INCLUDE" || "EXCLUDE", // required
// expression: "STRING_VALUE", // required
// },
// ],
// },
// ],
// redshiftCredentialConfiguration: { // RedshiftCredentialConfiguration
// secretManagerArn: "STRING_VALUE", // required
// },
// redshiftStorage: { // RedshiftStorage Union: only one key present
// redshiftClusterSource: { // RedshiftClusterStorage
// clusterName: "STRING_VALUE", // required
// },
// redshiftServerlessSource: { // RedshiftServerlessStorage
// workgroupName: "STRING_VALUE", // required
// },
// },
// },
// sageMakerRunConfiguration: { // SageMakerRunConfigurationOutput
// accountId: "STRING_VALUE",
// region: "STRING_VALUE",
// trackingAssets: { // TrackingAssets // required
// "<keys>": [ // TrackingAssetArns
// "STRING_VALUE",
// ],
// },
// },
// },
// recommendation: { // RecommendationConfiguration
// enableBusinessNameGeneration: true || false,
// },
// enableSetting: "ENABLED" || "DISABLED",
// publishOnImport: true || false,
// assetFormsOutput: [ // FormOutputList
// { // FormOutput
// formName: "STRING_VALUE", // required
// typeName: "STRING_VALUE",
// typeRevision: "STRING_VALUE",
// content: "STRING_VALUE",
// },
// ],
// schedule: { // ScheduleConfiguration
// timezone: "UTC" || "AFRICA_JOHANNESBURG" || "AMERICA_MONTREAL" || "AMERICA_SAO_PAULO" || "ASIA_BAHRAIN" || "ASIA_BANGKOK" || "ASIA_CALCUTTA" || "ASIA_DUBAI" || "ASIA_HONG_KONG" || "ASIA_JAKARTA" || "ASIA_KUALA_LUMPUR" || "ASIA_SEOUL" || "ASIA_SHANGHAI" || "ASIA_SINGAPORE" || "ASIA_TAIPEI" || "ASIA_TOKYO" || "AUSTRALIA_MELBOURNE" || "AUSTRALIA_SYDNEY" || "CANADA_CENTRAL" || "CET" || "CST6CDT" || "ETC_GMT" || "ETC_GMT0" || "ETC_GMT_ADD_0" || "ETC_GMT_ADD_1" || "ETC_GMT_ADD_10" || "ETC_GMT_ADD_11" || "ETC_GMT_ADD_12" || "ETC_GMT_ADD_2" || "ETC_GMT_ADD_3" || "ETC_GMT_ADD_4" || "ETC_GMT_ADD_5" || "ETC_GMT_ADD_6" || "ETC_GMT_ADD_7" || "ETC_GMT_ADD_8" || "ETC_GMT_ADD_9" || "ETC_GMT_NEG_0" || "ETC_GMT_NEG_1" || "ETC_GMT_NEG_10" || "ETC_GMT_NEG_11" || "ETC_GMT_NEG_12" || "ETC_GMT_NEG_13" || "ETC_GMT_NEG_14" || "ETC_GMT_NEG_2" || "ETC_GMT_NEG_3" || "ETC_GMT_NEG_4" || "ETC_GMT_NEG_5" || "ETC_GMT_NEG_6" || "ETC_GMT_NEG_7" || "ETC_GMT_NEG_8" || "ETC_GMT_NEG_9" || "EUROPE_DUBLIN" || "EUROPE_LONDON" || "EUROPE_PARIS" || "EUROPE_STOCKHOLM" || "EUROPE_ZURICH" || "ISRAEL" || "MEXICO_GENERAL" || "MST7MDT" || "PACIFIC_AUCKLAND" || "US_CENTRAL" || "US_EASTERN" || "US_MOUNTAIN" || "US_PACIFIC",
// schedule: "STRING_VALUE",
// },
// lastRunStatus: "REQUESTED" || "RUNNING" || "FAILED" || "PARTIALLY_SUCCEEDED" || "SUCCESS",
// lastRunAt: new Date("TIMESTAMP"),
// lastRunErrorMessage: { // DataSourceErrorMessage
// errorType: "ACCESS_DENIED_EXCEPTION" || "CONFLICT_EXCEPTION" || "INTERNAL_SERVER_EXCEPTION" || "RESOURCE_NOT_FOUND_EXCEPTION" || "SERVICE_QUOTA_EXCEEDED_EXCEPTION" || "THROTTLING_EXCEPTION" || "VALIDATION_EXCEPTION", // required
// errorDetail: "STRING_VALUE",
// },
// errorMessage: {
// errorType: "ACCESS_DENIED_EXCEPTION" || "CONFLICT_EXCEPTION" || "INTERNAL_SERVER_EXCEPTION" || "RESOURCE_NOT_FOUND_EXCEPTION" || "SERVICE_QUOTA_EXCEEDED_EXCEPTION" || "THROTTLING_EXCEPTION" || "VALIDATION_EXCEPTION", // required
// errorDetail: "STRING_VALUE",
// },
// createdAt: new Date("TIMESTAMP"),
// updatedAt: new Date("TIMESTAMP"),
// };
CreateDataSourceCommand Input
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
domainIdentifier Required | string | undefined | The ID of the Amazon DataZone domain where the data source is created. |
name Required | string | undefined | The name of the data source. |
projectIdentifier Required | string | undefined | The identifier of the Amazon DataZone project in which you want to add this data source. |
type Required | string | undefined | 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. |
assetFormsInput | FormInput[] | undefined | The metadata forms that are to be attached to the assets that this data source works with. |
clientToken | string | undefined | A unique, case-sensitive identifier that is provided to ensure the idempotency of the request. |
configuration | DataSourceConfigurationInput | undefined | Specifies the configuration of the data source. It can be set to either |
connectionIdentifier | string | undefined | The ID of the connection. |
description | string | undefined | The description of the data source. |
enableSetting | EnableSetting | undefined | Specifies whether the data source is enabled. |
environmentIdentifier | string | undefined | The unique identifier of the Amazon DataZone environment to which the data source publishes assets. |
publishOnImport | boolean | undefined | Specifies whether the assets that this data source creates in the inventory are to be also automatically published to the catalog. |
recommendation | RecommendationConfiguration | undefined | Specifies whether the business name generation is to be enabled for this data source. |
schedule | ScheduleConfiguration | undefined | The schedule of the data source runs. |
CreateDataSourceCommand Output
Parameter | Type | Description |
---|
Parameter | Type | Description |
---|---|---|
$metadata Required | ResponseMetadata | Metadata pertaining to this request. |
domainId Required | string | undefined | The ID of the Amazon DataZone domain in which the data source is created. |
id Required | string | undefined | The unique identifier of the data source. |
name Required | string | undefined | The name of the data source. |
projectId Required | string | undefined | The ID of the Amazon DataZone project to which the data source is added. |
assetFormsOutput | FormOutput[] | undefined | The metadata forms attached to the assets that this data source creates. |
configuration | DataSourceConfigurationOutput | undefined | Specifies the configuration of the data source. It can be set to either |
connectionId | string | undefined | The ID of the connection. |
createdAt | Date | undefined | The timestamp of when the data source was created. |
description | string | undefined | The description of the data source. |
enableSetting | EnableSetting | undefined | Specifies whether the data source is enabled. |
environmentId | string | undefined | The unique identifier of the Amazon DataZone environment to which the data source publishes assets. |
errorMessage | DataSourceErrorMessage | undefined | Specifies the error message that is returned if the operation cannot be successfully completed. |
lastRunAt | Date | undefined | The timestamp that specifies when the data source was last run. |
lastRunErrorMessage | DataSourceErrorMessage | undefined | Specifies the error message that is returned if the operation cannot be successfully completed. |
lastRunStatus | DataSourceRunStatus | undefined | The status of the last run of this data source. |
publishOnImport | boolean | undefined | Specifies whether the assets that this data source creates in the inventory are to be also automatically published to the catalog. |
recommendation | RecommendationConfiguration | undefined | Specifies whether the business name generation is to be enabled for this data source. |
schedule | ScheduleConfiguration | undefined | The schedule of the data source runs. |
status | DataSourceStatus | undefined | The status of the data source. |
type | string | undefined | The type of the data source. |
updatedAt | Date | undefined | The timestamp of when the data source was updated. |
Throws
Name | Fault | Details |
---|
Name | Fault | Details |
---|---|---|
AccessDeniedException | client | You do not have sufficient access to perform this action. |
ConflictException | client | There is a conflict while performing this action. |
InternalServerException | server | The request has failed because of an unknown error, exception or failure. |
ResourceNotFoundException | client | The specified resource cannot be found. |
ServiceQuotaExceededException | client | The request has exceeded the specified service quota. |
ThrottlingException | client | The request was denied due to request throttling. |
ValidationException | client | The input fails to satisfy the constraints specified by the Amazon Web Services service. |
UnauthorizedException | client | You do not have permission to perform this action. |
DataZoneServiceException | Base exception class for all service exceptions from DataZone service. |