1. Packages
  2. Google Cloud (GCP) Classic
  3. API Docs
  4. storage
  5. BatchOperationsJob
Google Cloud v8.29.0 published on Thursday, May 1, 2025 by Pulumi

gcp.storage.BatchOperationsJob

Explore with Pulumi AI

gcp logo
Google Cloud v8.29.0 published on Thursday, May 1, 2025 by Pulumi

    Storage Batch Operations (SBO) is a Cloud Storage management feature that offers a seamless experience to perform single batch operations on millions of GCS objects in a serverless manner.

    Example Usage

    Storage Batch Operations

    import * as pulumi from "@pulumi/pulumi";
    import * as gcp from "@pulumi/gcp";
    
    const bucket = new gcp.storage.Bucket("bucket", {
        name: "tf-sample-bucket",
        location: "us-central1",
        forceDestroy: true,
    });
    const tf_job = new gcp.storage.BatchOperationsJob("tf-job", {
        jobId: "tf-job",
        bucketList: {
            buckets: {
                bucket: bucket.name,
                prefixList: {
                    includedObjectPrefixes: ["bkt"],
                },
            },
        },
        putMetadata: {
            customMetadata: {
                key: "value",
            },
        },
        deleteProtection: false,
    });
    
    import pulumi
    import pulumi_gcp as gcp
    
    bucket = gcp.storage.Bucket("bucket",
        name="tf-sample-bucket",
        location="us-central1",
        force_destroy=True)
    tf_job = gcp.storage.BatchOperationsJob("tf-job",
        job_id="tf-job",
        bucket_list={
            "buckets": {
                "bucket": bucket.name,
                "prefix_list": {
                    "included_object_prefixes": ["bkt"],
                },
            },
        },
        put_metadata={
            "custom_metadata": {
                "key": "value",
            },
        },
        delete_protection=False)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/storage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		bucket, err := storage.NewBucket(ctx, "bucket", &storage.BucketArgs{
    			Name:         pulumi.String("tf-sample-bucket"),
    			Location:     pulumi.String("us-central1"),
    			ForceDestroy: pulumi.Bool(true),
    		})
    		if err != nil {
    			return err
    		}
    		_, err = storage.NewBatchOperationsJob(ctx, "tf-job", &storage.BatchOperationsJobArgs{
    			JobId: pulumi.String("tf-job"),
    			BucketList: &storage.BatchOperationsJobBucketListArgs{
    				Buckets: &storage.BatchOperationsJobBucketListBucketsArgs{
    					Bucket: bucket.Name,
    					PrefixList: &storage.BatchOperationsJobBucketListBucketsPrefixListArgs{
    						IncludedObjectPrefixes: pulumi.StringArray{
    							pulumi.String("bkt"),
    						},
    					},
    				},
    			},
    			PutMetadata: &storage.BatchOperationsJobPutMetadataArgs{
    				CustomMetadata: pulumi.StringMap{
    					"key": pulumi.String("value"),
    				},
    			},
    			DeleteProtection: pulumi.Bool(false),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Gcp = Pulumi.Gcp;
    
    return await Deployment.RunAsync(() => 
    {
        var bucket = new Gcp.Storage.Bucket("bucket", new()
        {
            Name = "tf-sample-bucket",
            Location = "us-central1",
            ForceDestroy = true,
        });
    
        var tf_job = new Gcp.Storage.BatchOperationsJob("tf-job", new()
        {
            JobId = "tf-job",
            BucketList = new Gcp.Storage.Inputs.BatchOperationsJobBucketListArgs
            {
                Buckets = new Gcp.Storage.Inputs.BatchOperationsJobBucketListBucketsArgs
                {
                    Bucket = bucket.Name,
                    PrefixList = new Gcp.Storage.Inputs.BatchOperationsJobBucketListBucketsPrefixListArgs
                    {
                        IncludedObjectPrefixes = new[]
                        {
                            "bkt",
                        },
                    },
                },
            },
            PutMetadata = new Gcp.Storage.Inputs.BatchOperationsJobPutMetadataArgs
            {
                CustomMetadata = 
                {
                    { "key", "value" },
                },
            },
            DeleteProtection = false,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.gcp.storage.Bucket;
    import com.pulumi.gcp.storage.BucketArgs;
    import com.pulumi.gcp.storage.BatchOperationsJob;
    import com.pulumi.gcp.storage.BatchOperationsJobArgs;
    import com.pulumi.gcp.storage.inputs.BatchOperationsJobBucketListArgs;
    import com.pulumi.gcp.storage.inputs.BatchOperationsJobBucketListBucketsArgs;
    import com.pulumi.gcp.storage.inputs.BatchOperationsJobBucketListBucketsPrefixListArgs;
    import com.pulumi.gcp.storage.inputs.BatchOperationsJobPutMetadataArgs;
    import java.util.List;
    import java.util.ArrayList;
    import java.util.Map;
    import java.io.File;
    import java.nio.file.Files;
    import java.nio.file.Paths;
    
    public class App {
        public static void main(String[] args) {
            Pulumi.run(App::stack);
        }
    
        public static void stack(Context ctx) {
            var bucket = new Bucket("bucket", BucketArgs.builder()
                .name("tf-sample-bucket")
                .location("us-central1")
                .forceDestroy(true)
                .build());
    
            var tf_job = new BatchOperationsJob("tf-job", BatchOperationsJobArgs.builder()
                .jobId("tf-job")
                .bucketList(BatchOperationsJobBucketListArgs.builder()
                    .buckets(BatchOperationsJobBucketListBucketsArgs.builder()
                        .bucket(bucket.name())
                        .prefixList(BatchOperationsJobBucketListBucketsPrefixListArgs.builder()
                            .includedObjectPrefixes("bkt")
                            .build())
                        .build())
                    .build())
                .putMetadata(BatchOperationsJobPutMetadataArgs.builder()
                    .customMetadata(Map.of("key", "value"))
                    .build())
                .deleteProtection(false)
                .build());
    
        }
    }
    
    resources:
      bucket:
        type: gcp:storage:Bucket
        properties:
          name: tf-sample-bucket
          location: us-central1
          forceDestroy: true
      tf-job:
        type: gcp:storage:BatchOperationsJob
        properties:
          jobId: tf-job
          bucketList:
            buckets:
              bucket: ${bucket.name}
              prefixList:
                includedObjectPrefixes:
                  - bkt
          putMetadata:
            customMetadata:
              key: value
          deleteProtection: false
    

    Create BatchOperationsJob Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new BatchOperationsJob(name: string, args?: BatchOperationsJobArgs, opts?: CustomResourceOptions);
    @overload
    def BatchOperationsJob(resource_name: str,
                           args: Optional[BatchOperationsJobArgs] = None,
                           opts: Optional[ResourceOptions] = None)
    
    @overload
    def BatchOperationsJob(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           bucket_list: Optional[BatchOperationsJobBucketListArgs] = None,
                           delete_object: Optional[BatchOperationsJobDeleteObjectArgs] = None,
                           delete_protection: Optional[bool] = None,
                           job_id: Optional[str] = None,
                           project: Optional[str] = None,
                           put_metadata: Optional[BatchOperationsJobPutMetadataArgs] = None,
                           put_object_hold: Optional[BatchOperationsJobPutObjectHoldArgs] = None,
                           rewrite_object: Optional[BatchOperationsJobRewriteObjectArgs] = None)
    func NewBatchOperationsJob(ctx *Context, name string, args *BatchOperationsJobArgs, opts ...ResourceOption) (*BatchOperationsJob, error)
    public BatchOperationsJob(string name, BatchOperationsJobArgs? args = null, CustomResourceOptions? opts = null)
    public BatchOperationsJob(String name, BatchOperationsJobArgs args)
    public BatchOperationsJob(String name, BatchOperationsJobArgs args, CustomResourceOptions options)
    
    type: gcp:storage:BatchOperationsJob
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args BatchOperationsJobArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args BatchOperationsJobArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args BatchOperationsJobArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BatchOperationsJobArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BatchOperationsJobArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var batchOperationsJobResource = new Gcp.Storage.BatchOperationsJob("batchOperationsJobResource", new()
    {
        BucketList = new Gcp.Storage.Inputs.BatchOperationsJobBucketListArgs
        {
            Buckets = new Gcp.Storage.Inputs.BatchOperationsJobBucketListBucketsArgs
            {
                Bucket = "string",
                Manifest = new Gcp.Storage.Inputs.BatchOperationsJobBucketListBucketsManifestArgs
                {
                    ManifestLocation = "string",
                },
                PrefixList = new Gcp.Storage.Inputs.BatchOperationsJobBucketListBucketsPrefixListArgs
                {
                    IncludedObjectPrefixes = new[]
                    {
                        "string",
                    },
                },
            },
        },
        DeleteObject = new Gcp.Storage.Inputs.BatchOperationsJobDeleteObjectArgs
        {
            PermanentObjectDeletionEnabled = false,
        },
        DeleteProtection = false,
        JobId = "string",
        Project = "string",
        PutMetadata = new Gcp.Storage.Inputs.BatchOperationsJobPutMetadataArgs
        {
            CacheControl = "string",
            ContentDisposition = "string",
            ContentEncoding = "string",
            ContentLanguage = "string",
            ContentType = "string",
            CustomMetadata = 
            {
                { "string", "string" },
            },
            CustomTime = "string",
        },
        PutObjectHold = new Gcp.Storage.Inputs.BatchOperationsJobPutObjectHoldArgs
        {
            EventBasedHold = "string",
            TemporaryHold = "string",
        },
        RewriteObject = new Gcp.Storage.Inputs.BatchOperationsJobRewriteObjectArgs
        {
            KmsKey = "string",
        },
    });
    
    example, err := storage.NewBatchOperationsJob(ctx, "batchOperationsJobResource", &storage.BatchOperationsJobArgs{
    	BucketList: &storage.BatchOperationsJobBucketListArgs{
    		Buckets: &storage.BatchOperationsJobBucketListBucketsArgs{
    			Bucket: pulumi.String("string"),
    			Manifest: &storage.BatchOperationsJobBucketListBucketsManifestArgs{
    				ManifestLocation: pulumi.String("string"),
    			},
    			PrefixList: &storage.BatchOperationsJobBucketListBucketsPrefixListArgs{
    				IncludedObjectPrefixes: pulumi.StringArray{
    					pulumi.String("string"),
    				},
    			},
    		},
    	},
    	DeleteObject: &storage.BatchOperationsJobDeleteObjectArgs{
    		PermanentObjectDeletionEnabled: pulumi.Bool(false),
    	},
    	DeleteProtection: pulumi.Bool(false),
    	JobId:            pulumi.String("string"),
    	Project:          pulumi.String("string"),
    	PutMetadata: &storage.BatchOperationsJobPutMetadataArgs{
    		CacheControl:       pulumi.String("string"),
    		ContentDisposition: pulumi.String("string"),
    		ContentEncoding:    pulumi.String("string"),
    		ContentLanguage:    pulumi.String("string"),
    		ContentType:        pulumi.String("string"),
    		CustomMetadata: pulumi.StringMap{
    			"string": pulumi.String("string"),
    		},
    		CustomTime: pulumi.String("string"),
    	},
    	PutObjectHold: &storage.BatchOperationsJobPutObjectHoldArgs{
    		EventBasedHold: pulumi.String("string"),
    		TemporaryHold:  pulumi.String("string"),
    	},
    	RewriteObject: &storage.BatchOperationsJobRewriteObjectArgs{
    		KmsKey: pulumi.String("string"),
    	},
    })
    
    var batchOperationsJobResource = new BatchOperationsJob("batchOperationsJobResource", BatchOperationsJobArgs.builder()
        .bucketList(BatchOperationsJobBucketListArgs.builder()
            .buckets(BatchOperationsJobBucketListBucketsArgs.builder()
                .bucket("string")
                .manifest(BatchOperationsJobBucketListBucketsManifestArgs.builder()
                    .manifestLocation("string")
                    .build())
                .prefixList(BatchOperationsJobBucketListBucketsPrefixListArgs.builder()
                    .includedObjectPrefixes("string")
                    .build())
                .build())
            .build())
        .deleteObject(BatchOperationsJobDeleteObjectArgs.builder()
            .permanentObjectDeletionEnabled(false)
            .build())
        .deleteProtection(false)
        .jobId("string")
        .project("string")
        .putMetadata(BatchOperationsJobPutMetadataArgs.builder()
            .cacheControl("string")
            .contentDisposition("string")
            .contentEncoding("string")
            .contentLanguage("string")
            .contentType("string")
            .customMetadata(Map.of("string", "string"))
            .customTime("string")
            .build())
        .putObjectHold(BatchOperationsJobPutObjectHoldArgs.builder()
            .eventBasedHold("string")
            .temporaryHold("string")
            .build())
        .rewriteObject(BatchOperationsJobRewriteObjectArgs.builder()
            .kmsKey("string")
            .build())
        .build());
    
    batch_operations_job_resource = gcp.storage.BatchOperationsJob("batchOperationsJobResource",
        bucket_list={
            "buckets": {
                "bucket": "string",
                "manifest": {
                    "manifest_location": "string",
                },
                "prefix_list": {
                    "included_object_prefixes": ["string"],
                },
            },
        },
        delete_object={
            "permanent_object_deletion_enabled": False,
        },
        delete_protection=False,
        job_id="string",
        project="string",
        put_metadata={
            "cache_control": "string",
            "content_disposition": "string",
            "content_encoding": "string",
            "content_language": "string",
            "content_type": "string",
            "custom_metadata": {
                "string": "string",
            },
            "custom_time": "string",
        },
        put_object_hold={
            "event_based_hold": "string",
            "temporary_hold": "string",
        },
        rewrite_object={
            "kms_key": "string",
        })
    
    const batchOperationsJobResource = new gcp.storage.BatchOperationsJob("batchOperationsJobResource", {
        bucketList: {
            buckets: {
                bucket: "string",
                manifest: {
                    manifestLocation: "string",
                },
                prefixList: {
                    includedObjectPrefixes: ["string"],
                },
            },
        },
        deleteObject: {
            permanentObjectDeletionEnabled: false,
        },
        deleteProtection: false,
        jobId: "string",
        project: "string",
        putMetadata: {
            cacheControl: "string",
            contentDisposition: "string",
            contentEncoding: "string",
            contentLanguage: "string",
            contentType: "string",
            customMetadata: {
                string: "string",
            },
            customTime: "string",
        },
        putObjectHold: {
            eventBasedHold: "string",
            temporaryHold: "string",
        },
        rewriteObject: {
            kmsKey: "string",
        },
    });
    
    type: gcp:storage:BatchOperationsJob
    properties:
        bucketList:
            buckets:
                bucket: string
                manifest:
                    manifestLocation: string
                prefixList:
                    includedObjectPrefixes:
                        - string
        deleteObject:
            permanentObjectDeletionEnabled: false
        deleteProtection: false
        jobId: string
        project: string
        putMetadata:
            cacheControl: string
            contentDisposition: string
            contentEncoding: string
            contentLanguage: string
            contentType: string
            customMetadata:
                string: string
            customTime: string
        putObjectHold:
            eventBasedHold: string
            temporaryHold: string
        rewriteObject:
            kmsKey: string
    

    BatchOperationsJob Resource Properties

    To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

    Inputs

    In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

    The BatchOperationsJob resource accepts the following input properties:

    BucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    DeleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    DeleteProtection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    JobId string
    The ID of the job.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PutMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    PutObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    RewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    BucketList BatchOperationsJobBucketListArgs
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    DeleteObject BatchOperationsJobDeleteObjectArgs
    allows batch operations to delete objects in bucket Structure is documented below.
    DeleteProtection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    JobId string
    The ID of the job.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PutMetadata BatchOperationsJobPutMetadataArgs
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    PutObjectHold BatchOperationsJobPutObjectHoldArgs
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    RewriteObject BatchOperationsJobRewriteObjectArgs
    allows to update encryption key for objects in bucket. Structure is documented below.
    bucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    deleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection Boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId String
    The ID of the job.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    bucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    deleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId string
    The ID of the job.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    bucket_list BatchOperationsJobBucketListArgs
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    delete_object BatchOperationsJobDeleteObjectArgs
    allows batch operations to delete objects in bucket Structure is documented below.
    delete_protection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    job_id str
    The ID of the job.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    put_metadata BatchOperationsJobPutMetadataArgs
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    put_object_hold BatchOperationsJobPutObjectHoldArgs
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewrite_object BatchOperationsJobRewriteObjectArgs
    allows to update encryption key for objects in bucket. Structure is documented below.
    bucketList Property Map
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    deleteObject Property Map
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection Boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId String
    The ID of the job.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata Property Map
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold Property Map
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject Property Map
    allows to update encryption key for objects in bucket. Structure is documented below.

    Outputs

    All input properties are implicitly available as output properties. Additionally, the BatchOperationsJob resource produces the following output properties:

    CompleteTime string
    The time that the job was completed.
    CreateTime string
    The timestamp at which this storage batch operation was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ScheduleTime string
    The time that the job was scheduled.
    State string
    State of the job.
    UpdateTime string
    The timestamp at which this storage batch operation was most recently updated.
    CompleteTime string
    The time that the job was completed.
    CreateTime string
    The timestamp at which this storage batch operation was created.
    Id string
    The provider-assigned unique ID for this managed resource.
    ScheduleTime string
    The time that the job was scheduled.
    State string
    State of the job.
    UpdateTime string
    The timestamp at which this storage batch operation was most recently updated.
    completeTime String
    The time that the job was completed.
    createTime String
    The timestamp at which this storage batch operation was created.
    id String
    The provider-assigned unique ID for this managed resource.
    scheduleTime String
    The time that the job was scheduled.
    state String
    State of the job.
    updateTime String
    The timestamp at which this storage batch operation was most recently updated.
    completeTime string
    The time that the job was completed.
    createTime string
    The timestamp at which this storage batch operation was created.
    id string
    The provider-assigned unique ID for this managed resource.
    scheduleTime string
    The time that the job was scheduled.
    state string
    State of the job.
    updateTime string
    The timestamp at which this storage batch operation was most recently updated.
    complete_time str
    The time that the job was completed.
    create_time str
    The timestamp at which this storage batch operation was created.
    id str
    The provider-assigned unique ID for this managed resource.
    schedule_time str
    The time that the job was scheduled.
    state str
    State of the job.
    update_time str
    The timestamp at which this storage batch operation was most recently updated.
    completeTime String
    The time that the job was completed.
    createTime String
    The timestamp at which this storage batch operation was created.
    id String
    The provider-assigned unique ID for this managed resource.
    scheduleTime String
    The time that the job was scheduled.
    state String
    State of the job.
    updateTime String
    The timestamp at which this storage batch operation was most recently updated.

    Look up Existing BatchOperationsJob Resource

    Get an existing BatchOperationsJob resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

    public static get(name: string, id: Input<ID>, state?: BatchOperationsJobState, opts?: CustomResourceOptions): BatchOperationsJob
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket_list: Optional[BatchOperationsJobBucketListArgs] = None,
            complete_time: Optional[str] = None,
            create_time: Optional[str] = None,
            delete_object: Optional[BatchOperationsJobDeleteObjectArgs] = None,
            delete_protection: Optional[bool] = None,
            job_id: Optional[str] = None,
            project: Optional[str] = None,
            put_metadata: Optional[BatchOperationsJobPutMetadataArgs] = None,
            put_object_hold: Optional[BatchOperationsJobPutObjectHoldArgs] = None,
            rewrite_object: Optional[BatchOperationsJobRewriteObjectArgs] = None,
            schedule_time: Optional[str] = None,
            state: Optional[str] = None,
            update_time: Optional[str] = None) -> BatchOperationsJob
    func GetBatchOperationsJob(ctx *Context, name string, id IDInput, state *BatchOperationsJobState, opts ...ResourceOption) (*BatchOperationsJob, error)
    public static BatchOperationsJob Get(string name, Input<string> id, BatchOperationsJobState? state, CustomResourceOptions? opts = null)
    public static BatchOperationsJob get(String name, Output<String> id, BatchOperationsJobState state, CustomResourceOptions options)
    resources:  _:    type: gcp:storage:BatchOperationsJob    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    CompleteTime string
    The time that the job was completed.
    CreateTime string
    The timestamp at which this storage batch operation was created.
    DeleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    DeleteProtection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    JobId string
    The ID of the job.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PutMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    PutObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    RewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    ScheduleTime string
    The time that the job was scheduled.
    State string
    State of the job.
    UpdateTime string
    The timestamp at which this storage batch operation was most recently updated.
    BucketList BatchOperationsJobBucketListArgs
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    CompleteTime string
    The time that the job was completed.
    CreateTime string
    The timestamp at which this storage batch operation was created.
    DeleteObject BatchOperationsJobDeleteObjectArgs
    allows batch operations to delete objects in bucket Structure is documented below.
    DeleteProtection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    JobId string
    The ID of the job.
    Project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    PutMetadata BatchOperationsJobPutMetadataArgs
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    PutObjectHold BatchOperationsJobPutObjectHoldArgs
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    RewriteObject BatchOperationsJobRewriteObjectArgs
    allows to update encryption key for objects in bucket. Structure is documented below.
    ScheduleTime string
    The time that the job was scheduled.
    State string
    State of the job.
    UpdateTime string
    The timestamp at which this storage batch operation was most recently updated.
    bucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    completeTime String
    The time that the job was completed.
    createTime String
    The timestamp at which this storage batch operation was created.
    deleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection Boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId String
    The ID of the job.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    scheduleTime String
    The time that the job was scheduled.
    state String
    State of the job.
    updateTime String
    The timestamp at which this storage batch operation was most recently updated.
    bucketList BatchOperationsJobBucketList
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    completeTime string
    The time that the job was completed.
    createTime string
    The timestamp at which this storage batch operation was created.
    deleteObject BatchOperationsJobDeleteObject
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId string
    The ID of the job.
    project string
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata BatchOperationsJobPutMetadata
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold BatchOperationsJobPutObjectHold
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject BatchOperationsJobRewriteObject
    allows to update encryption key for objects in bucket. Structure is documented below.
    scheduleTime string
    The time that the job was scheduled.
    state string
    State of the job.
    updateTime string
    The timestamp at which this storage batch operation was most recently updated.
    bucket_list BatchOperationsJobBucketListArgs
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    complete_time str
    The time that the job was completed.
    create_time str
    The timestamp at which this storage batch operation was created.
    delete_object BatchOperationsJobDeleteObjectArgs
    allows batch operations to delete objects in bucket Structure is documented below.
    delete_protection bool
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    job_id str
    The ID of the job.
    project str
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    put_metadata BatchOperationsJobPutMetadataArgs
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    put_object_hold BatchOperationsJobPutObjectHoldArgs
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewrite_object BatchOperationsJobRewriteObjectArgs
    allows to update encryption key for objects in bucket. Structure is documented below.
    schedule_time str
    The time that the job was scheduled.
    state str
    State of the job.
    update_time str
    The timestamp at which this storage batch operation was most recently updated.
    bucketList Property Map
    List of buckets and their objects to be transformed. Currently, only one bucket configuration is supported. If multiple buckets are specified, an error will be returned Structure is documented below.
    completeTime String
    The time that the job was completed.
    createTime String
    The timestamp at which this storage batch operation was created.
    deleteObject Property Map
    allows batch operations to delete objects in bucket Structure is documented below.
    deleteProtection Boolean
    If set to true, the storage batch operation job will not be deleted and new job will be created.
    jobId String
    The ID of the job.
    project String
    The ID of the project in which the resource belongs. If it is not provided, the provider project is used.
    putMetadata Property Map
    allows batch operations to update metadata for objects in bucket Structure is documented below.
    putObjectHold Property Map
    allows to update temporary hold or eventBased hold for objects in bucket. Structure is documented below.
    rewriteObject Property Map
    allows to update encryption key for objects in bucket. Structure is documented below.
    scheduleTime String
    The time that the job was scheduled.
    state String
    State of the job.
    updateTime String
    The timestamp at which this storage batch operation was most recently updated.

    Supporting Types

    BatchOperationsJobBucketList, BatchOperationsJobBucketListArgs

    Buckets BatchOperationsJobBucketListBuckets
    List of buckets and their objects to be transformed. Structure is documented below.
    Buckets BatchOperationsJobBucketListBuckets
    List of buckets and their objects to be transformed. Structure is documented below.
    buckets BatchOperationsJobBucketListBuckets
    List of buckets and their objects to be transformed. Structure is documented below.
    buckets BatchOperationsJobBucketListBuckets
    List of buckets and their objects to be transformed. Structure is documented below.
    buckets BatchOperationsJobBucketListBuckets
    List of buckets and their objects to be transformed. Structure is documented below.
    buckets Property Map
    List of buckets and their objects to be transformed. Structure is documented below.

    BatchOperationsJobBucketListBuckets, BatchOperationsJobBucketListBucketsArgs

    Bucket string
    Bucket name for the objects to be transformed.
    Manifest BatchOperationsJobBucketListBucketsManifest
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    PrefixList BatchOperationsJobBucketListBucketsPrefixList
    Specifies objects matching a prefix set. Structure is documented below.
    Bucket string
    Bucket name for the objects to be transformed.
    Manifest BatchOperationsJobBucketListBucketsManifest
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    PrefixList BatchOperationsJobBucketListBucketsPrefixList
    Specifies objects matching a prefix set. Structure is documented below.
    bucket String
    Bucket name for the objects to be transformed.
    manifest BatchOperationsJobBucketListBucketsManifest
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    prefixList BatchOperationsJobBucketListBucketsPrefixList
    Specifies objects matching a prefix set. Structure is documented below.
    bucket string
    Bucket name for the objects to be transformed.
    manifest BatchOperationsJobBucketListBucketsManifest
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    prefixList BatchOperationsJobBucketListBucketsPrefixList
    Specifies objects matching a prefix set. Structure is documented below.
    bucket str
    Bucket name for the objects to be transformed.
    manifest BatchOperationsJobBucketListBucketsManifest
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    prefix_list BatchOperationsJobBucketListBucketsPrefixList
    Specifies objects matching a prefix set. Structure is documented below.
    bucket String
    Bucket name for the objects to be transformed.
    manifest Property Map
    contain the manifest source file that is a CSV file in a Google Cloud Storage bucket. Structure is documented below.
    prefixList Property Map
    Specifies objects matching a prefix set. Structure is documented below.

    BatchOperationsJobBucketListBucketsManifest, BatchOperationsJobBucketListBucketsManifestArgs

    ManifestLocation string
    Specifies objects in a manifest file.
    ManifestLocation string
    Specifies objects in a manifest file.
    manifestLocation String
    Specifies objects in a manifest file.
    manifestLocation string
    Specifies objects in a manifest file.
    manifest_location str
    Specifies objects in a manifest file.
    manifestLocation String
    Specifies objects in a manifest file.

    BatchOperationsJobBucketListBucketsPrefixList, BatchOperationsJobBucketListBucketsPrefixListArgs

    IncludedObjectPrefixes List<string>
    (Optional)
    IncludedObjectPrefixes []string
    (Optional)
    includedObjectPrefixes List<String>
    (Optional)
    includedObjectPrefixes string[]
    (Optional)
    included_object_prefixes Sequence[str]
    (Optional)
    includedObjectPrefixes List<String>
    (Optional)

    BatchOperationsJobDeleteObject, BatchOperationsJobDeleteObjectArgs

    PermanentObjectDeletionEnabled bool
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.
    PermanentObjectDeletionEnabled bool
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.
    permanentObjectDeletionEnabled Boolean
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.
    permanentObjectDeletionEnabled boolean
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.
    permanent_object_deletion_enabled bool
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.
    permanentObjectDeletionEnabled Boolean
    enable flag to permanently delete object and all object versions if versioning is enabled on bucket.

    BatchOperationsJobPutMetadata, BatchOperationsJobPutMetadataArgs

    CacheControl string
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    ContentDisposition string
    Content-Disposition of the object data.
    ContentEncoding string
    Content Encoding of the object data.
    ContentLanguage string
    Content-Language of the object data.
    ContentType string
    Content-Type of the object data.
    CustomMetadata Dictionary<string, string>
    User-provided metadata, in key/value pairs.
    CustomTime string
    Updates the objects fixed custom time metadata.
    CacheControl string
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    ContentDisposition string
    Content-Disposition of the object data.
    ContentEncoding string
    Content Encoding of the object data.
    ContentLanguage string
    Content-Language of the object data.
    ContentType string
    Content-Type of the object data.
    CustomMetadata map[string]string
    User-provided metadata, in key/value pairs.
    CustomTime string
    Updates the objects fixed custom time metadata.
    cacheControl String
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    contentDisposition String
    Content-Disposition of the object data.
    contentEncoding String
    Content Encoding of the object data.
    contentLanguage String
    Content-Language of the object data.
    contentType String
    Content-Type of the object data.
    customMetadata Map<String,String>
    User-provided metadata, in key/value pairs.
    customTime String
    Updates the objects fixed custom time metadata.
    cacheControl string
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    contentDisposition string
    Content-Disposition of the object data.
    contentEncoding string
    Content Encoding of the object data.
    contentLanguage string
    Content-Language of the object data.
    contentType string
    Content-Type of the object data.
    customMetadata {[key: string]: string}
    User-provided metadata, in key/value pairs.
    customTime string
    Updates the objects fixed custom time metadata.
    cache_control str
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    content_disposition str
    Content-Disposition of the object data.
    content_encoding str
    Content Encoding of the object data.
    content_language str
    Content-Language of the object data.
    content_type str
    Content-Type of the object data.
    custom_metadata Mapping[str, str]
    User-provided metadata, in key/value pairs.
    custom_time str
    Updates the objects fixed custom time metadata.
    cacheControl String
    Cache-Control directive to specify caching behavior of object data. If omitted and object is accessible to all anonymous users, the default will be public, max-age=3600
    contentDisposition String
    Content-Disposition of the object data.
    contentEncoding String
    Content Encoding of the object data.
    contentLanguage String
    Content-Language of the object data.
    contentType String
    Content-Type of the object data.
    customMetadata Map<String>
    User-provided metadata, in key/value pairs.
    customTime String
    Updates the objects fixed custom time metadata.

    BatchOperationsJobPutObjectHold, BatchOperationsJobPutObjectHoldArgs

    EventBasedHold string
    set/unset to update event based hold for objects.
    TemporaryHold string
    set/unset to update temporary based hold for objects.
    EventBasedHold string
    set/unset to update event based hold for objects.
    TemporaryHold string
    set/unset to update temporary based hold for objects.
    eventBasedHold String
    set/unset to update event based hold for objects.
    temporaryHold String
    set/unset to update temporary based hold for objects.
    eventBasedHold string
    set/unset to update event based hold for objects.
    temporaryHold string
    set/unset to update temporary based hold for objects.
    event_based_hold str
    set/unset to update event based hold for objects.
    temporary_hold str
    set/unset to update temporary based hold for objects.
    eventBasedHold String
    set/unset to update event based hold for objects.
    temporaryHold String
    set/unset to update temporary based hold for objects.

    BatchOperationsJobRewriteObject, BatchOperationsJobRewriteObjectArgs

    KmsKey string
    valid kms key
    KmsKey string
    valid kms key
    kmsKey String
    valid kms key
    kmsKey string
    valid kms key
    kms_key str
    valid kms key
    kmsKey String
    valid kms key

    Import

    Job can be imported using any of these accepted formats:

    • projects/{{project}}/locations/global/jobs/{{job_id}}

    • {{project}}/{{job_id}}

    • {{job_id}}

    When using the pulumi import command, Job can be imported using one of the formats above. For example:

    $ pulumi import gcp:storage/batchOperationsJob:BatchOperationsJob default projects/{{project}}/locations/global/jobs/{{job_id}}
    
    $ pulumi import gcp:storage/batchOperationsJob:BatchOperationsJob default {{project}}/{{job_id}}
    
    $ pulumi import gcp:storage/batchOperationsJob:BatchOperationsJob default {{job_id}}
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Google Cloud (GCP) Classic pulumi/pulumi-gcp
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the google-beta Terraform Provider.
    gcp logo
    Google Cloud v8.29.0 published on Thursday, May 1, 2025 by Pulumi