UNPKG

@pulumi/gcp

Version:

A Pulumi package for creating and managing Google Cloud Platform resources.

502 lines (501 loc) • 17.1 kB
import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * Represents a user-visible job which provides the insights for the related data source. * * To get more information about Datascan, see: * * * [API documentation](https://cloud.google.com/dataplex/docs/reference/rest) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dataplex/docs) * * ## Example Usage * * ### Dataplex Datascan Basic Profile * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basicProfile = new gcp.dataplex.Datascan("basic_profile", { * location: "us-central1", * dataScanId: "dataprofile-basic", * data: { * resource: "//bigquery.googleapis.com/projects/bigquery-public-data/datasets/samples/tables/shakespeare", * }, * executionSpec: { * trigger: { * onDemand: {}, * }, * }, * dataProfileSpec: {}, * project: "my-project-name", * }); * ``` * ### Dataplex Datascan Full Profile * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const source = new gcp.bigquery.Dataset("source", { * datasetId: "dataplex_dataset", * friendlyName: "test", * description: "This is a test description", * location: "US", * deleteContentsOnDestroy: true, * }); * const fullProfile = new gcp.dataplex.Datascan("full_profile", { * location: "us-central1", * displayName: "Full Datascan Profile", * dataScanId: "dataprofile-full", * description: "Example resource - Full Datascan Profile", * labels: { * author: "billing", * }, * data: { * resource: "//bigquery.googleapis.com/projects/bigquery-public-data/datasets/samples/tables/shakespeare", * }, * executionSpec: { * trigger: { * schedule: { * cron: "TZ=America/New_York 1 1 * * *", * }, * }, * }, * dataProfileSpec: { * samplingPercent: 80, * rowFilter: "word_count > 10", * includeFields: { * fieldNames: ["word_count"], * }, * excludeFields: { * fieldNames: ["property_type"], * }, * postScanActions: { * bigqueryExport: { * resultsTable: "//bigquery.googleapis.com/projects/my-project-name/datasets/dataplex_dataset/tables/profile_export", * }, * }, * }, * project: "my-project-name", * }, { * dependsOn: [source], * }); * ``` * ### Dataplex Datascan Basic Quality * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const basicQuality = new gcp.dataplex.Datascan("basic_quality", { * location: "us-central1", * dataScanId: "dataquality-basic", * data: { * resource: "//bigquery.googleapis.com/projects/bigquery-public-data/datasets/samples/tables/shakespeare", * }, * executionSpec: { * trigger: { * onDemand: {}, * }, * }, * dataQualitySpec: { * rules: [{ * dimension: "VALIDITY", * name: "rule1", * description: "rule 1 for validity dimension", * tableConditionExpectation: { * sqlExpression: "COUNT(*) > 0", * }, * }], * }, * project: "my-project-name", * }); * ``` * ### Dataplex Datascan Full Quality * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const fullQuality = new gcp.dataplex.Datascan("full_quality", { * location: "us-central1", * displayName: "Full Datascan Quality", * dataScanId: "dataquality-full", * description: "Example resource - Full Datascan Quality", * labels: { * author: "billing", * }, * data: { * resource: "//bigquery.googleapis.com/projects/bigquery-public-data/datasets/austin_bikeshare/tables/bikeshare_stations", * }, * executionSpec: { * trigger: { * schedule: { * cron: "TZ=America/New_York 1 1 * * *", * }, * }, * field: "modified_date", * }, * dataQualitySpec: { * samplingPercent: 5, * rowFilter: "station_id > 1000", * rules: [ * { * column: "address", * dimension: "VALIDITY", * threshold: 0.99, * nonNullExpectation: {}, * }, * { * column: "council_district", * dimension: "VALIDITY", * ignoreNull: true, * threshold: 0.9, * rangeExpectation: { * minValue: "1", * maxValue: "10", * strictMinEnabled: true, * strictMaxEnabled: false, * }, * }, * { * column: "power_type", * dimension: "VALIDITY", * ignoreNull: false, * regexExpectation: { * regex: ".*solar.*", * }, * }, * { * column: "property_type", * dimension: "VALIDITY", * ignoreNull: false, * setExpectation: { * values: [ * "sidewalk", * "parkland", * ], * }, * }, * { * column: "address", * dimension: "UNIQUENESS", * uniquenessExpectation: {}, * }, * { * column: "number_of_docks", * dimension: "VALIDITY", * statisticRangeExpectation: { * statistic: "MEAN", * minValue: "5", * maxValue: "15", * strictMinEnabled: true, * strictMaxEnabled: true, * }, * }, * { * column: "footprint_length", * dimension: "VALIDITY", * rowConditionExpectation: { * sqlExpression: "footprint_length > 0 AND footprint_length <= 10", * }, * }, * { * dimension: "VALIDITY", * tableConditionExpectation: { * sqlExpression: "COUNT(*) > 0", * }, * }, * { * dimension: "VALIDITY", * sqlAssertion: { * sqlStatement: "select * from bigquery-public-data.austin_bikeshare.bikeshare_stations where station_id is null", * }, * }, * ], * }, * project: "my-project-name", * }); * ``` * * ## Import * * Datascan can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/dataScans/{{data_scan_id}}` * * * `{{project}}/{{location}}/{{data_scan_id}}` * * * `{{location}}/{{data_scan_id}}` * * * `{{data_scan_id}}` * * When using the `pulumi import` command, Datascan can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataplex/datascan:Datascan default projects/{{project}}/locations/{{location}}/dataScans/{{data_scan_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/datascan:Datascan default {{project}}/{{location}}/{{data_scan_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/datascan:Datascan default {{location}}/{{data_scan_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/datascan:Datascan default {{data_scan_id}} * ``` */ export declare class Datascan extends pulumi.CustomResource { /** * Get an existing Datascan resource's state with the given name, ID, and optional extra * properties used to qualify the lookup. * * @param name The _unique_ name of the resulting resource. * @param id The _unique_ provider ID of the resource to lookup. * @param state Any extra arguments used during the lookup. * @param opts Optional settings to control the behavior of the CustomResource. */ static get(name: string, id: pulumi.Input<pulumi.ID>, state?: DatascanState, opts?: pulumi.CustomResourceOptions): Datascan; /** * Returns true if the given object is an instance of Datascan. This is designed to work even * when multiple copies of the Pulumi SDK have been loaded into the same process. */ static isInstance(obj: any): obj is Datascan; /** * The time when the scan was created. */ readonly createTime: pulumi.Output<string>; /** * The data source for DataScan. * Structure is documented below. */ readonly data: pulumi.Output<outputs.dataplex.DatascanData>; /** * DataProfileScan related setting. */ readonly dataProfileSpec: pulumi.Output<outputs.dataplex.DatascanDataProfileSpec | undefined>; /** * DataQualityScan related setting. */ readonly dataQualitySpec: pulumi.Output<outputs.dataplex.DatascanDataQualitySpec | undefined>; /** * DataScan identifier. Must contain only lowercase letters, numbers and hyphens. Must start with a letter. Must end with a number or a letter. */ readonly dataScanId: pulumi.Output<string>; /** * Description of the scan. */ readonly description: pulumi.Output<string | undefined>; /** * User friendly display name. */ readonly displayName: pulumi.Output<string | undefined>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ readonly effectiveLabels: pulumi.Output<{ [key: string]: string; }>; /** * DataScan execution settings. * Structure is documented below. */ readonly executionSpec: pulumi.Output<outputs.dataplex.DatascanExecutionSpec>; /** * Status of the data scan execution. * Structure is documented below. */ readonly executionStatuses: pulumi.Output<outputs.dataplex.DatascanExecutionStatus[]>; /** * User-defined labels for the scan. A list of key->value pairs. **Note**: This field is non-authoritative, and will only * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels * present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The location where the data scan should reside. */ readonly location: pulumi.Output<string>; /** * The relative resource name of the scan, of the form: projects/{project}/locations/{locationId}/dataScans/{datascan_id}, where project refers to a projectId or projectNumber and locationId refers to a GCP region. */ readonly name: pulumi.Output<string>; readonly project: pulumi.Output<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * Current state of the DataScan. */ readonly state: pulumi.Output<string>; /** * The type of DataScan. */ readonly type: pulumi.Output<string>; /** * System generated globally unique ID for the scan. This ID will be different if the scan is deleted and re-created with the same name. */ readonly uid: pulumi.Output<string>; /** * The time when the scan was last updated. */ readonly updateTime: pulumi.Output<string>; /** * Create a Datascan resource with the given unique name, arguments, and options. * * @param name The _unique_ name of the resource. * @param args The arguments to use to populate this resource's properties. * @param opts A bag of options that control this resource's behavior. */ constructor(name: string, args: DatascanArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Datascan resources. */ export interface DatascanState { /** * The time when the scan was created. */ createTime?: pulumi.Input<string>; /** * The data source for DataScan. * Structure is documented below. */ data?: pulumi.Input<inputs.dataplex.DatascanData>; /** * DataProfileScan related setting. */ dataProfileSpec?: pulumi.Input<inputs.dataplex.DatascanDataProfileSpec>; /** * DataQualityScan related setting. */ dataQualitySpec?: pulumi.Input<inputs.dataplex.DatascanDataQualitySpec>; /** * DataScan identifier. Must contain only lowercase letters, numbers and hyphens. Must start with a letter. Must end with a number or a letter. */ dataScanId?: pulumi.Input<string>; /** * Description of the scan. */ description?: pulumi.Input<string>; /** * User friendly display name. */ displayName?: pulumi.Input<string>; /** * All of labels (key/value pairs) present on the resource in GCP, including the labels configured through Pulumi, other clients and services. */ effectiveLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * DataScan execution settings. * Structure is documented below. */ executionSpec?: pulumi.Input<inputs.dataplex.DatascanExecutionSpec>; /** * Status of the data scan execution. * Structure is documented below. */ executionStatuses?: pulumi.Input<pulumi.Input<inputs.dataplex.DatascanExecutionStatus>[]>; /** * User-defined labels for the scan. A list of key->value pairs. **Note**: This field is non-authoritative, and will only * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels * present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The location where the data scan should reside. */ location?: pulumi.Input<string>; /** * The relative resource name of the scan, of the form: projects/{project}/locations/{locationId}/dataScans/{datascan_id}, where project refers to a projectId or projectNumber and locationId refers to a GCP region. */ name?: pulumi.Input<string>; project?: pulumi.Input<string>; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * Current state of the DataScan. */ state?: pulumi.Input<string>; /** * The type of DataScan. */ type?: pulumi.Input<string>; /** * System generated globally unique ID for the scan. This ID will be different if the scan is deleted and re-created with the same name. */ uid?: pulumi.Input<string>; /** * The time when the scan was last updated. */ updateTime?: pulumi.Input<string>; } /** * The set of arguments for constructing a Datascan resource. */ export interface DatascanArgs { /** * The data source for DataScan. * Structure is documented below. */ data: pulumi.Input<inputs.dataplex.DatascanData>; /** * DataProfileScan related setting. */ dataProfileSpec?: pulumi.Input<inputs.dataplex.DatascanDataProfileSpec>; /** * DataQualityScan related setting. */ dataQualitySpec?: pulumi.Input<inputs.dataplex.DatascanDataQualitySpec>; /** * DataScan identifier. Must contain only lowercase letters, numbers and hyphens. Must start with a letter. Must end with a number or a letter. */ dataScanId: pulumi.Input<string>; /** * Description of the scan. */ description?: pulumi.Input<string>; /** * User friendly display name. */ displayName?: pulumi.Input<string>; /** * DataScan execution settings. * Structure is documented below. */ executionSpec: pulumi.Input<inputs.dataplex.DatascanExecutionSpec>; /** * User-defined labels for the scan. A list of key->value pairs. **Note**: This field is non-authoritative, and will only * manage the labels present in your configuration. Please refer to the field 'effective_labels' for all of the labels * present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input<string>; }>; /** * The location where the data scan should reside. */ location: pulumi.Input<string>; project?: pulumi.Input<string>; }