1. Packages
  2. Ionoscloud Provider
  3. API Docs
  4. S3BucketLifecycleConfiguration
ionoscloud 6.7.6 published on Monday, Apr 14, 2025 by ionos-cloud

ionoscloud.S3BucketLifecycleConfiguration

Explore with Pulumi AI

Example Usage

Coming soon!
Coming soon!
Coming soon!
Coming soon!
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.ionoscloud.S3Bucket;
import com.pulumi.ionoscloud.S3BucketLifecycleConfiguration;
import com.pulumi.ionoscloud.S3BucketLifecycleConfigurationArgs;
import com.pulumi.ionoscloud.inputs.S3BucketLifecycleConfigurationRuleArgs;
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 exampleS3Bucket = new S3Bucket("exampleS3Bucket");

        var exampleS3BucketLifecycleConfiguration = new S3BucketLifecycleConfiguration("exampleS3BucketLifecycleConfiguration", S3BucketLifecycleConfigurationArgs.builder()
            .bucket(exampleS3Bucket.name())
            .rules(            
                S3BucketLifecycleConfigurationRuleArgs.builder()
                    .id("1")
                    .status("Enabled")
                    .prefix("/logs")
                    .expiration(S3BucketLifecycleConfigurationRuleExpirationArgs.builder()
                        .days(90)
                        .build())
                    .build(),
                S3BucketLifecycleConfigurationRuleArgs.builder()
                    .id("2")
                    .status("Enabled")
                    .prefix("/logs")
                    .noncurrentVersionExpiration(S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs.builder()
                        .noncurrentDays(90)
                        .build())
                    .build(),
                S3BucketLifecycleConfigurationRuleArgs.builder()
                    .id("3")
                    .status("Enabled")
                    .prefix("/logs")
                    .abortIncompleteMultipartUpload(S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs.builder()
                        .daysAfterInitiation(90)
                        .build())
                    .build())
            .build());

    }
}
Copy
resources:
  exampleS3Bucket:
    type: ionoscloud:S3Bucket
  exampleS3BucketLifecycleConfiguration:
    type: ionoscloud:S3BucketLifecycleConfiguration
    properties:
      bucket: ${exampleS3Bucket.name}
      rules:
        - id: '1'
          status: Enabled
          prefix: /logs
          expiration:
            - days: 90
        - id: '2'
          status: Enabled
          prefix: /logs
          noncurrentVersionExpiration:
            - noncurrentDays: 90
        - id: '3'
          status: Enabled
          prefix: /logs
          abortIncompleteMultipartUpload:
            - daysAfterInitiation: 90
Copy

Create S3BucketLifecycleConfiguration Resource

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

Constructor syntax

new S3BucketLifecycleConfiguration(name: string, args: S3BucketLifecycleConfigurationArgs, opts?: CustomResourceOptions);
@overload
def S3BucketLifecycleConfiguration(resource_name: str,
                                   args: S3BucketLifecycleConfigurationArgs,
                                   opts: Optional[ResourceOptions] = None)

@overload
def S3BucketLifecycleConfiguration(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   bucket: Optional[str] = None,
                                   rules: Optional[Sequence[S3BucketLifecycleConfigurationRuleArgs]] = None)
func NewS3BucketLifecycleConfiguration(ctx *Context, name string, args S3BucketLifecycleConfigurationArgs, opts ...ResourceOption) (*S3BucketLifecycleConfiguration, error)
public S3BucketLifecycleConfiguration(string name, S3BucketLifecycleConfigurationArgs args, CustomResourceOptions? opts = null)
public S3BucketLifecycleConfiguration(String name, S3BucketLifecycleConfigurationArgs args)
public S3BucketLifecycleConfiguration(String name, S3BucketLifecycleConfigurationArgs args, CustomResourceOptions options)
type: ionoscloud:S3BucketLifecycleConfiguration
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. S3BucketLifecycleConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. S3BucketLifecycleConfigurationArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. S3BucketLifecycleConfigurationArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. S3BucketLifecycleConfigurationArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. S3BucketLifecycleConfigurationArgs
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 s3bucketLifecycleConfigurationResource = new Ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", new()
{
    Bucket = "string",
    Rules = new[]
    {
        new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleArgs
        {
            Prefix = "string",
            Status = "string",
            AbortIncompleteMultipartUpload = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs
            {
                DaysAfterInitiation = 0,
            },
            Expiration = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleExpirationArgs
            {
                Date = "string",
                Days = 0,
                ExpiredObjectDeleteMarker = false,
            },
            Id = "string",
            NoncurrentVersionExpiration = new Ionoscloud.Inputs.S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs
            {
                NoncurrentDays = 0,
            },
        },
    },
});
Copy
example, err := ionoscloud.NewS3BucketLifecycleConfiguration(ctx, "s3bucketLifecycleConfigurationResource", &ionoscloud.S3BucketLifecycleConfigurationArgs{
Bucket: pulumi.String("string"),
Rules: .S3BucketLifecycleConfigurationRuleArray{
&.S3BucketLifecycleConfigurationRuleArgs{
Prefix: pulumi.String("string"),
Status: pulumi.String("string"),
AbortIncompleteMultipartUpload: &.S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs{
DaysAfterInitiation: pulumi.Float64(0),
},
Expiration: &.S3BucketLifecycleConfigurationRuleExpirationArgs{
Date: pulumi.String("string"),
Days: pulumi.Float64(0),
ExpiredObjectDeleteMarker: pulumi.Bool(false),
},
Id: pulumi.String("string"),
NoncurrentVersionExpiration: &.S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs{
NoncurrentDays: pulumi.Float64(0),
},
},
},
})
Copy
var s3bucketLifecycleConfigurationResource = new S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", S3BucketLifecycleConfigurationArgs.builder()
    .bucket("string")
    .rules(S3BucketLifecycleConfigurationRuleArgs.builder()
        .prefix("string")
        .status("string")
        .abortIncompleteMultipartUpload(S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs.builder()
            .daysAfterInitiation(0)
            .build())
        .expiration(S3BucketLifecycleConfigurationRuleExpirationArgs.builder()
            .date("string")
            .days(0)
            .expiredObjectDeleteMarker(false)
            .build())
        .id("string")
        .noncurrentVersionExpiration(S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs.builder()
            .noncurrentDays(0)
            .build())
        .build())
    .build());
Copy
s3bucket_lifecycle_configuration_resource = ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource",
    bucket="string",
    rules=[{
        "prefix": "string",
        "status": "string",
        "abort_incomplete_multipart_upload": {
            "days_after_initiation": 0,
        },
        "expiration": {
            "date": "string",
            "days": 0,
            "expired_object_delete_marker": False,
        },
        "id": "string",
        "noncurrent_version_expiration": {
            "noncurrent_days": 0,
        },
    }])
Copy
const s3bucketLifecycleConfigurationResource = new ionoscloud.S3BucketLifecycleConfiguration("s3bucketLifecycleConfigurationResource", {
    bucket: "string",
    rules: [{
        prefix: "string",
        status: "string",
        abortIncompleteMultipartUpload: {
            daysAfterInitiation: 0,
        },
        expiration: {
            date: "string",
            days: 0,
            expiredObjectDeleteMarker: false,
        },
        id: "string",
        noncurrentVersionExpiration: {
            noncurrentDays: 0,
        },
    }],
});
Copy
type: ionoscloud:S3BucketLifecycleConfiguration
properties:
    bucket: string
    rules:
        - abortIncompleteMultipartUpload:
            daysAfterInitiation: 0
          expiration:
            date: string
            days: 0
            expiredObjectDeleteMarker: false
          id: string
          noncurrentVersionExpiration:
            noncurrentDays: 0
          prefix: string
          status: string
Copy

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

Bucket This property is required. string
[string] The name of the bucket where the object will be stored.
Rules List<S3BucketLifecycleConfigurationRule>
A list of lifecycle rules for objects in the bucket.
Bucket This property is required. string
[string] The name of the bucket where the object will be stored.
Rules []S3BucketLifecycleConfigurationRuleArgs
A list of lifecycle rules for objects in the bucket.
bucket This property is required. String
[string] The name of the bucket where the object will be stored.
rules List<S3BucketLifecycleConfigurationRule>
A list of lifecycle rules for objects in the bucket.
bucket This property is required. string
[string] The name of the bucket where the object will be stored.
rules S3BucketLifecycleConfigurationRule[]
A list of lifecycle rules for objects in the bucket.
bucket This property is required. str
[string] The name of the bucket where the object will be stored.
rules Sequence[S3BucketLifecycleConfigurationRuleArgs]
A list of lifecycle rules for objects in the bucket.
bucket This property is required. String
[string] The name of the bucket where the object will be stored.
rules List<Property Map>
A list of lifecycle rules for objects in the bucket.

Outputs

All input properties are implicitly available as output properties. Additionally, the S3BucketLifecycleConfiguration 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 S3BucketLifecycleConfiguration Resource

Get an existing S3BucketLifecycleConfiguration 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?: S3BucketLifecycleConfigurationState, opts?: CustomResourceOptions): S3BucketLifecycleConfiguration
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        rules: Optional[Sequence[S3BucketLifecycleConfigurationRuleArgs]] = None) -> S3BucketLifecycleConfiguration
func GetS3BucketLifecycleConfiguration(ctx *Context, name string, id IDInput, state *S3BucketLifecycleConfigurationState, opts ...ResourceOption) (*S3BucketLifecycleConfiguration, error)
public static S3BucketLifecycleConfiguration Get(string name, Input<string> id, S3BucketLifecycleConfigurationState? state, CustomResourceOptions? opts = null)
public static S3BucketLifecycleConfiguration get(String name, Output<String> id, S3BucketLifecycleConfigurationState state, CustomResourceOptions options)
resources:  _:    type: ionoscloud:S3BucketLifecycleConfiguration    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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:
Bucket string
[string] The name of the bucket where the object will be stored.
Rules List<S3BucketLifecycleConfigurationRule>
A list of lifecycle rules for objects in the bucket.
Bucket string
[string] The name of the bucket where the object will be stored.
Rules []S3BucketLifecycleConfigurationRuleArgs
A list of lifecycle rules for objects in the bucket.
bucket String
[string] The name of the bucket where the object will be stored.
rules List<S3BucketLifecycleConfigurationRule>
A list of lifecycle rules for objects in the bucket.
bucket string
[string] The name of the bucket where the object will be stored.
rules S3BucketLifecycleConfigurationRule[]
A list of lifecycle rules for objects in the bucket.
bucket str
[string] The name of the bucket where the object will be stored.
rules Sequence[S3BucketLifecycleConfigurationRuleArgs]
A list of lifecycle rules for objects in the bucket.
bucket String
[string] The name of the bucket where the object will be stored.
rules List<Property Map>
A list of lifecycle rules for objects in the bucket.

Supporting Types

S3BucketLifecycleConfigurationRule
, S3BucketLifecycleConfigurationRuleArgs

Prefix This property is required. string
Object key prefix identifying one or more objects to which the rule applies.
Status This property is required. string
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
AbortIncompleteMultipartUpload S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
Expiration S3BucketLifecycleConfigurationRuleExpiration
A lifecycle rule for when an object expires.
Id string
Unique identifier for the rule.
NoncurrentVersionExpiration S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
A lifecycle rule for when non-current object versions expire.
Prefix This property is required. string
Object key prefix identifying one or more objects to which the rule applies.
Status This property is required. string
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
AbortIncompleteMultipartUpload S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
Expiration S3BucketLifecycleConfigurationRuleExpiration
A lifecycle rule for when an object expires.
Id string
Unique identifier for the rule.
NoncurrentVersionExpiration S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
A lifecycle rule for when non-current object versions expire.
prefix This property is required. String
Object key prefix identifying one or more objects to which the rule applies.
status This property is required. String
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
abortIncompleteMultipartUpload S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
expiration S3BucketLifecycleConfigurationRuleExpiration
A lifecycle rule for when an object expires.
id String
Unique identifier for the rule.
noncurrentVersionExpiration S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
A lifecycle rule for when non-current object versions expire.
prefix This property is required. string
Object key prefix identifying one or more objects to which the rule applies.
status This property is required. string
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
abortIncompleteMultipartUpload S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
expiration S3BucketLifecycleConfigurationRuleExpiration
A lifecycle rule for when an object expires.
id string
Unique identifier for the rule.
noncurrentVersionExpiration S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
A lifecycle rule for when non-current object versions expire.
prefix This property is required. str
Object key prefix identifying one or more objects to which the rule applies.
status This property is required. str
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
abort_incomplete_multipart_upload S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
expiration S3BucketLifecycleConfigurationRuleExpiration
A lifecycle rule for when an object expires.
id str
Unique identifier for the rule.
noncurrent_version_expiration S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
A lifecycle rule for when non-current object versions expire.
prefix This property is required. String
Object key prefix identifying one or more objects to which the rule applies.
status This property is required. String
Whether the rule is currently being applied. Valid values: Enabled or Disabled.
abortIncompleteMultipartUpload Property Map
Specifies the days since the initiation of an incomplete multipart upload that IONOS Object Storage Object Storage will wait before permanently removing all parts of the upload.
expiration Property Map
A lifecycle rule for when an object expires.
id String
Unique identifier for the rule.
noncurrentVersionExpiration Property Map
A lifecycle rule for when non-current object versions expire.

S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUpload
, S3BucketLifecycleConfigurationRuleAbortIncompleteMultipartUploadArgs

DaysAfterInitiation double
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
DaysAfterInitiation float64
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
daysAfterInitiation Double
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
daysAfterInitiation number
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
days_after_initiation float
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.
daysAfterInitiation Number
Specifies the number of days after which IONOS Object Storage Object Storage aborts an incomplete multipart upload.

S3BucketLifecycleConfigurationRuleExpiration
, S3BucketLifecycleConfigurationRuleExpirationArgs

Date string
Specifies the date when the object expires. Required if 'days' is not specified.
Days double
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
ExpiredObjectDeleteMarker bool
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
Date string
Specifies the date when the object expires. Required if 'days' is not specified.
Days float64
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
ExpiredObjectDeleteMarker bool
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
date String
Specifies the date when the object expires. Required if 'days' is not specified.
days Double
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
expiredObjectDeleteMarker Boolean
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
date string
Specifies the date when the object expires. Required if 'days' is not specified.
days number
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
expiredObjectDeleteMarker boolean
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
date str
Specifies the date when the object expires. Required if 'days' is not specified.
days float
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
expired_object_delete_marker bool
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.
date String
Specifies the date when the object expires. Required if 'days' is not specified.
days Number
Specifies the number of days after object creation when the object expires. Required if 'date' is not specified.
expiredObjectDeleteMarker Boolean
Indicates whether IONOS Object Storage Object Storage will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set to false the policy takes no operation. This cannot be specified with Days or Date in a Lifecycle Expiration Policy.

S3BucketLifecycleConfigurationRuleNoncurrentVersionExpiration
, S3BucketLifecycleConfigurationRuleNoncurrentVersionExpirationArgs

NoncurrentDays double
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
NoncurrentDays float64
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
noncurrentDays Double
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
noncurrentDays number
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
noncurrent_days float
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.
noncurrentDays Number
Specifies the number of days an object is noncurrent before IONOS Object Storage can perform the associated action.

Import

IONOS Object Storage Bucket lifecycle configuration can be imported using the bucket name.

$ pulumi import ionoscloud:index/s3BucketLifecycleConfiguration:S3BucketLifecycleConfiguration example example
Copy

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

Package Details

Repository
ionoscloud ionos-cloud/terraform-provider-ionoscloud
License
Notes
This Pulumi package is based on the ionoscloud Terraform Provider.