import * as pulumi from "@pulumi/pulumi"; import * as inputs from "../types/input"; import * as outputs from "../types/output"; /** * A Dataplex task represents the work that you want Dataplex to do on a schedule. It encapsulates code, parameters, and the schedule. * * To get more information about Task, see: * * * [API documentation](https://cloud.google.com/dataplex/docs/reference/rest/v1/projects.locations.lakes.tasks) * * How-to Guides * * [Official Documentation](https://cloud.google.com/dataplex/docs) * * ## Example Usage * * ### Dataplex Task Basic * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * const project = gcp.organizations.getProject({}); * const example = new gcp.dataplex.Lake("example", { * name: "tf-test-lake_56529", * location: "us-central1", * project: "my-project-name", * }); * const exampleTask = new gcp.dataplex.Task("example", { * taskId: "tf-test-task_75413", * location: "us-central1", * lake: example.name, * description: "Test Task Basic", * displayName: "task-basic", * labels: { * count: "3", * }, * triggerSpec: { * type: "RECURRING", * disabled: false, * maxRetries: 3, * startTime: "2023-10-02T15:01:23Z", * schedule: "1 * * * *", * }, * executionSpec: { * serviceAccount: project.then(project => `${project.number}-compute@developer.gserviceaccount.com`), * project: "my-project-name", * maxJobExecutionLifetime: "100s", * kmsKey: "234jn2kjn42k3n423", * }, * spark: { * pythonScriptFile: "gs://dataproc-examples/pyspark/hello-world/hello-world.py", * }, * project: "my-project-name", * }); * ``` * ### Dataplex Task Spark * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * // VPC network * const _default = new gcp.compute.Network("default", { * name: "tf-test-workstation-cluster_55138", * autoCreateSubnetworks: true, * }); * const project = gcp.organizations.getProject({}); * const exampleSpark = new gcp.dataplex.Lake("example_spark", { * name: "tf-test-lake_37559", * location: "us-central1", * project: "my-project-name", * }); * const exampleSparkTask = new gcp.dataplex.Task("example_spark", { * taskId: "tf-test-task_91980", * location: "us-central1", * lake: exampleSpark.name, * triggerSpec: { * type: "ON_DEMAND", * }, * description: "task-spark-terraform", * executionSpec: { * serviceAccount: project.then(project => `${project.number}-compute@developer.gserviceaccount.com`), * args: { * TASK_ARGS: "--output_location,gs://spark-job/task-result, --output_format, json", * }, * }, * spark: { * infrastructureSpec: { * batch: { * executorsCount: 2, * maxExecutorsCount: 100, * }, * containerImage: { * image: "test-image", * javaJars: ["test-java-jars.jar"], * pythonPackages: ["gs://bucket-name/my/path/to/lib.tar.gz"], * properties: { * name: "wrench", * mass: "1.3kg", * count: "3", * }, * }, * vpcNetwork: { * networkTags: ["test-network-tag"], * subNetwork: _default.id, * }, * }, * fileUris: ["gs://terrafrom-test/test.csv"], * archiveUris: ["gs://terraform-test/test.csv"], * sqlScript: "show databases", * }, * project: "my-project-name", * }); * ``` * ### Dataplex Task Notebook * * ```typescript * import * as pulumi from "@pulumi/pulumi"; * import * as gcp from "@pulumi/gcp"; * * // VPC network * const _default = new gcp.compute.Network("default", { * name: "tf-test-workstation-cluster_37118", * autoCreateSubnetworks: true, * }); * const project = gcp.organizations.getProject({}); * const exampleNotebook = new gcp.dataplex.Lake("example_notebook", { * name: "tf-test-lake_80332", * location: "us-central1", * project: "my-project-name", * }); * const exampleNotebookTask = new gcp.dataplex.Task("example_notebook", { * taskId: "tf-test-task_13293", * location: "us-central1", * lake: exampleNotebook.name, * triggerSpec: { * type: "RECURRING", * schedule: "1 * * * *", * }, * executionSpec: { * serviceAccount: project.then(project => `${project.number}-compute@developer.gserviceaccount.com`), * args: { * TASK_ARGS: "--output_location,gs://spark-job-jars-anrajitha/task-result, --output_format, json", * }, * }, * notebook: { * notebook: "gs://terraform-test/test-notebook.ipynb", * infrastructureSpec: { * batch: { * executorsCount: 2, * maxExecutorsCount: 100, * }, * containerImage: { * image: "test-image", * javaJars: ["test-java-jars.jar"], * pythonPackages: ["gs://bucket-name/my/path/to/lib.tar.gz"], * properties: { * name: "wrench", * mass: "1.3kg", * count: "3", * }, * }, * vpcNetwork: { * networkTags: ["test-network-tag"], * network: _default.id, * }, * }, * fileUris: ["gs://terraform-test/test.csv"], * archiveUris: ["gs://terraform-test/test.csv"], * }, * project: "my-project-name", * }); * ``` * * ## Import * * Task can be imported using any of these accepted formats: * * * `projects/{{project}}/locations/{{location}}/lakes/{{lake}}/tasks/{{task_id}}` * * * `{{project}}/{{location}}/{{lake}}/{{task_id}}` * * * `{{location}}/{{lake}}/{{task_id}}` * * When using the `pulumi import` command, Task can be imported using one of the formats above. For example: * * ```sh * $ pulumi import gcp:dataplex/task:Task default projects/{{project}}/locations/{{location}}/lakes/{{lake}}/tasks/{{task_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/task:Task default {{project}}/{{location}}/{{lake}}/{{task_id}} * ``` * * ```sh * $ pulumi import gcp:dataplex/task:Task default {{location}}/{{lake}}/{{task_id}} * ``` */ export declare class Task extends pulumi.CustomResource { /** * Get an existing Task 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, state?: TaskState, opts?: pulumi.CustomResourceOptions): Task; /** * Returns true if the given object is an instance of Task. 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 Task; /** * The time when the task was created. */ readonly createTime: pulumi.Output; /** * User-provided description of the task. */ readonly description: pulumi.Output; /** * User friendly display name. */ readonly displayName: pulumi.Output; /** * 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; }>; /** * Configuration for the cluster * Structure is documented below. */ readonly executionSpec: pulumi.Output; /** * Configuration for the cluster * Structure is documented below. */ readonly executionStatuses: pulumi.Output; /** * User-defined labels for the task. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ readonly labels: pulumi.Output<{ [key: string]: string; } | undefined>; /** * The lake in which the task will be created in. */ readonly lake: pulumi.Output; /** * The location in which the task will be created in. */ readonly location: pulumi.Output; /** * (Output) * The relative resource name of the job, of the form: projects/{project_number}/locations/{locationId}/lakes/{lakeId}/tasks/{taskId}/jobs/{jobId}. */ readonly name: pulumi.Output; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ readonly notebook: pulumi.Output; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ readonly project: pulumi.Output; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ readonly pulumiLabels: pulumi.Output<{ [key: string]: string; }>; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ readonly spark: pulumi.Output; /** * (Output) * Execution state for the job. */ readonly state: pulumi.Output; /** * The task Id of the task. */ readonly taskId: pulumi.Output; /** * Configuration for the cluster * Structure is documented below. */ readonly triggerSpec: pulumi.Output; /** * (Output) * System generated globally unique ID for the job. */ readonly uid: pulumi.Output; /** * (Output) * Last update time of the status. */ readonly updateTime: pulumi.Output; /** * Create a Task 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: TaskArgs, opts?: pulumi.CustomResourceOptions); } /** * Input properties used for looking up and filtering Task resources. */ export interface TaskState { /** * The time when the task was created. */ createTime?: pulumi.Input; /** * User-provided description of the task. */ description?: pulumi.Input; /** * User friendly display name. */ displayName?: pulumi.Input; /** * 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; }>; /** * Configuration for the cluster * Structure is documented below. */ executionSpec?: pulumi.Input; /** * Configuration for the cluster * Structure is documented below. */ executionStatuses?: pulumi.Input[]>; /** * User-defined labels for the task. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The lake in which the task will be created in. */ lake?: pulumi.Input; /** * The location in which the task will be created in. */ location?: pulumi.Input; /** * (Output) * The relative resource name of the job, of the form: projects/{project_number}/locations/{locationId}/lakes/{lakeId}/tasks/{taskId}/jobs/{jobId}. */ name?: pulumi.Input; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ notebook?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * The combination of labels configured directly on the resource * and default labels configured on the provider. */ pulumiLabels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ spark?: pulumi.Input; /** * (Output) * Execution state for the job. */ state?: pulumi.Input; /** * The task Id of the task. */ taskId?: pulumi.Input; /** * Configuration for the cluster * Structure is documented below. */ triggerSpec?: pulumi.Input; /** * (Output) * System generated globally unique ID for the job. */ uid?: pulumi.Input; /** * (Output) * Last update time of the status. */ updateTime?: pulumi.Input; } /** * The set of arguments for constructing a Task resource. */ export interface TaskArgs { /** * User-provided description of the task. */ description?: pulumi.Input; /** * User friendly display name. */ displayName?: pulumi.Input; /** * Configuration for the cluster * Structure is documented below. */ executionSpec: pulumi.Input; /** * User-defined labels for the task. * * **Note**: This field is non-authoritative, and will only manage the labels present in your configuration. * Please refer to the field `effectiveLabels` for all of the labels present on the resource. */ labels?: pulumi.Input<{ [key: string]: pulumi.Input; }>; /** * The lake in which the task will be created in. */ lake?: pulumi.Input; /** * The location in which the task will be created in. */ location?: pulumi.Input; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ notebook?: pulumi.Input; /** * The ID of the project in which the resource belongs. * If it is not provided, the provider project is used. */ project?: pulumi.Input; /** * A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of its memory over time. * Structure is documented below. */ spark?: pulumi.Input; /** * The task Id of the task. */ taskId?: pulumi.Input; /** * Configuration for the cluster * Structure is documented below. */ triggerSpec: pulumi.Input; }