ibm.CosBucketObjectLockConfiguration
Explore with Pulumi AI
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.
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.
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"),
},
})
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)
.years(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": 0,
"years": 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:
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- Cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Object Lock Configuration Timeouts
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Args Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- Cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Timeouts
Cos
Bucket Object Lock Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- cos
Bucket StringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Object Lock Configuration Timeouts
- bucket
Crn string - The CRN of the COS bucket.
- bucket
Location string - The location of the COS bucket.
- object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Object Lock Configuration Timeouts
- bucket_
crn str - The CRN of the COS bucket.
- bucket_
location str - The location of the COS bucket.
- object_
lock_ Cosconfiguration Bucket Object Lock Configuration Object Lock Configuration Args Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- cos_
bucket_ strobject_ lock_ configuration_ id - (String) The ID of the bucket.
- endpoint_
type str - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - timeouts
Cos
Bucket Object Lock Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- object
Lock Property MapConfiguration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- cos
Bucket StringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - 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 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}
- 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.
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- Timeouts
Cos
Bucket Object Lock Configuration Timeouts
- Bucket
Crn string - The CRN of the COS bucket.
- Bucket
Location string - The location of the COS bucket.
- Cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- Endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - Object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Args Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- Timeouts
Cos
Bucket Object Lock Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- cos
Bucket StringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- timeouts
Cos
Bucket Object Lock Configuration Timeouts
- bucket
Crn string - The CRN of the COS bucket.
- bucket
Location string - The location of the COS bucket.
- cos
Bucket stringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type string - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - object
Lock CosConfiguration Bucket Object Lock Configuration Object Lock Configuration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- timeouts
Cos
Bucket Object Lock Configuration Timeouts
- bucket_
crn str - The CRN of the COS bucket.
- bucket_
location str - The location of the COS bucket.
- cos_
bucket_ strobject_ lock_ configuration_ id - (String) The ID of the bucket.
- endpoint_
type str - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - object_
lock_ Cosconfiguration Bucket Object Lock Configuration Object Lock Configuration Args Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- timeouts
Cos
Bucket Object Lock Configuration Timeouts Args
- bucket
Crn String - The CRN of the COS bucket.
- bucket
Location String - The location of the COS bucket.
- cos
Bucket StringObject Lock Configuration Id - (String) The ID of the bucket.
- endpoint
Type String - The type of the endpoint either
public
orprivate
ordirect
to be used for buckets. Default value ispublic
. - object
Lock Property MapConfiguration Nested block have the following structure:
Nested scheme for
object_lock_configuration
:- timeouts Property Map
Supporting Types
CosBucketObjectLockConfigurationObjectLockConfiguration, CosBucketObjectLockConfigurationObjectLockConfigurationArgs
- Object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- Object
Lock CosRule Bucket Object Lock Configuration Object Lock Configuration Object Lock Rule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
- Object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- Object
Lock CosRule Bucket Object Lock Configuration Object Lock Configuration Object Lock Rule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
- object
Lock StringEnabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- object
Lock CosRule Bucket Object Lock Configuration Object Lock Configuration Object Lock Rule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
- object
Lock stringEnabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- object
Lock CosRule Bucket Object Lock Configuration Object Lock Configuration Object Lock Rule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
- object_
lock_ strenabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- object_
lock_ Cosrule Bucket Object Lock Configuration Object Lock Configuration Object Lock Rule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
- object
Lock StringEnabled - Indicates whether this bucket has an Object Lock configuration enabled. Defaults to Enabled. Valid values: Enabled.
- object
Lock Property MapRule Object Lock rule has following argument:
Nested scheme for
object_lock_rule
:
CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRule, CosBucketObjectLockConfigurationObjectLockConfigurationObjectLockRuleArgs
- Default
Retention CosBucket Object Lock Configuration Object Lock Configuration Object Lock Rule Default Retention - 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 CosBucket Object Lock Configuration Object Lock Configuration Object Lock Rule Default Retention - 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 CosBucket Object Lock Configuration Object Lock Configuration Object Lock Rule Default Retention - 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 CosBucket Object Lock Configuration Object Lock Configuration Object Lock Rule Default Retention - 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 CosBucket Object Lock Configuration Object Lock Configuration Object Lock Rule Default Retention - 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 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
CosBucketObjectLockConfigurationTimeouts, CosBucketObjectLockConfigurationTimeoutsArgs
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.