1. Packages
  2. Packages
  3. Ibm Provider
  4. API Docs
  5. CosBucketObjectLockConfiguration
Viewing docs for ibm 2.1.0
published on Tuesday, May 5, 2026 by ibm-cloud
Viewing docs for ibm 2.1.0
published on Tuesday, May 5, 2026 by ibm-cloud

    Provides an Object Lock configuration resource. This resource is used to configure a default retention period for objects placed in the specified bucket. To enable Object Lock for a new bucket see ibm_cos_bucket. To configure legal hold and retention period on an object please refer ibm_cos_bucket_object.

    Note: To configure Object Lock on a bucket, you must first enable object versioning on bucket by using the Versioning objects.


    Example Usage

    The following example demonstrates creating a bucket with object lock enabled with default retention.

    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    Example coming soon!
    
    resources:
      cosInstance:
        type: ibm:ResourceInstance
        name: cos_instance
        properties:
          name: cos-instance
          resourceGroupId: ${cosGroup.id}
          service: cloud-object-storage
          plan: standard
          location: global
      cosBucket:
        type: ibm:CosBucket
        name: cos_bucket
        properties:
          bucketName: a-standard-bucket
          resourceInstanceId: ${cosInstanceIbmResourceInstance.id}
          bucketRegion: us-south
          storageClass: Standard
          objectVersioning:
            enable: true
          objectLock: true
      objectlock:
        type: ibm:CosBucketObjectLockConfiguration
        properties:
          bucketCrn: ${cosBucket.crn}
          bucketLocation: ${cosBucket.bucketRegion}
          objectLockConfiguration:
            objectLockEnabled: Enabled
            objectLockRule:
              defaultRetention:
                mode: COMPLIANCE
                days: 4
    variables:
      cosGroup:
        fn::invoke:
          function: ibm:getResourceGroup
          arguments:
            name: cos-resource-group
    
    Example coming soon!
    

    With GOVERNANCE Mode

    import * as pulumi from "@pulumi/pulumi";
    import * as ibm from "@pulumi/ibm";
    
    const objectlock = new ibm.CosBucketObjectLockConfiguration("objectlock", {
        bucketCrn: cosBucket.crn,
        bucketLocation: cosBucket.bucketRegion,
        objectLockConfiguration: {
            objectLockEnabled: "Enabled",
            objectLockRule: {
                defaultRetention: {
                    mode: "GOVERNANCE",
                    years: 1,
                },
            },
        },
    });
    
    import pulumi
    import pulumi_ibm as ibm
    
    objectlock = ibm.CosBucketObjectLockConfiguration("objectlock",
        bucket_crn=cos_bucket["crn"],
        bucket_location=cos_bucket["bucketRegion"],
        object_lock_configuration={
            "object_lock_enabled": "Enabled",
            "object_lock_rule": {
                "default_retention": {
                    "mode": "GOVERNANCE",
                    "years": 1,
                },
            },
        })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/ibm/v2/ibm"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := ibm.NewCosBucketObjectLockConfiguration(ctx, "objectlock", &ibm.CosBucketObjectLockConfigurationArgs{
    			BucketCrn:      pulumi.Any(cosBucket.Crn),
    			BucketLocation: pulumi.Any(cosBucket.BucketRegion),
    			ObjectLockConfiguration: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationArgs{
    				ObjectLockEnabled: pulumi.String("Enabled"),
    				ObjectLockRule: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs{
    					DefaultRetention: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs{
    						Mode:  pulumi.String("GOVERNANCE"),
    						Years: pulumi.Float64(1),
    					},
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Ibm = Pulumi.Ibm;
    
    return await Deployment.RunAsync(() => 
    {
        var objectlock = new Ibm.CosBucketObjectLockConfiguration("objectlock", new()
        {
            BucketCrn = cosBucket.Crn,
            BucketLocation = cosBucket.BucketRegion,
            ObjectLockConfiguration = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationArgs
            {
                ObjectLockEnabled = "Enabled",
                ObjectLockRule = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs
                {
                    DefaultRetention = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs
                    {
                        Mode = "GOVERNANCE",
                        Years = 1,
                    },
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.ibm.CosBucketObjectLockConfiguration;
    import com.pulumi.ibm.CosBucketObjectLockConfigurationArgs;
    import com.pulumi.ibm.inputs.CosBucketObjectLockConfigurationObjectLockConfigurationArgs;
    import com.pulumi.ibm.inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs;
    import com.pulumi.ibm.inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs;
    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 objectlock = new CosBucketObjectLockConfiguration("objectlock", CosBucketObjectLockConfigurationArgs.builder()
                .bucketCrn(cosBucket.crn())
                .bucketLocation(cosBucket.bucketRegion())
                .objectLockConfiguration(CosBucketObjectLockConfigurationObjectLockConfigurationArgs.builder()
                    .objectLockEnabled("Enabled")
                    .objectLockRule(CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs.builder()
                        .defaultRetention(CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs.builder()
                            .mode("GOVERNANCE")
                            .years(1.0)
                            .build())
                        .build())
                    .build())
                .build());
    
        }
    }
    
    resources:
      objectlock:
        type: ibm:CosBucketObjectLockConfiguration
        properties:
          bucketCrn: ${cosBucket.crn}
          bucketLocation: ${cosBucket.bucketRegion}
          objectLockConfiguration:
            objectLockEnabled: Enabled
            objectLockRule:
              defaultRetention:
                mode: GOVERNANCE
                years: 1
    
    Example coming soon!
    

    Enabling Object Lock configuration on an existing bucket

    To enable Object Lock configuration on an existing bucket, create a COS bucket with object versioning enabled and pass the crn of the COS bucket and location of the bucket to ibm_cos_bucket_object_lock_configuration.bucket_crn and ibm_cos_bucket_object_lock_configuration.bucket_location as shown in the example.

    Create CosBucketObjectLockConfiguration Resource

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

    Constructor syntax

    new CosBucketObjectLockConfiguration(name: string, args: CosBucketObjectLockConfigurationArgs, opts?: CustomResourceOptions);
    @overload
    def CosBucketObjectLockConfiguration(resource_name: str,
                                         args: CosBucketObjectLockConfigurationArgs,
                                         opts: Optional[ResourceOptions] = None)
    
    @overload
    def CosBucketObjectLockConfiguration(resource_name: str,
                                         opts: Optional[ResourceOptions] = None,
                                         bucket_crn: Optional[str] = None,
                                         bucket_location: Optional[str] = None,
                                         object_lock_configuration: Optional[CosBucketObjectLockConfigurationObjectLockConfigurationArgs] = None,
                                         cos_bucket_object_lock_configuration_id: Optional[str] = None,
                                         endpoint_type: Optional[str] = None,
                                         timeouts: Optional[CosBucketObjectLockConfigurationTimeoutsArgs] = None)
    func NewCosBucketObjectLockConfiguration(ctx *Context, name string, args CosBucketObjectLockConfigurationArgs, opts ...ResourceOption) (*CosBucketObjectLockConfiguration, error)
    public CosBucketObjectLockConfiguration(string name, CosBucketObjectLockConfigurationArgs args, CustomResourceOptions? opts = null)
    public CosBucketObjectLockConfiguration(String name, CosBucketObjectLockConfigurationArgs args)
    public CosBucketObjectLockConfiguration(String name, CosBucketObjectLockConfigurationArgs args, CustomResourceOptions options)
    
    type: ibm:CosBucketObjectLockConfiguration
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    resource "ibm_cosbucketobjectlockconfiguration" "name" {
        # resource properties
    }

    Parameters

    name string
    The unique name of the resource.
    args CosBucketObjectLockConfigurationArgs
    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 CosBucketObjectLockConfigurationArgs
    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 CosBucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args CosBucketObjectLockConfigurationArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args CosBucketObjectLockConfigurationArgs
    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 cosBucketObjectLockConfigurationResource = new Ibm.CosBucketObjectLockConfiguration("cosBucketObjectLockConfigurationResource", new()
    {
        BucketCrn = "string",
        BucketLocation = "string",
        ObjectLockConfiguration = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationArgs
        {
            ObjectLockEnabled = "string",
            ObjectLockRule = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs
            {
                DefaultRetention = new Ibm.Inputs.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs
                {
                    Mode = "string",
                    Days = 0,
                    Years = 0,
                },
            },
        },
        CosBucketObjectLockConfigurationId = "string",
        EndpointType = "string",
        Timeouts = new Ibm.Inputs.CosBucketObjectLockConfigurationTimeoutsArgs
        {
            Create = "string",
            Delete = "string",
            Update = "string",
        },
    });
    
    example, err := ibm.NewCosBucketObjectLockConfiguration(ctx, "cosBucketObjectLockConfigurationResource", &ibm.CosBucketObjectLockConfigurationArgs{
    	BucketCrn:      pulumi.String("string"),
    	BucketLocation: pulumi.String("string"),
    	ObjectLockConfiguration: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationArgs{
    		ObjectLockEnabled: pulumi.String("string"),
    		ObjectLockRule: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs{
    			DefaultRetention: &ibm.CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs{
    				Mode:  pulumi.String("string"),
    				Days:  pulumi.Float64(0),
    				Years: pulumi.Float64(0),
    			},
    		},
    	},
    	CosBucketObjectLockConfigurationId: pulumi.String("string"),
    	EndpointType:                       pulumi.String("string"),
    	Timeouts: &ibm.CosBucketObjectLockConfigurationTimeoutsArgs{
    		Create: pulumi.String("string"),
    		Delete: pulumi.String("string"),
    		Update: pulumi.String("string"),
    	},
    })
    
    resource "ibm_cosbucketobjectlockconfiguration" "cosBucketObjectLockConfigurationResource" {
      bucket_crn      = "string"
      bucket_location = "string"
      object_lock_configuration = {
        object_lock_enabled = "string"
        object_lock_rule = {
          default_retention = {
            mode  = "string"
            days  = 0
            years = 0
          }
        }
      }
      cos_bucket_object_lock_configuration_id = "string"
      endpoint_type                           = "string"
      timeouts = {
        create = "string"
        delete = "string"
        update = "string"
      }
    }
    
    var cosBucketObjectLockConfigurationResource = new CosBucketObjectLockConfiguration("cosBucketObjectLockConfigurationResource", CosBucketObjectLockConfigurationArgs.builder()
        .bucketCrn("string")
        .bucketLocation("string")
        .objectLockConfiguration(CosBucketObjectLockConfigurationObjectLockConfigurationArgs.builder()
            .objectLockEnabled("string")
            .objectLockRule(CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs.builder()
                .defaultRetention(CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs.builder()
                    .mode("string")
                    .days(0.0)
                    .years(0.0)
                    .build())
                .build())
            .build())
        .cosBucketObjectLockConfigurationId("string")
        .endpointType("string")
        .timeouts(CosBucketObjectLockConfigurationTimeoutsArgs.builder()
            .create("string")
            .delete("string")
            .update("string")
            .build())
        .build());
    
    cos_bucket_object_lock_configuration_resource = ibm.CosBucketObjectLockConfiguration("cosBucketObjectLockConfigurationResource",
        bucket_crn="string",
        bucket_location="string",
        object_lock_configuration={
            "object_lock_enabled": "string",
            "object_lock_rule": {
                "default_retention": {
                    "mode": "string",
                    "days": float(0),
                    "years": float(0),
                },
            },
        },
        cos_bucket_object_lock_configuration_id="string",
        endpoint_type="string",
        timeouts={
            "create": "string",
            "delete": "string",
            "update": "string",
        })
    
    const cosBucketObjectLockConfigurationResource = new ibm.CosBucketObjectLockConfiguration("cosBucketObjectLockConfigurationResource", {
        bucketCrn: "string",
        bucketLocation: "string",
        objectLockConfiguration: {
            objectLockEnabled: "string",
            objectLockRule: {
                defaultRetention: {
                    mode: "string",
                    days: 0,
                    years: 0,
                },
            },
        },
        cosBucketObjectLockConfigurationId: "string",
        endpointType: "string",
        timeouts: {
            create: "string",
            "delete": "string",
            update: "string",
        },
    });
    
    type: ibm:CosBucketObjectLockConfiguration
    properties:
        bucketCrn: string
        bucketLocation: string
        cosBucketObjectLockConfigurationId: string
        endpointType: string
        objectLockConfiguration:
            objectLockEnabled: string
            objectLockRule:
                defaultRetention:
                    days: 0
                    mode: string
                    years: 0
        timeouts:
            create: string
            delete: string
            update: string
    

    CosBucketObjectLockConfiguration 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 CosBucketObjectLockConfiguration resource accepts the following input properties:

    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    ObjectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    CosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    EndpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    Timeouts CosBucketObjectLockConfigurationTimeouts
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    ObjectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfigurationArgs

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    CosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    EndpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    Timeouts CosBucketObjectLockConfigurationTimeoutsArgs
    bucket_crn string
    The CRN of the COS bucket.
    bucket_location string
    The location of the COS bucket.
    object_lock_configuration object

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    cos_bucket_object_lock_configuration_id string
    (String) The ID of the bucket.
    endpoint_type string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    timeouts object
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    objectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    cosBucketObjectLockConfigurationId String
    (String) The ID of the bucket.
    endpointType String
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    timeouts CosBucketObjectLockConfigurationTimeouts
    bucketCrn string
    The CRN of the COS bucket.
    bucketLocation string
    The location of the COS bucket.
    objectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    cosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    endpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    timeouts CosBucketObjectLockConfigurationTimeouts
    bucket_crn str
    The CRN of the COS bucket.
    bucket_location str
    The location of the COS bucket.
    object_lock_configuration CosBucketObjectLockConfigurationObjectLockConfigurationArgs

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    cos_bucket_object_lock_configuration_id str
    (String) The ID of the bucket.
    endpoint_type str
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    timeouts CosBucketObjectLockConfigurationTimeoutsArgs
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    objectLockConfiguration Property Map

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    cosBucketObjectLockConfigurationId String
    (String) The ID of the bucket.
    endpointType String
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    timeouts Property Map

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Id string
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.
    id string
    The provider-assigned unique ID for this managed resource.
    id str
    The provider-assigned unique ID for this managed resource.
    id String
    The provider-assigned unique ID for this managed resource.

    Look up Existing CosBucketObjectLockConfiguration Resource

    Get an existing CosBucketObjectLockConfiguration 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?: CosBucketObjectLockConfigurationState, opts?: CustomResourceOptions): CosBucketObjectLockConfiguration
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket_crn: Optional[str] = None,
            bucket_location: Optional[str] = None,
            cos_bucket_object_lock_configuration_id: Optional[str] = None,
            endpoint_type: Optional[str] = None,
            object_lock_configuration: Optional[CosBucketObjectLockConfigurationObjectLockConfigurationArgs] = None,
            timeouts: Optional[CosBucketObjectLockConfigurationTimeoutsArgs] = None) -> CosBucketObjectLockConfiguration
    func GetCosBucketObjectLockConfiguration(ctx *Context, name string, id IDInput, state *CosBucketObjectLockConfigurationState, opts ...ResourceOption) (*CosBucketObjectLockConfiguration, error)
    public static CosBucketObjectLockConfiguration Get(string name, Input<string> id, CosBucketObjectLockConfigurationState? state, CustomResourceOptions? opts = null)
    public static CosBucketObjectLockConfiguration get(String name, Output<String> id, CosBucketObjectLockConfigurationState state, CustomResourceOptions options)
    resources:  _:    type: ibm:CosBucketObjectLockConfiguration    get:      id: ${id}
    import {
      to = ibm_cosbucketobjectlockconfiguration.example
      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:
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    CosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    EndpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    ObjectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    Timeouts CosBucketObjectLockConfigurationTimeouts
    BucketCrn string
    The CRN of the COS bucket.
    BucketLocation string
    The location of the COS bucket.
    CosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    EndpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    ObjectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfigurationArgs

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    Timeouts CosBucketObjectLockConfigurationTimeoutsArgs
    bucket_crn string
    The CRN of the COS bucket.
    bucket_location string
    The location of the COS bucket.
    cos_bucket_object_lock_configuration_id string
    (String) The ID of the bucket.
    endpoint_type string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    object_lock_configuration object

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    timeouts object
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    cosBucketObjectLockConfigurationId String
    (String) The ID of the bucket.
    endpointType String
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    objectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    timeouts CosBucketObjectLockConfigurationTimeouts
    bucketCrn string
    The CRN of the COS bucket.
    bucketLocation string
    The location of the COS bucket.
    cosBucketObjectLockConfigurationId string
    (String) The ID of the bucket.
    endpointType string
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    objectLockConfiguration CosBucketObjectLockConfigurationObjectLockConfiguration

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    timeouts CosBucketObjectLockConfigurationTimeouts
    bucket_crn str
    The CRN of the COS bucket.
    bucket_location str
    The location of the COS bucket.
    cos_bucket_object_lock_configuration_id str
    (String) The ID of the bucket.
    endpoint_type str
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    object_lock_configuration CosBucketObjectLockConfigurationObjectLockConfigurationArgs

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    timeouts CosBucketObjectLockConfigurationTimeoutsArgs
    bucketCrn String
    The CRN of the COS bucket.
    bucketLocation String
    The location of the COS bucket.
    cosBucketObjectLockConfigurationId String
    (String) The ID of the bucket.
    endpointType String
    The type of the endpoint either public or private or direct to be used for buckets. Default value is public.
    objectLockConfiguration Property Map

    Nested block have the following structure:

    Nested scheme for object_lock_configuration:

    timeouts Property Map

    Supporting Types

    CosBucketObjectLockConfigurationObjectLockConfiguration, CosBucketObjectLockConfigurationObjectLockConfigurationArgs

    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    ObjectLockRule CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    ObjectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    ObjectLockRule CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    object_lock_enabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    object_lock_rule object

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    objectLockRule CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    objectLockEnabled string
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    objectLockRule CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    object_lock_enabled str
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    object_lock_rule CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    objectLockEnabled String
    Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
    objectLockRule Property Map

    Object Lock rule has following argument:

    Nested scheme for object_lock_rule:

    CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule, CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs

    DefaultRetention CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    DefaultRetention CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    default_retention object
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    defaultRetention CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    defaultRetention CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    default_retention CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.
    defaultRetention Property Map
    An object lock configuration on the object at a bucket level, in the form of a days , years and mode that establishes a point in time after which the object can be deleted. This is applied at bucket level hence it is by default applied to all the object in the bucket unless a seperate retention period is set on the object.

    CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetention, CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleDefaultRetentionArgs

    Mode string
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    Days double
    Retention period in terms of days after which the object can be deleted.
    Years double
    Retention period in terms of years after which the object can be deleted.
    Mode string
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    Days float64
    Retention period in terms of days after which the object can be deleted.
    Years float64
    Retention period in terms of years after which the object can be deleted.
    mode string
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    days number
    Retention period in terms of days after which the object can be deleted.
    years number
    Retention period in terms of years after which the object can be deleted.
    mode String
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    days Double
    Retention period in terms of days after which the object can be deleted.
    years Double
    Retention period in terms of years after which the object can be deleted.
    mode string
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    days number
    Retention period in terms of days after which the object can be deleted.
    years number
    Retention period in terms of years after which the object can be deleted.
    mode str
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    days float
    Retention period in terms of days after which the object can be deleted.
    years float
    Retention period in terms of years after which the object can be deleted.
    mode String
    Retention modes apply different levels of protection to the objects. Valid values: COMPLIANCE, GOVERNANCE.
    days Number
    Retention period in terms of days after which the object can be deleted.
    years Number
    Retention period in terms of years after which the object can be deleted.

    CosBucketObjectLockConfigurationTimeouts, CosBucketObjectLockConfigurationTimeoutsArgs

    Create string
    Delete string
    Update string
    Create string
    Delete string
    Update string
    create string
    delete string
    update string
    create String
    delete String
    update String
    create string
    delete string
    update string
    create str
    delete str
    update str
    create String
    delete String
    update String

    Import

    IBM COS Bucket

    The ibm.CosBucketObjectLockConfiguration resource can be imported by using the id. The ID is formed from the CRN (Cloud Resource Name). The CRN and bucket location can be found on the portal.

    id = $CRN:meta:$bucketlocation:$endpointtype

    Syntax

    $ terraform import ibm_cos_bucket_object_lock_configuration.objectlock `$CRN:meta:$bucketlocation:public`
    

    Example

    
    $ terraform import ibm_cos_bucket_object_lock_configuration.objectlock crn:v1:bluemix:public:cloud-object-storage:global:a/4ea1882a2d3401ed1e459979941966ea:31fa970d-51d0-4b05-893e-251cba75a7b3:bucket:mybucketname:meta:us-south:public
    

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

    Package Details

    Repository
    ibm ibm-cloud/terraform-provider-ibm
    License
    Notes
    This Pulumi package is based on the ibm Terraform Provider.
    Viewing docs for ibm 2.1.0
    published on Tuesday, May 5, 2026 by ibm-cloud
      Try Pulumi Cloud free. Your team will thank you.