1. Packages
  2. Volcengine
  3. API Docs
  4. tos
  5. BucketLifecycle
Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine
volcengine logo
Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine

    Provides a resource to manage tos bucket lifecycle

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as volcengine from "@volcengine/pulumi";
    
    const foo = new volcengine.tos.BucketLifecycle("foo", {
        bucketName: "tflybtest5",
        rules: [
            {
                expiration: {
                    days: 122,
                },
                filter: {
                    greaterThanIncludeEqual: "Enabled",
                    lessThanIncludeEqual: "Disabled",
                    objectSizeGreaterThan: 1024,
                    objectSizeLessThan: 10485760,
                },
                id: "rule1",
                nonCurrentVersionExpiration: {
                    nonCurrentDays: 90,
                },
                nonCurrentVersionTransitions: [
                    {
                        nonCurrentDays: 30,
                        storageClass: "IA",
                    },
                    {
                        nonCurrentDays: 31,
                        storageClass: "ARCHIVE",
                    },
                ],
                prefix: "documents/",
                status: "Enabled",
                tags: [
                    {
                        key: "example1",
                        value: "example-value1",
                    },
                    {
                        key: "example2",
                        value: "example-value2",
                    },
                ],
                transitions: [
                    {
                        days: 7,
                        storageClass: "IA",
                    },
                    {
                        days: 30,
                        storageClass: "ARCHIVE",
                    },
                ],
            },
            {
                expiration: {
                    days: 90,
                },
                id: "rule2",
                nonCurrentVersionExpiration: {
                    nonCurrentDays: 30,
                },
                nonCurrentVersionTransitions: [{
                    nonCurrentDays: 7,
                    storageClass: "IA",
                }],
                prefix: "logs/",
                status: "Enabled",
            },
            {
                abortIncompleteMultipartUpload: {
                    daysAfterInitiation: 1,
                },
                expiration: {
                    date: "2025-12-31T00:00:00.000Z",
                },
                id: "rule3",
                prefix: "temp/",
                status: "Disabled",
            },
        ],
    });
    
    import pulumi
    import pulumi_volcengine as volcengine
    
    foo = volcengine.tos.BucketLifecycle("foo",
        bucket_name="tflybtest5",
        rules=[
            volcengine.tos.BucketLifecycleRuleArgs(
                expiration=volcengine.tos.BucketLifecycleRuleExpirationArgs(
                    days=122,
                ),
                filter=volcengine.tos.BucketLifecycleRuleFilterArgs(
                    greater_than_include_equal="Enabled",
                    less_than_include_equal="Disabled",
                    object_size_greater_than=1024,
                    object_size_less_than=10485760,
                ),
                id="rule1",
                non_current_version_expiration=volcengine.tos.BucketLifecycleRuleNonCurrentVersionExpirationArgs(
                    non_current_days=90,
                ),
                non_current_version_transitions=[
                    volcengine.tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs(
                        non_current_days=30,
                        storage_class="IA",
                    ),
                    volcengine.tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs(
                        non_current_days=31,
                        storage_class="ARCHIVE",
                    ),
                ],
                prefix="documents/",
                status="Enabled",
                tags=[
                    volcengine.tos.BucketLifecycleRuleTagArgs(
                        key="example1",
                        value="example-value1",
                    ),
                    volcengine.tos.BucketLifecycleRuleTagArgs(
                        key="example2",
                        value="example-value2",
                    ),
                ],
                transitions=[
                    volcengine.tos.BucketLifecycleRuleTransitionArgs(
                        days=7,
                        storage_class="IA",
                    ),
                    volcengine.tos.BucketLifecycleRuleTransitionArgs(
                        days=30,
                        storage_class="ARCHIVE",
                    ),
                ],
            ),
            volcengine.tos.BucketLifecycleRuleArgs(
                expiration=volcengine.tos.BucketLifecycleRuleExpirationArgs(
                    days=90,
                ),
                id="rule2",
                non_current_version_expiration=volcengine.tos.BucketLifecycleRuleNonCurrentVersionExpirationArgs(
                    non_current_days=30,
                ),
                non_current_version_transitions=[volcengine.tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs(
                    non_current_days=7,
                    storage_class="IA",
                )],
                prefix="logs/",
                status="Enabled",
            ),
            volcengine.tos.BucketLifecycleRuleArgs(
                abort_incomplete_multipart_upload=volcengine.tos.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs(
                    days_after_initiation=1,
                ),
                expiration=volcengine.tos.BucketLifecycleRuleExpirationArgs(
                    date="2025-12-31T00:00:00.000Z",
                ),
                id="rule3",
                prefix="temp/",
                status="Disabled",
            ),
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    	"github.com/volcengine/pulumi-volcengine/sdk/go/volcengine/tos"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := tos.NewBucketLifecycle(ctx, "foo", &tos.BucketLifecycleArgs{
    			BucketName: pulumi.String("tflybtest5"),
    			Rules: tos.BucketLifecycleRuleArray{
    				&tos.BucketLifecycleRuleArgs{
    					Expiration: &tos.BucketLifecycleRuleExpirationArgs{
    						Days: pulumi.Int(122),
    					},
    					Filter: &tos.BucketLifecycleRuleFilterArgs{
    						GreaterThanIncludeEqual: pulumi.String("Enabled"),
    						LessThanIncludeEqual:    pulumi.String("Disabled"),
    						ObjectSizeGreaterThan:   pulumi.Int(1024),
    						ObjectSizeLessThan:      pulumi.Int(10485760),
    					},
    					Id: pulumi.String("rule1"),
    					NonCurrentVersionExpiration: &tos.BucketLifecycleRuleNonCurrentVersionExpirationArgs{
    						NonCurrentDays: pulumi.Int(90),
    					},
    					NonCurrentVersionTransitions: tos.BucketLifecycleRuleNonCurrentVersionTransitionArray{
    						&tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs{
    							NonCurrentDays: pulumi.Int(30),
    							StorageClass:   pulumi.String("IA"),
    						},
    						&tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs{
    							NonCurrentDays: pulumi.Int(31),
    							StorageClass:   pulumi.String("ARCHIVE"),
    						},
    					},
    					Prefix: pulumi.String("documents/"),
    					Status: pulumi.String("Enabled"),
    					Tags: tos.BucketLifecycleRuleTagArray{
    						&tos.BucketLifecycleRuleTagArgs{
    							Key:   pulumi.String("example1"),
    							Value: pulumi.String("example-value1"),
    						},
    						&tos.BucketLifecycleRuleTagArgs{
    							Key:   pulumi.String("example2"),
    							Value: pulumi.String("example-value2"),
    						},
    					},
    					Transitions: tos.BucketLifecycleRuleTransitionArray{
    						&tos.BucketLifecycleRuleTransitionArgs{
    							Days:         pulumi.Int(7),
    							StorageClass: pulumi.String("IA"),
    						},
    						&tos.BucketLifecycleRuleTransitionArgs{
    							Days:         pulumi.Int(30),
    							StorageClass: pulumi.String("ARCHIVE"),
    						},
    					},
    				},
    				&tos.BucketLifecycleRuleArgs{
    					Expiration: &tos.BucketLifecycleRuleExpirationArgs{
    						Days: pulumi.Int(90),
    					},
    					Id: pulumi.String("rule2"),
    					NonCurrentVersionExpiration: &tos.BucketLifecycleRuleNonCurrentVersionExpirationArgs{
    						NonCurrentDays: pulumi.Int(30),
    					},
    					NonCurrentVersionTransitions: tos.BucketLifecycleRuleNonCurrentVersionTransitionArray{
    						&tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs{
    							NonCurrentDays: pulumi.Int(7),
    							StorageClass:   pulumi.String("IA"),
    						},
    					},
    					Prefix: pulumi.String("logs/"),
    					Status: pulumi.String("Enabled"),
    				},
    				&tos.BucketLifecycleRuleArgs{
    					AbortIncompleteMultipartUpload: &tos.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs{
    						DaysAfterInitiation: pulumi.Int(1),
    					},
    					Expiration: &tos.BucketLifecycleRuleExpirationArgs{
    						Date: pulumi.String("2025-12-31T00:00:00.000Z"),
    					},
    					Id:     pulumi.String("rule3"),
    					Prefix: pulumi.String("temp/"),
    					Status: pulumi.String("Disabled"),
    				},
    			},
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Volcengine = Pulumi.Volcengine;
    
    return await Deployment.RunAsync(() => 
    {
        var foo = new Volcengine.Tos.BucketLifecycle("foo", new()
        {
            BucketName = "tflybtest5",
            Rules = new[]
            {
                new Volcengine.Tos.Inputs.BucketLifecycleRuleArgs
                {
                    Expiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleExpirationArgs
                    {
                        Days = 122,
                    },
                    Filter = new Volcengine.Tos.Inputs.BucketLifecycleRuleFilterArgs
                    {
                        GreaterThanIncludeEqual = "Enabled",
                        LessThanIncludeEqual = "Disabled",
                        ObjectSizeGreaterThan = 1024,
                        ObjectSizeLessThan = 10485760,
                    },
                    Id = "rule1",
                    NonCurrentVersionExpiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionExpirationArgs
                    {
                        NonCurrentDays = 90,
                    },
                    NonCurrentVersionTransitions = new[]
                    {
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionTransitionArgs
                        {
                            NonCurrentDays = 30,
                            StorageClass = "IA",
                        },
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionTransitionArgs
                        {
                            NonCurrentDays = 31,
                            StorageClass = "ARCHIVE",
                        },
                    },
                    Prefix = "documents/",
                    Status = "Enabled",
                    Tags = new[]
                    {
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleTagArgs
                        {
                            Key = "example1",
                            Value = "example-value1",
                        },
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleTagArgs
                        {
                            Key = "example2",
                            Value = "example-value2",
                        },
                    },
                    Transitions = new[]
                    {
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleTransitionArgs
                        {
                            Days = 7,
                            StorageClass = "IA",
                        },
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleTransitionArgs
                        {
                            Days = 30,
                            StorageClass = "ARCHIVE",
                        },
                    },
                },
                new Volcengine.Tos.Inputs.BucketLifecycleRuleArgs
                {
                    Expiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleExpirationArgs
                    {
                        Days = 90,
                    },
                    Id = "rule2",
                    NonCurrentVersionExpiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionExpirationArgs
                    {
                        NonCurrentDays = 30,
                    },
                    NonCurrentVersionTransitions = new[]
                    {
                        new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionTransitionArgs
                        {
                            NonCurrentDays = 7,
                            StorageClass = "IA",
                        },
                    },
                    Prefix = "logs/",
                    Status = "Enabled",
                },
                new Volcengine.Tos.Inputs.BucketLifecycleRuleArgs
                {
                    AbortIncompleteMultipartUpload = new Volcengine.Tos.Inputs.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs
                    {
                        DaysAfterInitiation = 1,
                    },
                    Expiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleExpirationArgs
                    {
                        Date = "2025-12-31T00:00:00.000Z",
                    },
                    Id = "rule3",
                    Prefix = "temp/",
                    Status = "Disabled",
                },
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.volcengine.tos.BucketLifecycle;
    import com.pulumi.volcengine.tos.BucketLifecycleArgs;
    import com.pulumi.volcengine.tos.inputs.BucketLifecycleRuleArgs;
    import com.pulumi.volcengine.tos.inputs.BucketLifecycleRuleExpirationArgs;
    import com.pulumi.volcengine.tos.inputs.BucketLifecycleRuleFilterArgs;
    import com.pulumi.volcengine.tos.inputs.BucketLifecycleRuleNonCurrentVersionExpirationArgs;
    import com.pulumi.volcengine.tos.inputs.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs;
    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 foo = new BucketLifecycle("foo", BucketLifecycleArgs.builder()        
                .bucketName("tflybtest5")
                .rules(            
                    BucketLifecycleRuleArgs.builder()
                        .expiration(BucketLifecycleRuleExpirationArgs.builder()
                            .days(122)
                            .build())
                        .filter(BucketLifecycleRuleFilterArgs.builder()
                            .greaterThanIncludeEqual("Enabled")
                            .lessThanIncludeEqual("Disabled")
                            .objectSizeGreaterThan(1024)
                            .objectSizeLessThan(10485760)
                            .build())
                        .id("rule1")
                        .nonCurrentVersionExpiration(BucketLifecycleRuleNonCurrentVersionExpirationArgs.builder()
                            .nonCurrentDays(90)
                            .build())
                        .nonCurrentVersionTransitions(                    
                            BucketLifecycleRuleNonCurrentVersionTransitionArgs.builder()
                                .nonCurrentDays(30)
                                .storageClass("IA")
                                .build(),
                            BucketLifecycleRuleNonCurrentVersionTransitionArgs.builder()
                                .nonCurrentDays(31)
                                .storageClass("ARCHIVE")
                                .build())
                        .prefix("documents/")
                        .status("Enabled")
                        .tags(                    
                            BucketLifecycleRuleTagArgs.builder()
                                .key("example1")
                                .value("example-value1")
                                .build(),
                            BucketLifecycleRuleTagArgs.builder()
                                .key("example2")
                                .value("example-value2")
                                .build())
                        .transitions(                    
                            BucketLifecycleRuleTransitionArgs.builder()
                                .days(7)
                                .storageClass("IA")
                                .build(),
                            BucketLifecycleRuleTransitionArgs.builder()
                                .days(30)
                                .storageClass("ARCHIVE")
                                .build())
                        .build(),
                    BucketLifecycleRuleArgs.builder()
                        .expiration(BucketLifecycleRuleExpirationArgs.builder()
                            .days(90)
                            .build())
                        .id("rule2")
                        .nonCurrentVersionExpiration(BucketLifecycleRuleNonCurrentVersionExpirationArgs.builder()
                            .nonCurrentDays(30)
                            .build())
                        .nonCurrentVersionTransitions(BucketLifecycleRuleNonCurrentVersionTransitionArgs.builder()
                            .nonCurrentDays(7)
                            .storageClass("IA")
                            .build())
                        .prefix("logs/")
                        .status("Enabled")
                        .build(),
                    BucketLifecycleRuleArgs.builder()
                        .abortIncompleteMultipartUpload(BucketLifecycleRuleAbortIncompleteMultipartUploadArgs.builder()
                            .daysAfterInitiation(1)
                            .build())
                        .expiration(BucketLifecycleRuleExpirationArgs.builder()
                            .date("2025-12-31T00:00:00.000Z")
                            .build())
                        .id("rule3")
                        .prefix("temp/")
                        .status("Disabled")
                        .build())
                .build());
    
        }
    }
    
    resources:
      foo:
        type: volcengine:tos:BucketLifecycle
        properties:
          bucketName: tflybtest5
          rules:
            - expiration:
                days: 122
              filter:
                greaterThanIncludeEqual: Enabled
                lessThanIncludeEqual: Disabled
                objectSizeGreaterThan: 1024
                objectSizeLessThan: 1.048576e+07
              id: rule1
              nonCurrentVersionExpiration:
                nonCurrentDays: 90
              nonCurrentVersionTransitions:
                - nonCurrentDays: 30
                  storageClass: IA
                - nonCurrentDays: 31
                  storageClass: ARCHIVE
              prefix: documents/
              status: Enabled
              tags:
                - key: example1
                  value: example-value1
                - key: example2
                  value: example-value2
              transitions:
                - days: 7
                  storageClass: IA
                - days: 30
                  storageClass: ARCHIVE
            - expiration:
                days: 90
              id: rule2
              nonCurrentVersionExpiration:
                nonCurrentDays: 30
              nonCurrentVersionTransitions:
                - nonCurrentDays: 7
                  storageClass: IA
              prefix: logs/
              status: Enabled
            - abortIncompleteMultipartUpload:
                daysAfterInitiation: 1
              expiration:
                date: 2025-12-31T00:00:00.000Z
              id: rule3
              prefix: temp/
              status: Disabled
    

    Create BucketLifecycle Resource

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

    Constructor syntax

    new BucketLifecycle(name: string, args: BucketLifecycleArgs, opts?: CustomResourceOptions);
    @overload
    def BucketLifecycle(resource_name: str,
                        args: BucketLifecycleArgs,
                        opts: Optional[ResourceOptions] = None)
    
    @overload
    def BucketLifecycle(resource_name: str,
                        opts: Optional[ResourceOptions] = None,
                        bucket_name: Optional[str] = None,
                        rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None)
    func NewBucketLifecycle(ctx *Context, name string, args BucketLifecycleArgs, opts ...ResourceOption) (*BucketLifecycle, error)
    public BucketLifecycle(string name, BucketLifecycleArgs args, CustomResourceOptions? opts = null)
    public BucketLifecycle(String name, BucketLifecycleArgs args)
    public BucketLifecycle(String name, BucketLifecycleArgs args, CustomResourceOptions options)
    
    type: volcengine:tos:BucketLifecycle
    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 BucketLifecycleArgs
    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 BucketLifecycleArgs
    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 BucketLifecycleArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args BucketLifecycleArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args BucketLifecycleArgs
    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 bucketLifecycleResource = new Volcengine.Tos.BucketLifecycle("bucketLifecycleResource", new()
    {
        BucketName = "string",
        Rules = new[]
        {
            new Volcengine.Tos.Inputs.BucketLifecycleRuleArgs
            {
                Status = "string",
                AbortIncompleteMultipartUpload = new Volcengine.Tos.Inputs.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs
                {
                    DaysAfterInitiation = 0,
                },
                Expiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleExpirationArgs
                {
                    Date = "string",
                    Days = 0,
                },
                Filter = new Volcengine.Tos.Inputs.BucketLifecycleRuleFilterArgs
                {
                    GreaterThanIncludeEqual = "string",
                    LessThanIncludeEqual = "string",
                    ObjectSizeGreaterThan = 0,
                    ObjectSizeLessThan = 0,
                },
                Id = "string",
                NonCurrentVersionExpiration = new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionExpirationArgs
                {
                    NonCurrentDays = 0,
                },
                NonCurrentVersionTransitions = new[]
                {
                    new Volcengine.Tos.Inputs.BucketLifecycleRuleNonCurrentVersionTransitionArgs
                    {
                        NonCurrentDays = 0,
                        StorageClass = "string",
                    },
                },
                Prefix = "string",
                Tags = new[]
                {
                    new Volcengine.Tos.Inputs.BucketLifecycleRuleTagArgs
                    {
                        Key = "string",
                        Value = "string",
                    },
                },
                Transitions = new[]
                {
                    new Volcengine.Tos.Inputs.BucketLifecycleRuleTransitionArgs
                    {
                        Date = "string",
                        Days = 0,
                        StorageClass = "string",
                    },
                },
            },
        },
    });
    
    example, err := tos.NewBucketLifecycle(ctx, "bucketLifecycleResource", &tos.BucketLifecycleArgs{
    	BucketName: pulumi.String("string"),
    	Rules: tos.BucketLifecycleRuleArray{
    		&tos.BucketLifecycleRuleArgs{
    			Status: pulumi.String("string"),
    			AbortIncompleteMultipartUpload: &tos.BucketLifecycleRuleAbortIncompleteMultipartUploadArgs{
    				DaysAfterInitiation: pulumi.Int(0),
    			},
    			Expiration: &tos.BucketLifecycleRuleExpirationArgs{
    				Date: pulumi.String("string"),
    				Days: pulumi.Int(0),
    			},
    			Filter: &tos.BucketLifecycleRuleFilterArgs{
    				GreaterThanIncludeEqual: pulumi.String("string"),
    				LessThanIncludeEqual:    pulumi.String("string"),
    				ObjectSizeGreaterThan:   pulumi.Int(0),
    				ObjectSizeLessThan:      pulumi.Int(0),
    			},
    			Id: pulumi.String("string"),
    			NonCurrentVersionExpiration: &tos.BucketLifecycleRuleNonCurrentVersionExpirationArgs{
    				NonCurrentDays: pulumi.Int(0),
    			},
    			NonCurrentVersionTransitions: tos.BucketLifecycleRuleNonCurrentVersionTransitionArray{
    				&tos.BucketLifecycleRuleNonCurrentVersionTransitionArgs{
    					NonCurrentDays: pulumi.Int(0),
    					StorageClass:   pulumi.String("string"),
    				},
    			},
    			Prefix: pulumi.String("string"),
    			Tags: tos.BucketLifecycleRuleTagArray{
    				&tos.BucketLifecycleRuleTagArgs{
    					Key:   pulumi.String("string"),
    					Value: pulumi.String("string"),
    				},
    			},
    			Transitions: tos.BucketLifecycleRuleTransitionArray{
    				&tos.BucketLifecycleRuleTransitionArgs{
    					Date:         pulumi.String("string"),
    					Days:         pulumi.Int(0),
    					StorageClass: pulumi.String("string"),
    				},
    			},
    		},
    	},
    })
    
    var bucketLifecycleResource = new BucketLifecycle("bucketLifecycleResource", BucketLifecycleArgs.builder()
        .bucketName("string")
        .rules(BucketLifecycleRuleArgs.builder()
            .status("string")
            .abortIncompleteMultipartUpload(BucketLifecycleRuleAbortIncompleteMultipartUploadArgs.builder()
                .daysAfterInitiation(0)
                .build())
            .expiration(BucketLifecycleRuleExpirationArgs.builder()
                .date("string")
                .days(0)
                .build())
            .filter(BucketLifecycleRuleFilterArgs.builder()
                .greaterThanIncludeEqual("string")
                .lessThanIncludeEqual("string")
                .objectSizeGreaterThan(0)
                .objectSizeLessThan(0)
                .build())
            .id("string")
            .nonCurrentVersionExpiration(BucketLifecycleRuleNonCurrentVersionExpirationArgs.builder()
                .nonCurrentDays(0)
                .build())
            .nonCurrentVersionTransitions(BucketLifecycleRuleNonCurrentVersionTransitionArgs.builder()
                .nonCurrentDays(0)
                .storageClass("string")
                .build())
            .prefix("string")
            .tags(BucketLifecycleRuleTagArgs.builder()
                .key("string")
                .value("string")
                .build())
            .transitions(BucketLifecycleRuleTransitionArgs.builder()
                .date("string")
                .days(0)
                .storageClass("string")
                .build())
            .build())
        .build());
    
    bucket_lifecycle_resource = volcengine.tos.BucketLifecycle("bucketLifecycleResource",
        bucket_name="string",
        rules=[{
            "status": "string",
            "abort_incomplete_multipart_upload": {
                "days_after_initiation": 0,
            },
            "expiration": {
                "date": "string",
                "days": 0,
            },
            "filter": {
                "greater_than_include_equal": "string",
                "less_than_include_equal": "string",
                "object_size_greater_than": 0,
                "object_size_less_than": 0,
            },
            "id": "string",
            "non_current_version_expiration": {
                "non_current_days": 0,
            },
            "non_current_version_transitions": [{
                "non_current_days": 0,
                "storage_class": "string",
            }],
            "prefix": "string",
            "tags": [{
                "key": "string",
                "value": "string",
            }],
            "transitions": [{
                "date": "string",
                "days": 0,
                "storage_class": "string",
            }],
        }])
    
    const bucketLifecycleResource = new volcengine.tos.BucketLifecycle("bucketLifecycleResource", {
        bucketName: "string",
        rules: [{
            status: "string",
            abortIncompleteMultipartUpload: {
                daysAfterInitiation: 0,
            },
            expiration: {
                date: "string",
                days: 0,
            },
            filter: {
                greaterThanIncludeEqual: "string",
                lessThanIncludeEqual: "string",
                objectSizeGreaterThan: 0,
                objectSizeLessThan: 0,
            },
            id: "string",
            nonCurrentVersionExpiration: {
                nonCurrentDays: 0,
            },
            nonCurrentVersionTransitions: [{
                nonCurrentDays: 0,
                storageClass: "string",
            }],
            prefix: "string",
            tags: [{
                key: "string",
                value: "string",
            }],
            transitions: [{
                date: "string",
                days: 0,
                storageClass: "string",
            }],
        }],
    });
    
    type: volcengine:tos:BucketLifecycle
    properties:
        bucketName: string
        rules:
            - abortIncompleteMultipartUpload:
                daysAfterInitiation: 0
              expiration:
                date: string
                days: 0
              filter:
                greaterThanIncludeEqual: string
                lessThanIncludeEqual: string
                objectSizeGreaterThan: 0
                objectSizeLessThan: 0
              id: string
              nonCurrentVersionExpiration:
                nonCurrentDays: 0
              nonCurrentVersionTransitions:
                - nonCurrentDays: 0
                  storageClass: string
              prefix: string
              status: string
              tags:
                - key: string
                  value: string
              transitions:
                - date: string
                  days: 0
                  storageClass: string
    

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

    BucketName string
    The name of the TOS bucket.
    Rules List<BucketLifecycleRule>
    The lifecycle rules of the bucket.
    BucketName string
    The name of the TOS bucket.
    Rules []BucketLifecycleRuleArgs
    The lifecycle rules of the bucket.
    bucketName String
    The name of the TOS bucket.
    rules List<BucketLifecycleRule>
    The lifecycle rules of the bucket.
    bucketName string
    The name of the TOS bucket.
    rules BucketLifecycleRule[]
    The lifecycle rules of the bucket.
    bucket_name str
    The name of the TOS bucket.
    rules Sequence[BucketLifecycleRuleArgs]
    The lifecycle rules of the bucket.
    bucketName String
    The name of the TOS bucket.
    rules List<Property Map>
    The lifecycle rules of the bucket.

    Outputs

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

    Get an existing BucketLifecycle 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?: BucketLifecycleState, opts?: CustomResourceOptions): BucketLifecycle
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            bucket_name: Optional[str] = None,
            rules: Optional[Sequence[BucketLifecycleRuleArgs]] = None) -> BucketLifecycle
    func GetBucketLifecycle(ctx *Context, name string, id IDInput, state *BucketLifecycleState, opts ...ResourceOption) (*BucketLifecycle, error)
    public static BucketLifecycle Get(string name, Input<string> id, BucketLifecycleState? state, CustomResourceOptions? opts = null)
    public static BucketLifecycle get(String name, Output<String> id, BucketLifecycleState state, CustomResourceOptions options)
    resources:  _:    type: volcengine:tos:BucketLifecycle    get:      id: ${id}
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    resource_name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    name
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    state
    Any extra arguments used during the lookup.
    opts
    A bag of options that control this resource's behavior.
    The following state arguments are supported:
    BucketName string
    The name of the TOS bucket.
    Rules List<BucketLifecycleRule>
    The lifecycle rules of the bucket.
    BucketName string
    The name of the TOS bucket.
    Rules []BucketLifecycleRuleArgs
    The lifecycle rules of the bucket.
    bucketName String
    The name of the TOS bucket.
    rules List<BucketLifecycleRule>
    The lifecycle rules of the bucket.
    bucketName string
    The name of the TOS bucket.
    rules BucketLifecycleRule[]
    The lifecycle rules of the bucket.
    bucket_name str
    The name of the TOS bucket.
    rules Sequence[BucketLifecycleRuleArgs]
    The lifecycle rules of the bucket.
    bucketName String
    The name of the TOS bucket.
    rules List<Property Map>
    The lifecycle rules of the bucket.

    Supporting Types

    BucketLifecycleRule, BucketLifecycleRuleArgs

    Status string
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    AbortIncompleteMultipartUpload BucketLifecycleRuleAbortIncompleteMultipartUpload
    The abort incomplete multipart upload configuration of the lifecycle rule.
    Expiration BucketLifecycleRuleExpiration
    The expiration configuration of the lifecycle rule.
    Filter BucketLifecycleRuleFilter
    The filter configuration of the lifecycle rule.
    Id string
    The ID of the lifecycle rule.
    NonCurrentVersionExpiration BucketLifecycleRuleNonCurrentVersionExpiration
    The non-current version expiration configuration of the lifecycle rule.
    NonCurrentVersionTransitions List<BucketLifecycleRuleNonCurrentVersionTransition>
    The non-current version transition configuration of the lifecycle rule.
    Prefix string
    The prefix of the lifecycle rule.
    Tags List<BucketLifecycleRuleTag>
    The tag filters.
    Transitions List<BucketLifecycleRuleTransition>
    The transition configuration of the lifecycle rule.
    Status string
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    AbortIncompleteMultipartUpload BucketLifecycleRuleAbortIncompleteMultipartUpload
    The abort incomplete multipart upload configuration of the lifecycle rule.
    Expiration BucketLifecycleRuleExpiration
    The expiration configuration of the lifecycle rule.
    Filter BucketLifecycleRuleFilter
    The filter configuration of the lifecycle rule.
    Id string
    The ID of the lifecycle rule.
    NonCurrentVersionExpiration BucketLifecycleRuleNonCurrentVersionExpiration
    The non-current version expiration configuration of the lifecycle rule.
    NonCurrentVersionTransitions []BucketLifecycleRuleNonCurrentVersionTransition
    The non-current version transition configuration of the lifecycle rule.
    Prefix string
    The prefix of the lifecycle rule.
    Tags []BucketLifecycleRuleTag
    The tag filters.
    Transitions []BucketLifecycleRuleTransition
    The transition configuration of the lifecycle rule.
    status String
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    abortIncompleteMultipartUpload BucketLifecycleRuleAbortIncompleteMultipartUpload
    The abort incomplete multipart upload configuration of the lifecycle rule.
    expiration BucketLifecycleRuleExpiration
    The expiration configuration of the lifecycle rule.
    filter BucketLifecycleRuleFilter
    The filter configuration of the lifecycle rule.
    id String
    The ID of the lifecycle rule.
    nonCurrentVersionExpiration BucketLifecycleRuleNonCurrentVersionExpiration
    The non-current version expiration configuration of the lifecycle rule.
    nonCurrentVersionTransitions List<BucketLifecycleRuleNonCurrentVersionTransition>
    The non-current version transition configuration of the lifecycle rule.
    prefix String
    The prefix of the lifecycle rule.
    tags List<BucketLifecycleRuleTag>
    The tag filters.
    transitions List<BucketLifecycleRuleTransition>
    The transition configuration of the lifecycle rule.
    status string
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    abortIncompleteMultipartUpload BucketLifecycleRuleAbortIncompleteMultipartUpload
    The abort incomplete multipart upload configuration of the lifecycle rule.
    expiration BucketLifecycleRuleExpiration
    The expiration configuration of the lifecycle rule.
    filter BucketLifecycleRuleFilter
    The filter configuration of the lifecycle rule.
    id string
    The ID of the lifecycle rule.
    nonCurrentVersionExpiration BucketLifecycleRuleNonCurrentVersionExpiration
    The non-current version expiration configuration of the lifecycle rule.
    nonCurrentVersionTransitions BucketLifecycleRuleNonCurrentVersionTransition[]
    The non-current version transition configuration of the lifecycle rule.
    prefix string
    The prefix of the lifecycle rule.
    tags BucketLifecycleRuleTag[]
    The tag filters.
    transitions BucketLifecycleRuleTransition[]
    The transition configuration of the lifecycle rule.
    status str
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    abort_incomplete_multipart_upload BucketLifecycleRuleAbortIncompleteMultipartUpload
    The abort incomplete multipart upload configuration of the lifecycle rule.
    expiration BucketLifecycleRuleExpiration
    The expiration configuration of the lifecycle rule.
    filter BucketLifecycleRuleFilter
    The filter configuration of the lifecycle rule.
    id str
    The ID of the lifecycle rule.
    non_current_version_expiration BucketLifecycleRuleNonCurrentVersionExpiration
    The non-current version expiration configuration of the lifecycle rule.
    non_current_version_transitions Sequence[BucketLifecycleRuleNonCurrentVersionTransition]
    The non-current version transition configuration of the lifecycle rule.
    prefix str
    The prefix of the lifecycle rule.
    tags Sequence[BucketLifecycleRuleTag]
    The tag filters.
    transitions Sequence[BucketLifecycleRuleTransition]
    The transition configuration of the lifecycle rule.
    status String
    The status of the lifecycle rule. Valid values: Enabled, Disabled.
    abortIncompleteMultipartUpload Property Map
    The abort incomplete multipart upload configuration of the lifecycle rule.
    expiration Property Map
    The expiration configuration of the lifecycle rule.
    filter Property Map
    The filter configuration of the lifecycle rule.
    id String
    The ID of the lifecycle rule.
    nonCurrentVersionExpiration Property Map
    The non-current version expiration configuration of the lifecycle rule.
    nonCurrentVersionTransitions List<Property Map>
    The non-current version transition configuration of the lifecycle rule.
    prefix String
    The prefix of the lifecycle rule.
    tags List<Property Map>
    The tag filters.
    transitions List<Property Map>
    The transition configuration of the lifecycle rule.

    BucketLifecycleRuleAbortIncompleteMultipartUpload, BucketLifecycleRuleAbortIncompleteMultipartUploadArgs

    DaysAfterInitiation int
    The number of days after initiation when the incomplete multipart upload should be aborted.
    DaysAfterInitiation int
    The number of days after initiation when the incomplete multipart upload should be aborted.
    daysAfterInitiation Integer
    The number of days after initiation when the incomplete multipart upload should be aborted.
    daysAfterInitiation number
    The number of days after initiation when the incomplete multipart upload should be aborted.
    days_after_initiation int
    The number of days after initiation when the incomplete multipart upload should be aborted.
    daysAfterInitiation Number
    The number of days after initiation when the incomplete multipart upload should be aborted.

    BucketLifecycleRuleExpiration, BucketLifecycleRuleExpirationArgs

    Date string
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    Days int
    The number of days after object creation when the rule takes effect.
    Date string
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    Days int
    The number of days after object creation when the rule takes effect.
    date String
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    days Integer
    The number of days after object creation when the rule takes effect.
    date string
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    days number
    The number of days after object creation when the rule takes effect.
    date str
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    days int
    The number of days after object creation when the rule takes effect.
    date String
    The date when the rule takes effect. Format: 2023-01-01T00:00:00.000Z.
    days Number
    The number of days after object creation when the rule takes effect.

    BucketLifecycleRuleFilter, BucketLifecycleRuleFilterArgs

    GreaterThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    LessThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    ObjectSizeGreaterThan int
    The minimum object size in bytes for the rule to apply.
    ObjectSizeLessThan int
    The maximum object size in bytes for the rule to apply.
    GreaterThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    LessThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    ObjectSizeGreaterThan int
    The minimum object size in bytes for the rule to apply.
    ObjectSizeLessThan int
    The maximum object size in bytes for the rule to apply.
    greaterThanIncludeEqual String
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    lessThanIncludeEqual String
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    objectSizeGreaterThan Integer
    The minimum object size in bytes for the rule to apply.
    objectSizeLessThan Integer
    The maximum object size in bytes for the rule to apply.
    greaterThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    lessThanIncludeEqual string
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    objectSizeGreaterThan number
    The minimum object size in bytes for the rule to apply.
    objectSizeLessThan number
    The maximum object size in bytes for the rule to apply.
    greater_than_include_equal str
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    less_than_include_equal str
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    object_size_greater_than int
    The minimum object size in bytes for the rule to apply.
    object_size_less_than int
    The maximum object size in bytes for the rule to apply.
    greaterThanIncludeEqual String
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    lessThanIncludeEqual String
    Whether to enable equal conditions. The value can only be "Enabled" or "Disabled". If not configured, it will default to "Disabled".
    objectSizeGreaterThan Number
    The minimum object size in bytes for the rule to apply.
    objectSizeLessThan Number
    The maximum object size in bytes for the rule to apply.

    BucketLifecycleRuleNonCurrentVersionExpiration, BucketLifecycleRuleNonCurrentVersionExpirationArgs

    NonCurrentDays int
    The number of days after object creation when the non-current version expiration takes effect.
    NonCurrentDays int
    The number of days after object creation when the non-current version expiration takes effect.
    nonCurrentDays Integer
    The number of days after object creation when the non-current version expiration takes effect.
    nonCurrentDays number
    The number of days after object creation when the non-current version expiration takes effect.
    non_current_days int
    The number of days after object creation when the non-current version expiration takes effect.
    nonCurrentDays Number
    The number of days after object creation when the non-current version expiration takes effect.

    BucketLifecycleRuleNonCurrentVersionTransition, BucketLifecycleRuleNonCurrentVersionTransitionArgs

    NonCurrentDays int
    The number of days after object creation when the non-current version transition takes effect.
    StorageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    NonCurrentDays int
    The number of days after object creation when the non-current version transition takes effect.
    StorageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    nonCurrentDays Integer
    The number of days after object creation when the non-current version transition takes effect.
    storageClass String
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    nonCurrentDays number
    The number of days after object creation when the non-current version transition takes effect.
    storageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    non_current_days int
    The number of days after object creation when the non-current version transition takes effect.
    storage_class str
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    nonCurrentDays Number
    The number of days after object creation when the non-current version transition takes effect.
    storageClass String
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.

    BucketLifecycleRuleTag, BucketLifecycleRuleTagArgs

    Key string
    The key of the tag.
    Value string
    The value of the tag.
    Key string
    The key of the tag.
    Value string
    The value of the tag.
    key String
    The key of the tag.
    value String
    The value of the tag.
    key string
    The key of the tag.
    value string
    The value of the tag.
    key str
    The key of the tag.
    value str
    The value of the tag.
    key String
    The key of the tag.
    value String
    The value of the tag.

    BucketLifecycleRuleTransition, BucketLifecycleRuleTransitionArgs

    Date string
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    Days int
    The number of days after object creation when the transition takes effect.
    StorageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    Date string
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    Days int
    The number of days after object creation when the transition takes effect.
    StorageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    date String
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    days Integer
    The number of days after object creation when the transition takes effect.
    storageClass String
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    date string
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    days number
    The number of days after object creation when the transition takes effect.
    storageClass string
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    date str
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    days int
    The number of days after object creation when the transition takes effect.
    storage_class str
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.
    date String
    The date when the transition takes effect. Format: 2023-01-01T00:00:00.000Z.
    days Number
    The number of days after object creation when the transition takes effect.
    storageClass String
    The storage class to transition to. Valid values: IA, ARCHIVE, COLD_ARCHIVE.

    Import

    TosBucketLifecycle can be imported using the bucketName, e.g.

    $ pulumi import volcengine:tos/bucketLifecycle:BucketLifecycle default bucket_name
    

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

    Package Details

    Repository
    volcengine volcengine/pulumi-volcengine
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the volcengine Terraform Provider.
    volcengine logo
    Volcengine v0.0.43 published on Friday, Jan 16, 2026 by Volcengine
      Meet Neo: Your AI Platform Teammate