published on Monday, Aug 17, 2026 by stackitcloud
published on Monday, Aug 17, 2026 by stackitcloud
ObjectStorage default-retention resource schema. Must have a region specified in the provider configuration.
Example Usage
resource "stackit_objectstorage_compliance_lock" "example_lock" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
resource "stackit_objectstorage_bucket" "bucket_object_lock" {
depends_on = [stackit_objectstorage_compliance_lock.example_lock]
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
name = "example-bucket-with-lock"
object_lock = true
}
resource "stackit_objectstorage_default_retention" "example" {
project_id = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
bucket_name = stackit_objectstorage_bucket.bucket_object_lock.name
days = 2
mode = "GOVERNANCE"
}
Create ObjectstorageDefaultRetention Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ObjectstorageDefaultRetention(name: string, args: ObjectstorageDefaultRetentionArgs, opts?: CustomResourceOptions);@overload
def ObjectstorageDefaultRetention(resource_name: str,
args: ObjectstorageDefaultRetentionArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ObjectstorageDefaultRetention(resource_name: str,
opts: Optional[ResourceOptions] = None,
bucket_name: Optional[str] = None,
days: Optional[int] = None,
mode: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None)func NewObjectstorageDefaultRetention(ctx *Context, name string, args ObjectstorageDefaultRetentionArgs, opts ...ResourceOption) (*ObjectstorageDefaultRetention, error)public ObjectstorageDefaultRetention(string name, ObjectstorageDefaultRetentionArgs args, CustomResourceOptions? opts = null)
public ObjectstorageDefaultRetention(String name, ObjectstorageDefaultRetentionArgs args)
public ObjectstorageDefaultRetention(String name, ObjectstorageDefaultRetentionArgs args, CustomResourceOptions options)
type: stackit:ObjectstorageDefaultRetention
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
resource "stackit_objectstorage_default_retention" "name" {
# resource properties
}Parameters
- name string
- The unique name of the resource.
- args ObjectstorageDefaultRetentionArgs
- 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 ObjectstorageDefaultRetentionArgs
- 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 ObjectstorageDefaultRetentionArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ObjectstorageDefaultRetentionArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ObjectstorageDefaultRetentionArgs
- 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 objectstorageDefaultRetentionResource = new Stackit.ObjectstorageDefaultRetention("objectstorageDefaultRetentionResource", new()
{
BucketName = "string",
Days = 0,
Mode = "string",
ProjectId = "string",
Region = "string",
});
example, err := stackit.NewObjectstorageDefaultRetention(ctx, "objectstorageDefaultRetentionResource", &stackit.ObjectstorageDefaultRetentionArgs{
BucketName: pulumi.String("string"),
Days: pulumi.Int(0),
Mode: pulumi.String("string"),
ProjectId: pulumi.String("string"),
Region: pulumi.String("string"),
})
resource "stackit_objectstorage_default_retention" "objectstorageDefaultRetentionResource" {
lifecycle {
create_before_destroy = true
}
bucket_name = "string"
days = 0
mode = "string"
project_id = "string"
region = "string"
}
var objectstorageDefaultRetentionResource = new ObjectstorageDefaultRetention("objectstorageDefaultRetentionResource", ObjectstorageDefaultRetentionArgs.builder()
.bucketName("string")
.days(0)
.mode("string")
.projectId("string")
.region("string")
.build());
objectstorage_default_retention_resource = stackit.ObjectstorageDefaultRetention("objectstorageDefaultRetentionResource",
bucket_name="string",
days=0,
mode="string",
project_id="string",
region="string")
const objectstorageDefaultRetentionResource = new stackit.ObjectstorageDefaultRetention("objectstorageDefaultRetentionResource", {
bucketName: "string",
days: 0,
mode: "string",
projectId: "string",
region: "string",
});
type: stackit:ObjectstorageDefaultRetention
properties:
bucketName: string
days: 0
mode: string
projectId: string
region: string
ObjectstorageDefaultRetention 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 ObjectstorageDefaultRetention resource accepts the following input properties:
- Bucket
Name string - The associated bucket's name. It must be DNS conform.
- Days int
- The number retention period in days.
- Mode string
- The retention mode for default retention on a bucket.
- Project
Id string - STACKIT Project ID to which the default-retention is associated.
- Region string
- The resource region. If not defined, the provider region is used.
- Bucket
Name string - The associated bucket's name. It must be DNS conform.
- Days int
- The number retention period in days.
- Mode string
- The retention mode for default retention on a bucket.
- Project
Id string - STACKIT Project ID to which the default-retention is associated.
- Region string
- The resource region. If not defined, the provider region is used.
- bucket_
name string - The associated bucket's name. It must be DNS conform.
- days number
- The number retention period in days.
- mode string
- The retention mode for default retention on a bucket.
- project_
id string - STACKIT Project ID to which the default-retention is associated.
- region string
- The resource region. If not defined, the provider region is used.
- bucket
Name String - The associated bucket's name. It must be DNS conform.
- days Integer
- The number retention period in days.
- mode String
- The retention mode for default retention on a bucket.
- project
Id String - STACKIT Project ID to which the default-retention is associated.
- region String
- The resource region. If not defined, the provider region is used.
- bucket
Name string - The associated bucket's name. It must be DNS conform.
- days number
- The number retention period in days.
- mode string
- The retention mode for default retention on a bucket.
- project
Id string - STACKIT Project ID to which the default-retention is associated.
- region string
- The resource region. If not defined, the provider region is used.
- bucket_
name str - The associated bucket's name. It must be DNS conform.
- days int
- The number retention period in days.
- mode str
- The retention mode for default retention on a bucket.
- project_
id str - STACKIT Project ID to which the default-retention is associated.
- region str
- The resource region. If not defined, the provider region is used.
- bucket
Name String - The associated bucket's name. It must be DNS conform.
- days Number
- The number retention period in days.
- mode String
- The retention mode for default retention on a bucket.
- project
Id String - STACKIT Project ID to which the default-retention is associated.
- region String
- The resource region. If not defined, the provider region is used.
Outputs
All input properties are implicitly available as output properties. Additionally, the ObjectstorageDefaultRetention 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 ObjectstorageDefaultRetention Resource
Get an existing ObjectstorageDefaultRetention 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?: ObjectstorageDefaultRetentionState, opts?: CustomResourceOptions): ObjectstorageDefaultRetention@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
bucket_name: Optional[str] = None,
days: Optional[int] = None,
mode: Optional[str] = None,
project_id: Optional[str] = None,
region: Optional[str] = None) -> ObjectstorageDefaultRetentionfunc GetObjectstorageDefaultRetention(ctx *Context, name string, id IDInput, state *ObjectstorageDefaultRetentionState, opts ...ResourceOption) (*ObjectstorageDefaultRetention, error)public static ObjectstorageDefaultRetention Get(string name, Input<string> id, ObjectstorageDefaultRetentionState? state, CustomResourceOptions? opts = null)public static ObjectstorageDefaultRetention get(String name, Output<String> id, ObjectstorageDefaultRetentionState state, CustomResourceOptions options)resources: _: type: stackit:ObjectstorageDefaultRetention get: id: ${id}import {
to = stackit_objectstorage_default_retention.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.
- Bucket
Name string - The associated bucket's name. It must be DNS conform.
- Days int
- The number retention period in days.
- Mode string
- The retention mode for default retention on a bucket.
- Project
Id string - STACKIT Project ID to which the default-retention is associated.
- Region string
- The resource region. If not defined, the provider region is used.
- Bucket
Name string - The associated bucket's name. It must be DNS conform.
- Days int
- The number retention period in days.
- Mode string
- The retention mode for default retention on a bucket.
- Project
Id string - STACKIT Project ID to which the default-retention is associated.
- Region string
- The resource region. If not defined, the provider region is used.
- bucket_
name string - The associated bucket's name. It must be DNS conform.
- days number
- The number retention period in days.
- mode string
- The retention mode for default retention on a bucket.
- project_
id string - STACKIT Project ID to which the default-retention is associated.
- region string
- The resource region. If not defined, the provider region is used.
- bucket
Name String - The associated bucket's name. It must be DNS conform.
- days Integer
- The number retention period in days.
- mode String
- The retention mode for default retention on a bucket.
- project
Id String - STACKIT Project ID to which the default-retention is associated.
- region String
- The resource region. If not defined, the provider region is used.
- bucket
Name string - The associated bucket's name. It must be DNS conform.
- days number
- The number retention period in days.
- mode string
- The retention mode for default retention on a bucket.
- project
Id string - STACKIT Project ID to which the default-retention is associated.
- region string
- The resource region. If not defined, the provider region is used.
- bucket_
name str - The associated bucket's name. It must be DNS conform.
- days int
- The number retention period in days.
- mode str
- The retention mode for default retention on a bucket.
- project_
id str - STACKIT Project ID to which the default-retention is associated.
- region str
- The resource region. If not defined, the provider region is used.
- bucket
Name String - The associated bucket's name. It must be DNS conform.
- days Number
- The number retention period in days.
- mode String
- The retention mode for default retention on a bucket.
- project
Id String - STACKIT Project ID to which the default-retention is associated.
- region String
- The resource region. If not defined, the provider region is used.
Import
In Terraform v1.5.0 and later, the + "" + import + “" + block can be used with the + "” + id + “" + attribute, for example:
# Only use the import statement, if you want to import an existing objectstorage default retention
import {
to = stackit_objectstorage_default_retention.import-example
id = "${var.project_id},${var.region},${var.bucket_name}"
}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- stackit stackitcloud/pulumi-stackit
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
stackitTerraform Provider.
published on Monday, Aug 17, 2026 by stackitcloud