@pulumi/gcp
Version:
A Pulumi package for creating and managing Google Cloud Platform resources.
461 lines (460 loc) • 15.9 kB
TypeScript
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_72490",
* location: "us-central1",
* project: "my-project-name",
* });
* const exampleTask = new gcp.dataplex.Task("example", {
* taskId: "tf-test-task_89605",
* 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_56730",
* autoCreateSubnetworks: true,
* });
* const project = gcp.organizations.getProject({});
* const exampleSpark = new gcp.dataplex.Lake("example_spark", {
* name: "tf-test-lake_95154",
* location: "us-central1",
* project: "my-project-name",
* });
* const exampleSparkTask = new gcp.dataplex.Task("example_spark", {
* taskId: "tf-test-task_64336",
* 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_34962",
* autoCreateSubnetworks: true,
* });
* const project = gcp.organizations.getProject({});
* const exampleNotebook = new gcp.dataplex.Lake("example_notebook", {
* name: "tf-test-lake_74000",
* location: "us-central1",
* project: "my-project-name",
* });
* const exampleNotebookTask = new gcp.dataplex.Task("example_notebook", {
* taskId: "tf-test-task_75125",
* 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<pulumi.ID>, 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<string>;
/**
* User-provided description of the task.
*/
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;
}>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
readonly executionSpec: pulumi.Output<outputs.dataplex.TaskExecutionSpec>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
readonly executionStatuses: pulumi.Output<outputs.dataplex.TaskExecutionStatus[]>;
/**
* 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 'effective_labels' 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<string | undefined>;
/**
* The location in which the task will be created in.
*/
readonly location: pulumi.Output<string | undefined>;
/**
* (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<string>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
readonly notebook: pulumi.Output<outputs.dataplex.TaskNotebook | undefined>;
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;
}>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
readonly spark: pulumi.Output<outputs.dataplex.TaskSpark | undefined>;
/**
* (Output)
* Execution state for the job.
*/
readonly state: pulumi.Output<string>;
/**
* The task Id of the task.
*/
readonly taskId: pulumi.Output<string | undefined>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
readonly triggerSpec: pulumi.Output<outputs.dataplex.TaskTriggerSpec>;
/**
* (Output)
* System generated globally unique ID for the job.
*/
readonly uid: pulumi.Output<string>;
/**
* (Output)
* Last update time of the status.
*/
readonly updateTime: pulumi.Output<string>;
/**
* 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<string>;
/**
* User-provided description of the task.
*/
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>;
}>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
executionSpec?: pulumi.Input<inputs.dataplex.TaskExecutionSpec>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
executionStatuses?: pulumi.Input<pulumi.Input<inputs.dataplex.TaskExecutionStatus>[]>;
/**
* 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 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The lake in which the task will be created in.
*/
lake?: pulumi.Input<string>;
/**
* The location in which the task will be created in.
*/
location?: pulumi.Input<string>;
/**
* (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<string>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
notebook?: pulumi.Input<inputs.dataplex.TaskNotebook>;
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>;
}>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
spark?: pulumi.Input<inputs.dataplex.TaskSpark>;
/**
* (Output)
* Execution state for the job.
*/
state?: pulumi.Input<string>;
/**
* The task Id of the task.
*/
taskId?: pulumi.Input<string>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
triggerSpec?: pulumi.Input<inputs.dataplex.TaskTriggerSpec>;
/**
* (Output)
* System generated globally unique ID for the job.
*/
uid?: pulumi.Input<string>;
/**
* (Output)
* Last update time of the status.
*/
updateTime?: pulumi.Input<string>;
}
/**
* The set of arguments for constructing a Task resource.
*/
export interface TaskArgs {
/**
* User-provided description of the task.
*/
description?: pulumi.Input<string>;
/**
* User friendly display name.
*/
displayName?: pulumi.Input<string>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
executionSpec: pulumi.Input<inputs.dataplex.TaskExecutionSpec>;
/**
* 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 'effective_labels' for all of the labels present on the resource.
*/
labels?: pulumi.Input<{
[key: string]: pulumi.Input<string>;
}>;
/**
* The lake in which the task will be created in.
*/
lake?: pulumi.Input<string>;
/**
* The location in which the task will be created in.
*/
location?: pulumi.Input<string>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
notebook?: pulumi.Input<inputs.dataplex.TaskNotebook>;
project?: pulumi.Input<string>;
/**
* A service with manual scaling runs continuously, allowing you to perform complex initialization and rely on the state of
* its memory over time.
*/
spark?: pulumi.Input<inputs.dataplex.TaskSpark>;
/**
* The task Id of the task.
*/
taskId?: pulumi.Input<string>;
/**
* Configuration for the cluster
* Structure is documented below.
*/
triggerSpec: pulumi.Input<inputs.dataplex.TaskTriggerSpec>;
}