Documentation
¶
Index ¶
- type FlexTemplateJob
- func (*FlexTemplateJob) ElementType() reflect.Type
- func (i *FlexTemplateJob) ToFlexTemplateJobOutput() FlexTemplateJobOutput
- func (i *FlexTemplateJob) ToFlexTemplateJobOutputWithContext(ctx context.Context) FlexTemplateJobOutput
- func (i *FlexTemplateJob) ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput
- func (i *FlexTemplateJob) ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput
- type FlexTemplateJobArgs
- type FlexTemplateJobArray
- type FlexTemplateJobArrayInput
- type FlexTemplateJobArrayOutput
- func (FlexTemplateJobArrayOutput) ElementType() reflect.Type
- func (o FlexTemplateJobArrayOutput) Index(i pulumi.IntInput) FlexTemplateJobOutput
- func (o FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutput() FlexTemplateJobArrayOutput
- func (o FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutputWithContext(ctx context.Context) FlexTemplateJobArrayOutput
- type FlexTemplateJobInput
- type FlexTemplateJobMap
- type FlexTemplateJobMapInput
- type FlexTemplateJobMapOutput
- func (FlexTemplateJobMapOutput) ElementType() reflect.Type
- func (o FlexTemplateJobMapOutput) MapIndex(k pulumi.StringInput) FlexTemplateJobOutput
- func (o FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutput() FlexTemplateJobMapOutput
- func (o FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutputWithContext(ctx context.Context) FlexTemplateJobMapOutput
- type FlexTemplateJobOutput
- func (FlexTemplateJobOutput) ElementType() reflect.Type
- func (o FlexTemplateJobOutput) ToFlexTemplateJobOutput() FlexTemplateJobOutput
- func (o FlexTemplateJobOutput) ToFlexTemplateJobOutputWithContext(ctx context.Context) FlexTemplateJobOutput
- func (o FlexTemplateJobOutput) ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput
- func (o FlexTemplateJobOutput) ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput
- type FlexTemplateJobPtrInput
- type FlexTemplateJobPtrOutput
- type FlexTemplateJobState
- type Job
- type JobArgs
- type JobArray
- type JobArrayInput
- type JobArrayOutput
- type JobInput
- type JobMap
- type JobMapInput
- type JobMapOutput
- type JobOutput
- type JobPtrInput
- type JobPtrOutput
- type JobState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FlexTemplateJob ¶
type FlexTemplateJob struct { pulumi.CustomResourceState // The GCS path to the Dataflow job Flex // Template. ContainerSpecGcsPath pulumi.StringOutput `pulumi:"containerSpecGcsPath"` // The unique ID of this job. JobId pulumi.StringOutput `pulumi:"jobId"` // User labels to be specified for the job. Keys and values // should follow the restrictions specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) // page. **Note**: This field is marked as deprecated as the API does not currently // support adding labels. // **NOTE**: Google-provided Dataflow templates often provide default labels // that begin with `goog-dataflow-provided`. Unless explicitly set in config, these // labels will be ignored to prevent diffs on re-apply. // // Deprecated: Deprecated until the API supports this field Labels pulumi.MapOutput `pulumi:"labels"` // A unique name for the resource, required by Dataflow. Name pulumi.StringOutput `pulumi:"name"` // One of "drain" or "cancel". Specifies behavior of // deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrOutput `pulumi:"onDelete"` // Key/Value pairs to be passed to the Dataflow job (as // used in the template). Additional [pipeline options](https://cloud.google.com/dataflow/docs/guides/specifying-exec-params#setting-other-cloud-dataflow-pipeline-options) // such as `serviceAccount`, `workerMachineType`, etc can be specified here. Parameters pulumi.MapOutput `pulumi:"parameters"` // The project in which the resource belongs. If it is not // provided, the provider project is used. Project pulumi.StringOutput `pulumi:"project"` // The region in which the created job should run. Region pulumi.StringOutput `pulumi:"region"` // The current state of the resource, selected from the [JobState enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState) State pulumi.StringOutput `pulumi:"state"` }
Creates a [Flex Template](https://cloud.google.com/dataflow/docs/guides/templates/using-flex-templates) job on Dataflow, which is an implementation of Apache Beam running on Google Compute Engine. For more information see the official documentation for [Beam](https://beam.apache.org) and [Dataflow](https://cloud.google.com/dataflow/).
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/dataflow" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := dataflow.NewFlexTemplateJob(ctx, "bigDataJob", &dataflow.FlexTemplateJobArgs{ ContainerSpecGcsPath: pulumi.String("gs://my-bucket/templates/template.json"), Parameters: pulumi.StringMap{ "inputSubscription": pulumi.String("messages"), }, }, pulumi.Provider(google_beta)) if err != nil { return err } return nil }) }
``` ## Note on "destroy" / "apply"
There are many types of Dataflow jobs. Some Dataflow jobs run constantly, getting new data from (e.g.) a GCS bucket, and outputting data continuously. Some jobs process a set amount of data then terminate. All jobs can fail while running due to programming errors or other issues. In this way, Dataflow jobs are different from most other provider / Google resources.
The Dataflow resource is considered 'existing' while it is in a nonterminal state. If it reaches a terminal state (e.g. 'FAILED', 'COMPLETE', 'CANCELLED'), it will be recreated on the next 'apply'. This is as expected for jobs which run continuously, but may surprise users who use this resource for other kinds of Dataflow jobs.
A Dataflow job which is 'destroyed' may be "cancelled" or "drained". If "cancelled", the job terminates - any data written remains where it is, but no new data will be processed. If "drained", no new data will enter the pipeline, but any data currently in the pipeline will finish being processed. The default is "cancelled", but if a user sets `onDelete` to `"drain"` in the configuration, you may experience a long wait for your `pulumi destroy` to complete.
## Import
This resource does not support import.
func GetFlexTemplateJob ¶
func GetFlexTemplateJob(ctx *pulumi.Context, name string, id pulumi.IDInput, state *FlexTemplateJobState, opts ...pulumi.ResourceOption) (*FlexTemplateJob, error)
GetFlexTemplateJob gets an existing FlexTemplateJob resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewFlexTemplateJob ¶
func NewFlexTemplateJob(ctx *pulumi.Context, name string, args *FlexTemplateJobArgs, opts ...pulumi.ResourceOption) (*FlexTemplateJob, error)
NewFlexTemplateJob registers a new resource with the given unique name, arguments, and options.
func (*FlexTemplateJob) ElementType ¶ added in v4.4.0
func (*FlexTemplateJob) ElementType() reflect.Type
func (*FlexTemplateJob) ToFlexTemplateJobOutput ¶ added in v4.4.0
func (i *FlexTemplateJob) ToFlexTemplateJobOutput() FlexTemplateJobOutput
func (*FlexTemplateJob) ToFlexTemplateJobOutputWithContext ¶ added in v4.4.0
func (i *FlexTemplateJob) ToFlexTemplateJobOutputWithContext(ctx context.Context) FlexTemplateJobOutput
func (*FlexTemplateJob) ToFlexTemplateJobPtrOutput ¶ added in v4.11.1
func (i *FlexTemplateJob) ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput
func (*FlexTemplateJob) ToFlexTemplateJobPtrOutputWithContext ¶ added in v4.11.1
func (i *FlexTemplateJob) ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput
type FlexTemplateJobArgs ¶
type FlexTemplateJobArgs struct { // The GCS path to the Dataflow job Flex // Template. ContainerSpecGcsPath pulumi.StringInput // User labels to be specified for the job. Keys and values // should follow the restrictions specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) // page. **Note**: This field is marked as deprecated as the API does not currently // support adding labels. // **NOTE**: Google-provided Dataflow templates often provide default labels // that begin with `goog-dataflow-provided`. Unless explicitly set in config, these // labels will be ignored to prevent diffs on re-apply. // // Deprecated: Deprecated until the API supports this field Labels pulumi.MapInput // A unique name for the resource, required by Dataflow. Name pulumi.StringPtrInput // One of "drain" or "cancel". Specifies behavior of // deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrInput // Key/Value pairs to be passed to the Dataflow job (as // used in the template). Additional [pipeline options](https://cloud.google.com/dataflow/docs/guides/specifying-exec-params#setting-other-cloud-dataflow-pipeline-options) // such as `serviceAccount`, `workerMachineType`, etc can be specified here. Parameters pulumi.MapInput // The project in which the resource belongs. If it is not // provided, the provider project is used. Project pulumi.StringPtrInput // The region in which the created job should run. Region pulumi.StringPtrInput }
The set of arguments for constructing a FlexTemplateJob resource.
func (FlexTemplateJobArgs) ElementType ¶
func (FlexTemplateJobArgs) ElementType() reflect.Type
type FlexTemplateJobArray ¶ added in v4.11.1
type FlexTemplateJobArray []FlexTemplateJobInput
func (FlexTemplateJobArray) ElementType ¶ added in v4.11.1
func (FlexTemplateJobArray) ElementType() reflect.Type
func (FlexTemplateJobArray) ToFlexTemplateJobArrayOutput ¶ added in v4.11.1
func (i FlexTemplateJobArray) ToFlexTemplateJobArrayOutput() FlexTemplateJobArrayOutput
func (FlexTemplateJobArray) ToFlexTemplateJobArrayOutputWithContext ¶ added in v4.11.1
func (i FlexTemplateJobArray) ToFlexTemplateJobArrayOutputWithContext(ctx context.Context) FlexTemplateJobArrayOutput
type FlexTemplateJobArrayInput ¶ added in v4.11.1
type FlexTemplateJobArrayInput interface { pulumi.Input ToFlexTemplateJobArrayOutput() FlexTemplateJobArrayOutput ToFlexTemplateJobArrayOutputWithContext(context.Context) FlexTemplateJobArrayOutput }
FlexTemplateJobArrayInput is an input type that accepts FlexTemplateJobArray and FlexTemplateJobArrayOutput values. You can construct a concrete instance of `FlexTemplateJobArrayInput` via:
FlexTemplateJobArray{ FlexTemplateJobArgs{...} }
type FlexTemplateJobArrayOutput ¶ added in v4.11.1
type FlexTemplateJobArrayOutput struct{ *pulumi.OutputState }
func (FlexTemplateJobArrayOutput) ElementType ¶ added in v4.11.1
func (FlexTemplateJobArrayOutput) ElementType() reflect.Type
func (FlexTemplateJobArrayOutput) Index ¶ added in v4.11.1
func (o FlexTemplateJobArrayOutput) Index(i pulumi.IntInput) FlexTemplateJobOutput
func (FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutput ¶ added in v4.11.1
func (o FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutput() FlexTemplateJobArrayOutput
func (FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutputWithContext ¶ added in v4.11.1
func (o FlexTemplateJobArrayOutput) ToFlexTemplateJobArrayOutputWithContext(ctx context.Context) FlexTemplateJobArrayOutput
type FlexTemplateJobInput ¶ added in v4.4.0
type FlexTemplateJobInput interface { pulumi.Input ToFlexTemplateJobOutput() FlexTemplateJobOutput ToFlexTemplateJobOutputWithContext(ctx context.Context) FlexTemplateJobOutput }
type FlexTemplateJobMap ¶ added in v4.11.1
type FlexTemplateJobMap map[string]FlexTemplateJobInput
func (FlexTemplateJobMap) ElementType ¶ added in v4.11.1
func (FlexTemplateJobMap) ElementType() reflect.Type
func (FlexTemplateJobMap) ToFlexTemplateJobMapOutput ¶ added in v4.11.1
func (i FlexTemplateJobMap) ToFlexTemplateJobMapOutput() FlexTemplateJobMapOutput
func (FlexTemplateJobMap) ToFlexTemplateJobMapOutputWithContext ¶ added in v4.11.1
func (i FlexTemplateJobMap) ToFlexTemplateJobMapOutputWithContext(ctx context.Context) FlexTemplateJobMapOutput
type FlexTemplateJobMapInput ¶ added in v4.11.1
type FlexTemplateJobMapInput interface { pulumi.Input ToFlexTemplateJobMapOutput() FlexTemplateJobMapOutput ToFlexTemplateJobMapOutputWithContext(context.Context) FlexTemplateJobMapOutput }
FlexTemplateJobMapInput is an input type that accepts FlexTemplateJobMap and FlexTemplateJobMapOutput values. You can construct a concrete instance of `FlexTemplateJobMapInput` via:
FlexTemplateJobMap{ "key": FlexTemplateJobArgs{...} }
type FlexTemplateJobMapOutput ¶ added in v4.11.1
type FlexTemplateJobMapOutput struct{ *pulumi.OutputState }
func (FlexTemplateJobMapOutput) ElementType ¶ added in v4.11.1
func (FlexTemplateJobMapOutput) ElementType() reflect.Type
func (FlexTemplateJobMapOutput) MapIndex ¶ added in v4.11.1
func (o FlexTemplateJobMapOutput) MapIndex(k pulumi.StringInput) FlexTemplateJobOutput
func (FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutput ¶ added in v4.11.1
func (o FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutput() FlexTemplateJobMapOutput
func (FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutputWithContext ¶ added in v4.11.1
func (o FlexTemplateJobMapOutput) ToFlexTemplateJobMapOutputWithContext(ctx context.Context) FlexTemplateJobMapOutput
type FlexTemplateJobOutput ¶ added in v4.4.0
type FlexTemplateJobOutput struct {
*pulumi.OutputState
}
func (FlexTemplateJobOutput) ElementType ¶ added in v4.4.0
func (FlexTemplateJobOutput) ElementType() reflect.Type
func (FlexTemplateJobOutput) ToFlexTemplateJobOutput ¶ added in v4.4.0
func (o FlexTemplateJobOutput) ToFlexTemplateJobOutput() FlexTemplateJobOutput
func (FlexTemplateJobOutput) ToFlexTemplateJobOutputWithContext ¶ added in v4.4.0
func (o FlexTemplateJobOutput) ToFlexTemplateJobOutputWithContext(ctx context.Context) FlexTemplateJobOutput
func (FlexTemplateJobOutput) ToFlexTemplateJobPtrOutput ¶ added in v4.11.1
func (o FlexTemplateJobOutput) ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput
func (FlexTemplateJobOutput) ToFlexTemplateJobPtrOutputWithContext ¶ added in v4.11.1
func (o FlexTemplateJobOutput) ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput
type FlexTemplateJobPtrInput ¶ added in v4.11.1
type FlexTemplateJobPtrInput interface { pulumi.Input ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput }
type FlexTemplateJobPtrOutput ¶ added in v4.11.1
type FlexTemplateJobPtrOutput struct {
*pulumi.OutputState
}
func (FlexTemplateJobPtrOutput) ElementType ¶ added in v4.11.1
func (FlexTemplateJobPtrOutput) ElementType() reflect.Type
func (FlexTemplateJobPtrOutput) ToFlexTemplateJobPtrOutput ¶ added in v4.11.1
func (o FlexTemplateJobPtrOutput) ToFlexTemplateJobPtrOutput() FlexTemplateJobPtrOutput
func (FlexTemplateJobPtrOutput) ToFlexTemplateJobPtrOutputWithContext ¶ added in v4.11.1
func (o FlexTemplateJobPtrOutput) ToFlexTemplateJobPtrOutputWithContext(ctx context.Context) FlexTemplateJobPtrOutput
type FlexTemplateJobState ¶
type FlexTemplateJobState struct { // The GCS path to the Dataflow job Flex // Template. ContainerSpecGcsPath pulumi.StringPtrInput // The unique ID of this job. JobId pulumi.StringPtrInput // User labels to be specified for the job. Keys and values // should follow the restrictions specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) // page. **Note**: This field is marked as deprecated as the API does not currently // support adding labels. // **NOTE**: Google-provided Dataflow templates often provide default labels // that begin with `goog-dataflow-provided`. Unless explicitly set in config, these // labels will be ignored to prevent diffs on re-apply. // // Deprecated: Deprecated until the API supports this field Labels pulumi.MapInput // A unique name for the resource, required by Dataflow. Name pulumi.StringPtrInput // One of "drain" or "cancel". Specifies behavior of // deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrInput // Key/Value pairs to be passed to the Dataflow job (as // used in the template). Additional [pipeline options](https://cloud.google.com/dataflow/docs/guides/specifying-exec-params#setting-other-cloud-dataflow-pipeline-options) // such as `serviceAccount`, `workerMachineType`, etc can be specified here. Parameters pulumi.MapInput // The project in which the resource belongs. If it is not // provided, the provider project is used. Project pulumi.StringPtrInput // The region in which the created job should run. Region pulumi.StringPtrInput // The current state of the resource, selected from the [JobState enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState) State pulumi.StringPtrInput }
func (FlexTemplateJobState) ElementType ¶
func (FlexTemplateJobState) ElementType() reflect.Type
type Job ¶
type Job struct { pulumi.CustomResourceState // List of experiments that should be used by the job. An example value is `["enableStackdriverAgentMetrics"]`. AdditionalExperiments pulumi.StringArrayOutput `pulumi:"additionalExperiments"` // Enable/disable the use of [Streaming Engine](https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#streaming-engine) for the job. Note that Streaming Engine is enabled by default for pipelines developed against the Beam SDK for Python v2.21.0 or later when using Python 3. EnableStreamingEngine pulumi.BoolPtrOutput `pulumi:"enableStreamingEngine"` // The configuration for VM IPs. Options are `"WORKER_IP_PUBLIC"` or `"WORKER_IP_PRIVATE"`. IpConfiguration pulumi.StringPtrOutput `pulumi:"ipConfiguration"` // The unique ID of this job. JobId pulumi.StringOutput `pulumi:"jobId"` // The name for the Cloud KMS key for the job. Key format is: `projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY` KmsKeyName pulumi.StringPtrOutput `pulumi:"kmsKeyName"` // User labels to be specified for the job. Keys and values should follow the restrictions // specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) page. // **NOTE**: Google-provided Dataflow templates often provide default labels that begin with `goog-dataflow-provided`. // Unless explicitly set in config, these labels will be ignored to prevent diffs on re-apply. Labels pulumi.MapOutput `pulumi:"labels"` // The machine type to use for the job. MachineType pulumi.StringPtrOutput `pulumi:"machineType"` // The number of workers permitted to work on the job. More workers may improve processing speed at additional cost. MaxWorkers pulumi.IntPtrOutput `pulumi:"maxWorkers"` // A unique name for the resource, required by Dataflow. Name pulumi.StringOutput `pulumi:"name"` // The network to which VMs will be assigned. If it is not provided, "default" will be used. Network pulumi.StringPtrOutput `pulumi:"network"` // One of "drain" or "cancel". Specifies behavior of deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrOutput `pulumi:"onDelete"` // Key/Value pairs to be passed to the Dataflow job (as used in the template). Parameters pulumi.MapOutput `pulumi:"parameters"` // The project in which the resource belongs. If it is not provided, the provider project is used. Project pulumi.StringOutput `pulumi:"project"` // The region in which the created job should run. Region pulumi.StringPtrOutput `pulumi:"region"` // The Service Account email used to create the job. ServiceAccountEmail pulumi.StringPtrOutput `pulumi:"serviceAccountEmail"` // The current state of the resource, selected from the [JobState enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState) State pulumi.StringOutput `pulumi:"state"` // The subnetwork to which VMs will be assigned. Should be of the form "regions/REGION/subnetworks/SUBNETWORK". Subnetwork pulumi.StringPtrOutput `pulumi:"subnetwork"` // A writeable location on GCS for the Dataflow job to dump its temporary data. TempGcsLocation pulumi.StringOutput `pulumi:"tempGcsLocation"` // The GCS path to the Dataflow job template. TemplateGcsPath pulumi.StringOutput `pulumi:"templateGcsPath"` // Only applicable when updating a pipeline. Map of transform name prefixes of the job to be replaced with the corresponding name prefixes of the new job. This field is not used outside of update. TransformNameMapping pulumi.MapOutput `pulumi:"transformNameMapping"` // The type of this job, selected from the [JobType enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobType) Type pulumi.StringOutput `pulumi:"type"` // The zone in which the created job should run. If it is not provided, the provider zone is used. Zone pulumi.StringPtrOutput `pulumi:"zone"` }
Creates a job on Dataflow, which is an implementation of Apache Beam running on Google Compute Engine. For more information see the official documentation for [Beam](https://beam.apache.org) and [Dataflow](https://cloud.google.com/dataflow/).
## Example Usage
```go package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/dataflow" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { _, err := dataflow.NewJob(ctx, "bigDataJob", &dataflow.JobArgs{ Parameters: pulumi.StringMap{ "baz": pulumi.String("qux"), "foo": pulumi.String("bar"), }, TempGcsLocation: pulumi.String("gs://my-bucket/tmp_dir"), TemplateGcsPath: pulumi.String("gs://my-bucket/templates/template_file"), }) if err != nil { return err } return nil }) }
``` ### Streaming Job ```go package main
import (
"fmt" "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/dataflow" "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/pubsub" "github.com/pulumi/pulumi-gcp/sdk/v4/go/gcp/storage" "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)
func main() { pulumi.Run(func(ctx *pulumi.Context) error { topic, err := pubsub.NewTopic(ctx, "topic", nil) if err != nil { return err } bucket1, err := storage.NewBucket(ctx, "bucket1", &storage.BucketArgs{ ForceDestroy: pulumi.Bool(true), }) if err != nil { return err } _, err = storage.NewBucket(ctx, "bucket2", &storage.BucketArgs{ ForceDestroy: pulumi.Bool(true), }) if err != nil { return err } _, err = dataflow.NewJob(ctx, "pubsubStream", &dataflow.JobArgs{ TemplateGcsPath: pulumi.String("gs://my-bucket/templates/template_file"), TempGcsLocation: pulumi.String("gs://my-bucket/tmp_dir"), EnableStreamingEngine: pulumi.Bool(true), Parameters: pulumi.StringMap{ "inputFilePattern": bucket1.Url.ApplyT(func(url string) (string, error) { return fmt.Sprintf("%v%v", url, "/*.json"), nil }).(pulumi.StringOutput), "outputTopic": topic.ID(), }, TransformNameMapping: pulumi.StringMap{ "name": pulumi.String("test_job"), "env": pulumi.String("test"), }, OnDelete: pulumi.String("cancel"), }) if err != nil { return err } return nil }) }
``` ## Note on "destroy" / "apply"
There are many types of Dataflow jobs. Some Dataflow jobs run constantly, getting new data from (e.g.) a GCS bucket, and outputting data continuously. Some jobs process a set amount of data then terminate. All jobs can fail while running due to programming errors or other issues. In this way, Dataflow jobs are different from most other Google resources.
The Dataflow resource is considered 'existing' while it is in a nonterminal state. If it reaches a terminal state (e.g. 'FAILED', 'COMPLETE', 'CANCELLED'), it will be recreated on the next 'apply'. This is as expected for jobs which run continuously, but may surprise users who use this resource for other kinds of Dataflow jobs.
A Dataflow job which is 'destroyed' may be "cancelled" or "drained". If "cancelled", the job terminates - any data written remains where it is, but no new data will be processed. If "drained", no new data will enter the pipeline, but any data currently in the pipeline will finish being processed. The default is "cancelled", but if a user sets `onDelete` to `"drain"` in the configuration, you may experience a long wait for your `pulumi destroy` to complete.
## Import
This resource does not support import.
func GetJob ¶
func GetJob(ctx *pulumi.Context, name string, id pulumi.IDInput, state *JobState, opts ...pulumi.ResourceOption) (*Job, error)
GetJob gets an existing Job resource's state with the given name, ID, and optional state properties that are used to uniquely qualify the lookup (nil if not required).
func NewJob ¶
func NewJob(ctx *pulumi.Context, name string, args *JobArgs, opts ...pulumi.ResourceOption) (*Job, error)
NewJob registers a new resource with the given unique name, arguments, and options.
func (*Job) ElementType ¶ added in v4.4.0
func (*Job) ToJobOutput ¶ added in v4.4.0
func (*Job) ToJobOutputWithContext ¶ added in v4.4.0
func (*Job) ToJobPtrOutput ¶ added in v4.11.1
func (i *Job) ToJobPtrOutput() JobPtrOutput
func (*Job) ToJobPtrOutputWithContext ¶ added in v4.11.1
func (i *Job) ToJobPtrOutputWithContext(ctx context.Context) JobPtrOutput
type JobArgs ¶
type JobArgs struct { // List of experiments that should be used by the job. An example value is `["enableStackdriverAgentMetrics"]`. AdditionalExperiments pulumi.StringArrayInput // Enable/disable the use of [Streaming Engine](https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#streaming-engine) for the job. Note that Streaming Engine is enabled by default for pipelines developed against the Beam SDK for Python v2.21.0 or later when using Python 3. EnableStreamingEngine pulumi.BoolPtrInput // The configuration for VM IPs. Options are `"WORKER_IP_PUBLIC"` or `"WORKER_IP_PRIVATE"`. IpConfiguration pulumi.StringPtrInput // The name for the Cloud KMS key for the job. Key format is: `projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY` KmsKeyName pulumi.StringPtrInput // User labels to be specified for the job. Keys and values should follow the restrictions // specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) page. // **NOTE**: Google-provided Dataflow templates often provide default labels that begin with `goog-dataflow-provided`. // Unless explicitly set in config, these labels will be ignored to prevent diffs on re-apply. Labels pulumi.MapInput // The machine type to use for the job. MachineType pulumi.StringPtrInput // The number of workers permitted to work on the job. More workers may improve processing speed at additional cost. MaxWorkers pulumi.IntPtrInput // A unique name for the resource, required by Dataflow. Name pulumi.StringPtrInput // The network to which VMs will be assigned. If it is not provided, "default" will be used. Network pulumi.StringPtrInput // One of "drain" or "cancel". Specifies behavior of deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrInput // Key/Value pairs to be passed to the Dataflow job (as used in the template). Parameters pulumi.MapInput // The project in which the resource belongs. If it is not provided, the provider project is used. Project pulumi.StringPtrInput // The region in which the created job should run. Region pulumi.StringPtrInput // The Service Account email used to create the job. ServiceAccountEmail pulumi.StringPtrInput // The subnetwork to which VMs will be assigned. Should be of the form "regions/REGION/subnetworks/SUBNETWORK". Subnetwork pulumi.StringPtrInput // A writeable location on GCS for the Dataflow job to dump its temporary data. TempGcsLocation pulumi.StringInput // The GCS path to the Dataflow job template. TemplateGcsPath pulumi.StringInput // Only applicable when updating a pipeline. Map of transform name prefixes of the job to be replaced with the corresponding name prefixes of the new job. This field is not used outside of update. TransformNameMapping pulumi.MapInput // The zone in which the created job should run. If it is not provided, the provider zone is used. Zone pulumi.StringPtrInput }
The set of arguments for constructing a Job resource.
func (JobArgs) ElementType ¶
type JobArray ¶ added in v4.11.1
type JobArray []JobInput
func (JobArray) ElementType ¶ added in v4.11.1
func (JobArray) ToJobArrayOutput ¶ added in v4.11.1
func (i JobArray) ToJobArrayOutput() JobArrayOutput
func (JobArray) ToJobArrayOutputWithContext ¶ added in v4.11.1
func (i JobArray) ToJobArrayOutputWithContext(ctx context.Context) JobArrayOutput
type JobArrayInput ¶ added in v4.11.1
type JobArrayInput interface { pulumi.Input ToJobArrayOutput() JobArrayOutput ToJobArrayOutputWithContext(context.Context) JobArrayOutput }
JobArrayInput is an input type that accepts JobArray and JobArrayOutput values. You can construct a concrete instance of `JobArrayInput` via:
JobArray{ JobArgs{...} }
type JobArrayOutput ¶ added in v4.11.1
type JobArrayOutput struct{ *pulumi.OutputState }
func (JobArrayOutput) ElementType ¶ added in v4.11.1
func (JobArrayOutput) ElementType() reflect.Type
func (JobArrayOutput) Index ¶ added in v4.11.1
func (o JobArrayOutput) Index(i pulumi.IntInput) JobOutput
func (JobArrayOutput) ToJobArrayOutput ¶ added in v4.11.1
func (o JobArrayOutput) ToJobArrayOutput() JobArrayOutput
func (JobArrayOutput) ToJobArrayOutputWithContext ¶ added in v4.11.1
func (o JobArrayOutput) ToJobArrayOutputWithContext(ctx context.Context) JobArrayOutput
type JobMap ¶ added in v4.11.1
func (JobMap) ElementType ¶ added in v4.11.1
func (JobMap) ToJobMapOutput ¶ added in v4.11.1
func (i JobMap) ToJobMapOutput() JobMapOutput
func (JobMap) ToJobMapOutputWithContext ¶ added in v4.11.1
func (i JobMap) ToJobMapOutputWithContext(ctx context.Context) JobMapOutput
type JobMapInput ¶ added in v4.11.1
type JobMapInput interface { pulumi.Input ToJobMapOutput() JobMapOutput ToJobMapOutputWithContext(context.Context) JobMapOutput }
JobMapInput is an input type that accepts JobMap and JobMapOutput values. You can construct a concrete instance of `JobMapInput` via:
JobMap{ "key": JobArgs{...} }
type JobMapOutput ¶ added in v4.11.1
type JobMapOutput struct{ *pulumi.OutputState }
func (JobMapOutput) ElementType ¶ added in v4.11.1
func (JobMapOutput) ElementType() reflect.Type
func (JobMapOutput) MapIndex ¶ added in v4.11.1
func (o JobMapOutput) MapIndex(k pulumi.StringInput) JobOutput
func (JobMapOutput) ToJobMapOutput ¶ added in v4.11.1
func (o JobMapOutput) ToJobMapOutput() JobMapOutput
func (JobMapOutput) ToJobMapOutputWithContext ¶ added in v4.11.1
func (o JobMapOutput) ToJobMapOutputWithContext(ctx context.Context) JobMapOutput
type JobOutput ¶ added in v4.4.0
type JobOutput struct {
*pulumi.OutputState
}
func (JobOutput) ElementType ¶ added in v4.4.0
func (JobOutput) ToJobOutput ¶ added in v4.4.0
func (JobOutput) ToJobOutputWithContext ¶ added in v4.4.0
func (JobOutput) ToJobPtrOutput ¶ added in v4.11.1
func (o JobOutput) ToJobPtrOutput() JobPtrOutput
func (JobOutput) ToJobPtrOutputWithContext ¶ added in v4.11.1
func (o JobOutput) ToJobPtrOutputWithContext(ctx context.Context) JobPtrOutput
type JobPtrInput ¶ added in v4.11.1
type JobPtrInput interface { pulumi.Input ToJobPtrOutput() JobPtrOutput ToJobPtrOutputWithContext(ctx context.Context) JobPtrOutput }
type JobPtrOutput ¶ added in v4.11.1
type JobPtrOutput struct {
*pulumi.OutputState
}
func (JobPtrOutput) ElementType ¶ added in v4.11.1
func (JobPtrOutput) ElementType() reflect.Type
func (JobPtrOutput) ToJobPtrOutput ¶ added in v4.11.1
func (o JobPtrOutput) ToJobPtrOutput() JobPtrOutput
func (JobPtrOutput) ToJobPtrOutputWithContext ¶ added in v4.11.1
func (o JobPtrOutput) ToJobPtrOutputWithContext(ctx context.Context) JobPtrOutput
type JobState ¶
type JobState struct { // List of experiments that should be used by the job. An example value is `["enableStackdriverAgentMetrics"]`. AdditionalExperiments pulumi.StringArrayInput // Enable/disable the use of [Streaming Engine](https://cloud.google.com/dataflow/docs/guides/deploying-a-pipeline#streaming-engine) for the job. Note that Streaming Engine is enabled by default for pipelines developed against the Beam SDK for Python v2.21.0 or later when using Python 3. EnableStreamingEngine pulumi.BoolPtrInput // The configuration for VM IPs. Options are `"WORKER_IP_PUBLIC"` or `"WORKER_IP_PRIVATE"`. IpConfiguration pulumi.StringPtrInput // The unique ID of this job. JobId pulumi.StringPtrInput // The name for the Cloud KMS key for the job. Key format is: `projects/PROJECT_ID/locations/LOCATION/keyRings/KEY_RING/cryptoKeys/KEY` KmsKeyName pulumi.StringPtrInput // User labels to be specified for the job. Keys and values should follow the restrictions // specified in the [labeling restrictions](https://cloud.google.com/compute/docs/labeling-resources#restrictions) page. // **NOTE**: Google-provided Dataflow templates often provide default labels that begin with `goog-dataflow-provided`. // Unless explicitly set in config, these labels will be ignored to prevent diffs on re-apply. Labels pulumi.MapInput // The machine type to use for the job. MachineType pulumi.StringPtrInput // The number of workers permitted to work on the job. More workers may improve processing speed at additional cost. MaxWorkers pulumi.IntPtrInput // A unique name for the resource, required by Dataflow. Name pulumi.StringPtrInput // The network to which VMs will be assigned. If it is not provided, "default" will be used. Network pulumi.StringPtrInput // One of "drain" or "cancel". Specifies behavior of deletion during `pulumi destroy`. See above note. OnDelete pulumi.StringPtrInput // Key/Value pairs to be passed to the Dataflow job (as used in the template). Parameters pulumi.MapInput // The project in which the resource belongs. If it is not provided, the provider project is used. Project pulumi.StringPtrInput // The region in which the created job should run. Region pulumi.StringPtrInput // The Service Account email used to create the job. ServiceAccountEmail pulumi.StringPtrInput // The current state of the resource, selected from the [JobState enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobState) State pulumi.StringPtrInput // The subnetwork to which VMs will be assigned. Should be of the form "regions/REGION/subnetworks/SUBNETWORK". Subnetwork pulumi.StringPtrInput // A writeable location on GCS for the Dataflow job to dump its temporary data. TempGcsLocation pulumi.StringPtrInput // The GCS path to the Dataflow job template. TemplateGcsPath pulumi.StringPtrInput // Only applicable when updating a pipeline. Map of transform name prefixes of the job to be replaced with the corresponding name prefixes of the new job. This field is not used outside of update. TransformNameMapping pulumi.MapInput // The type of this job, selected from the [JobType enum](https://cloud.google.com/dataflow/docs/reference/rest/v1b3/projects.jobs#Job.JobType) Type pulumi.StringPtrInput // The zone in which the created job should run. If it is not provided, the provider zone is used. Zone pulumi.StringPtrInput }