aws.s3.BucketLifecycleConfigurationV2
Explore with Pulumi AI
Provides an independent configuration resource for S3 bucket lifecycle configuration.
An S3 Lifecycle configuration consists of one or more Lifecycle rules. Each rule consists of the following:
- Rule metadata (idandstatus)
- Filter identifying objects to which the rule applies
- One or more transition or expiration actions
For more information see the Amazon S3 User Guide on Lifecycle Configuration Elements.
S3 Buckets only support a single lifecycle configuration. Declaring multiple
aws.s3.BucketLifecycleConfigurationV2resources to the same S3 Bucket will cause a perpetual difference in configuration.
Lifecycle configurations may take some time to fully propagate to all AWS S3 systems. Running Pulumi operations shortly after creating a lifecycle configuration may result in changes that affect configuration idempotence. See the Amazon S3 User Guide on setting lifecycle configuration on a bucket.
Example Usage
With neither a filter nor prefix specified
The Lifecycle rule applies to a subset of objects based on the key name prefix ("").
This configuration is intended to replicate the default behavior of the lifecycle_rule
parameter in the AWS Provider aws.s3.BucketV2 resource prior to v4.0.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id:     pulumi.String("rule-1"),
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          status: Enabled
Specifying an empty filter
The Lifecycle rule applies to all objects in the bucket.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {},
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {},
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id:     pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = null,
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter()
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter: {}
          status: Enabled
Specifying a filter using key prefixes
The Lifecycle rule applies to a subset of objects based on the key name prefix (logs/).
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {
            prefix: "logs/",
        },
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {
            "prefix": "logs/",
        },
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Prefix: pulumi.String("logs/"),
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Prefix = "logs/",
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .prefix("logs/")
                    .build())
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            prefix: logs/
          status: Enabled
If you want to apply a Lifecycle action to a subset of objects based on different key name prefixes, specify separate rules.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [
        {
            id: "rule-1",
            filter: {
                prefix: "logs/",
            },
            status: "Enabled",
        },
        {
            id: "rule-2",
            filter: {
                prefix: "tmp/",
            },
            status: "Enabled",
        },
    ],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[
        {
            "id": "rule-1",
            "filter": {
                "prefix": "logs/",
            },
            "status": "Enabled",
        },
        {
            "id": "rule-2",
            "filter": {
                "prefix": "tmp/",
            },
            "status": "Enabled",
        },
    ])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Prefix: pulumi.String("logs/"),
					},
					Status: pulumi.String("Enabled"),
				},
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-2"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Prefix: pulumi.String("tmp/"),
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Prefix = "logs/",
                },
                Status = "Enabled",
            },
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-2",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Prefix = "tmp/",
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(            
                BucketLifecycleConfigurationV2RuleArgs.builder()
                    .id("rule-1")
                    .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                        .prefix("logs/")
                        .build())
                    .status("Enabled")
                    .build(),
                BucketLifecycleConfigurationV2RuleArgs.builder()
                    .id("rule-2")
                    .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                        .prefix("tmp/")
                        .build())
                    .status("Enabled")
                    .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            prefix: logs/
          status: Enabled
        - id: rule-2
          filter:
            prefix: tmp/
          status: Enabled
Specifying a filter based on an object tag
The Lifecycle rule specifies a filter based on a tag key and value. The rule then applies only to a subset of objects with the specific tag.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {
            tag: {
                key: "Name",
                value: "Staging",
            },
        },
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {
            "tag": {
                "key": "Name",
                "value": "Staging",
            },
        },
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Tag: &s3.BucketLifecycleConfigurationV2RuleFilterTagArgs{
							Key:   pulumi.String("Name"),
							Value: pulumi.String("Staging"),
						},
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Tag = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterTagArgs
                    {
                        Key = "Name",
                        Value = "Staging",
                    },
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterTagArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .tag(BucketLifecycleConfigurationV2RuleFilterTagArgs.builder()
                        .key("Name")
                        .value("Staging")
                        .build())
                    .build())
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            tag:
              key: Name
              value: Staging
          status: Enabled
Specifying a filter based on multiple tags
The Lifecycle rule directs Amazon S3 to perform lifecycle actions on objects with two tags (with the specific tag keys and values). Notice tags is wrapped in the and configuration block.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {
            and: {
                tags: {
                    Key1: "Value1",
                    Key2: "Value2",
                },
            },
        },
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {
            "and_": {
                "tags": {
                    "Key1": "Value1",
                    "Key2": "Value2",
                },
            },
        },
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						And: &s3.BucketLifecycleConfigurationV2RuleFilterAndArgs{
							Tags: pulumi.StringMap{
								"Key1": pulumi.String("Value1"),
								"Key2": pulumi.String("Value2"),
							},
						},
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    And = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs
                    {
                        Tags = 
                        {
                            { "Key1", "Value1" },
                            { "Key2", "Value2" },
                        },
                    },
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .and(BucketLifecycleConfigurationV2RuleFilterAndArgs.builder()
                        .tags(Map.ofEntries(
                            Map.entry("Key1", "Value1"),
                            Map.entry("Key2", "Value2")
                        ))
                        .build())
                    .build())
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            and:
              tags:
                Key1: Value1
                Key2: Value2
          status: Enabled
Specifying a filter based on both prefix and one or more tags
The Lifecycle rule directs Amazon S3 to perform lifecycle actions on objects with the specified prefix and two tags (with the specific tag keys and values). Notice both prefix and tags are wrapped in the and configuration block.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {
            and: {
                prefix: "logs/",
                tags: {
                    Key1: "Value1",
                    Key2: "Value2",
                },
            },
        },
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {
            "and_": {
                "prefix": "logs/",
                "tags": {
                    "Key1": "Value1",
                    "Key2": "Value2",
                },
            },
        },
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						And: &s3.BucketLifecycleConfigurationV2RuleFilterAndArgs{
							Prefix: pulumi.String("logs/"),
							Tags: pulumi.StringMap{
								"Key1": pulumi.String("Value1"),
								"Key2": pulumi.String("Value2"),
							},
						},
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    And = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs
                    {
                        Prefix = "logs/",
                        Tags = 
                        {
                            { "Key1", "Value1" },
                            { "Key2", "Value2" },
                        },
                    },
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .and(BucketLifecycleConfigurationV2RuleFilterAndArgs.builder()
                        .prefix("logs/")
                        .tags(Map.ofEntries(
                            Map.entry("Key1", "Value1"),
                            Map.entry("Key2", "Value2")
                        ))
                        .build())
                    .build())
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            and:
              prefix: logs/
              tags:
                Key1: Value1
                Key2: Value2
          status: Enabled
Specifying a filter based on object size
Object size values are in bytes. Maximum filter size is 5TB. Amazon S3 applies a default behavior to your Lifecycle configuration that prevents objects smaller than 128 KB from being transitioned to any storage class. You can allow smaller objects to transition by adding a minimum size (object_size_greater_than) or a maximum size (object_size_less_than) filter that specifies a smaller size to the configuration. This example allows any object smaller than 128 KB to transition to the S3 Glacier Instant Retrieval storage class:
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "Allow small object transitions",
        filter: {
            objectSizeGreaterThan: 1,
        },
        status: "Enabled",
        transitions: [{
            days: 365,
            storageClass: "GLACIER_IR",
        }],
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "Allow small object transitions",
        "filter": {
            "object_size_greater_than": 1,
        },
        "status": "Enabled",
        "transitions": [{
            "days": 365,
            "storage_class": "GLACIER_IR",
        }],
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("Allow small object transitions"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						ObjectSizeGreaterThan: pulumi.Int(1),
					},
					Status: pulumi.String("Enabled"),
					Transitions: s3.BucketLifecycleConfigurationV2RuleTransitionArray{
						&s3.BucketLifecycleConfigurationV2RuleTransitionArgs{
							Days:         pulumi.Int(365),
							StorageClass: pulumi.String("GLACIER_IR"),
						},
					},
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "Allow small object transitions",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    ObjectSizeGreaterThan = 1,
                },
                Status = "Enabled",
                Transitions = new[]
                {
                    new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleTransitionArgs
                    {
                        Days = 365,
                        StorageClass = "GLACIER_IR",
                    },
                },
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("Allow small object transitions")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .objectSizeGreaterThan(1)
                    .build())
                .status("Enabled")
                .transitions(BucketLifecycleConfigurationV2RuleTransitionArgs.builder()
                    .days(365)
                    .storageClass("GLACIER_IR")
                    .build())
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: Allow small object transitions
          filter:
            objectSizeGreaterThan: 1
          status: Enabled
          transitions:
            - days: 365
              storageClass: GLACIER_IR
Specifying a filter based on object size range and prefix
The object_size_greater_than must be less than the object_size_less_than. Notice both the object size range and prefix are wrapped in the and configuration block.
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const example = new aws.s3.BucketLifecycleConfigurationV2("example", {
    bucket: bucket.id,
    rules: [{
        id: "rule-1",
        filter: {
            and: {
                prefix: "logs/",
                objectSizeGreaterThan: 500,
                objectSizeLessThan: 64000,
            },
        },
        status: "Enabled",
    }],
});
import pulumi
import pulumi_aws as aws
example = aws.s3.BucketLifecycleConfigurationV2("example",
    bucket=bucket["id"],
    rules=[{
        "id": "rule-1",
        "filter": {
            "and_": {
                "prefix": "logs/",
                "object_size_greater_than": 500,
                "object_size_less_than": 64000,
            },
        },
        "status": "Enabled",
    }])
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := s3.NewBucketLifecycleConfigurationV2(ctx, "example", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: pulumi.Any(bucket.Id),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("rule-1"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						And: &s3.BucketLifecycleConfigurationV2RuleFilterAndArgs{
							Prefix:                pulumi.String("logs/"),
							ObjectSizeGreaterThan: pulumi.Int(500),
							ObjectSizeLessThan:    pulumi.Int(64000),
						},
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var example = new Aws.S3.BucketLifecycleConfigurationV2("example", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "rule-1",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    And = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs
                    {
                        Prefix = "logs/",
                        ObjectSizeGreaterThan = 500,
                        ObjectSizeLessThan = 64000,
                    },
                },
                Status = "Enabled",
            },
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs;
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 example = new BucketLifecycleConfigurationV2("example", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("rule-1")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .and(BucketLifecycleConfigurationV2RuleFilterAndArgs.builder()
                        .prefix("logs/")
                        .objectSizeGreaterThan(500)
                        .objectSizeLessThan(64000)
                        .build())
                    .build())
                .status("Enabled")
                .build())
            .build());
    }
}
resources:
  example:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: rule-1
          filter:
            and:
              prefix: logs/
              objectSizeGreaterThan: 500
              objectSizeLessThan: 64000
          status: Enabled
Creating a Lifecycle Configuration for a bucket with versioning
import * as pulumi from "@pulumi/pulumi";
import * as aws from "@pulumi/aws";
const bucket = new aws.s3.BucketV2("bucket", {bucket: "my-bucket"});
const bucketAcl = new aws.s3.BucketAclV2("bucket_acl", {
    bucket: bucket.id,
    acl: "private",
});
const bucket_config = new aws.s3.BucketLifecycleConfigurationV2("bucket-config", {
    bucket: bucket.id,
    rules: [
        {
            id: "log",
            expiration: {
                days: 90,
            },
            filter: {
                and: {
                    prefix: "log/",
                    tags: {
                        rule: "log",
                        autoclean: "true",
                    },
                },
            },
            status: "Enabled",
            transitions: [
                {
                    days: 30,
                    storageClass: "STANDARD_IA",
                },
                {
                    days: 60,
                    storageClass: "GLACIER",
                },
            ],
        },
        {
            id: "tmp",
            filter: {
                prefix: "tmp/",
            },
            expiration: {
                date: "2023-01-13T00:00:00Z",
            },
            status: "Enabled",
        },
    ],
});
const versioningBucket = new aws.s3.BucketV2("versioning_bucket", {bucket: "my-versioning-bucket"});
const versioningBucketAcl = new aws.s3.BucketAclV2("versioning_bucket_acl", {
    bucket: versioningBucket.id,
    acl: "private",
});
const versioning = new aws.s3.BucketVersioningV2("versioning", {
    bucket: versioningBucket.id,
    versioningConfiguration: {
        status: "Enabled",
    },
});
const versioning_bucket_config = new aws.s3.BucketLifecycleConfigurationV2("versioning-bucket-config", {
    bucket: versioningBucket.id,
    rules: [{
        id: "config",
        filter: {
            prefix: "config/",
        },
        noncurrentVersionExpiration: {
            noncurrentDays: 90,
        },
        noncurrentVersionTransitions: [
            {
                noncurrentDays: 30,
                storageClass: "STANDARD_IA",
            },
            {
                noncurrentDays: 60,
                storageClass: "GLACIER",
            },
        ],
        status: "Enabled",
    }],
}, {
    dependsOn: [versioning],
});
import pulumi
import pulumi_aws as aws
bucket = aws.s3.BucketV2("bucket", bucket="my-bucket")
bucket_acl = aws.s3.BucketAclV2("bucket_acl",
    bucket=bucket.id,
    acl="private")
bucket_config = aws.s3.BucketLifecycleConfigurationV2("bucket-config",
    bucket=bucket.id,
    rules=[
        {
            "id": "log",
            "expiration": {
                "days": 90,
            },
            "filter": {
                "and_": {
                    "prefix": "log/",
                    "tags": {
                        "rule": "log",
                        "autoclean": "true",
                    },
                },
            },
            "status": "Enabled",
            "transitions": [
                {
                    "days": 30,
                    "storage_class": "STANDARD_IA",
                },
                {
                    "days": 60,
                    "storage_class": "GLACIER",
                },
            ],
        },
        {
            "id": "tmp",
            "filter": {
                "prefix": "tmp/",
            },
            "expiration": {
                "date": "2023-01-13T00:00:00Z",
            },
            "status": "Enabled",
        },
    ])
versioning_bucket = aws.s3.BucketV2("versioning_bucket", bucket="my-versioning-bucket")
versioning_bucket_acl = aws.s3.BucketAclV2("versioning_bucket_acl",
    bucket=versioning_bucket.id,
    acl="private")
versioning = aws.s3.BucketVersioningV2("versioning",
    bucket=versioning_bucket.id,
    versioning_configuration={
        "status": "Enabled",
    })
versioning_bucket_config = aws.s3.BucketLifecycleConfigurationV2("versioning-bucket-config",
    bucket=versioning_bucket.id,
    rules=[{
        "id": "config",
        "filter": {
            "prefix": "config/",
        },
        "noncurrent_version_expiration": {
            "noncurrent_days": 90,
        },
        "noncurrent_version_transitions": [
            {
                "noncurrent_days": 30,
                "storage_class": "STANDARD_IA",
            },
            {
                "noncurrent_days": 60,
                "storage_class": "GLACIER",
            },
        ],
        "status": "Enabled",
    }],
    opts = pulumi.ResourceOptions(depends_on=[versioning]))
package main
import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/s3"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		bucket, err := s3.NewBucketV2(ctx, "bucket", &s3.BucketV2Args{
			Bucket: pulumi.String("my-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAclV2(ctx, "bucket_acl", &s3.BucketAclV2Args{
			Bucket: bucket.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketLifecycleConfigurationV2(ctx, "bucket-config", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: bucket.ID(),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("log"),
					Expiration: &s3.BucketLifecycleConfigurationV2RuleExpirationArgs{
						Days: pulumi.Int(90),
					},
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						And: &s3.BucketLifecycleConfigurationV2RuleFilterAndArgs{
							Prefix: pulumi.String("log/"),
							Tags: pulumi.StringMap{
								"rule":      pulumi.String("log"),
								"autoclean": pulumi.String("true"),
							},
						},
					},
					Status: pulumi.String("Enabled"),
					Transitions: s3.BucketLifecycleConfigurationV2RuleTransitionArray{
						&s3.BucketLifecycleConfigurationV2RuleTransitionArgs{
							Days:         pulumi.Int(30),
							StorageClass: pulumi.String("STANDARD_IA"),
						},
						&s3.BucketLifecycleConfigurationV2RuleTransitionArgs{
							Days:         pulumi.Int(60),
							StorageClass: pulumi.String("GLACIER"),
						},
					},
				},
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("tmp"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Prefix: pulumi.String("tmp/"),
					},
					Expiration: &s3.BucketLifecycleConfigurationV2RuleExpirationArgs{
						Date: pulumi.String("2023-01-13T00:00:00Z"),
					},
					Status: pulumi.String("Enabled"),
				},
			},
		})
		if err != nil {
			return err
		}
		versioningBucket, err := s3.NewBucketV2(ctx, "versioning_bucket", &s3.BucketV2Args{
			Bucket: pulumi.String("my-versioning-bucket"),
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketAclV2(ctx, "versioning_bucket_acl", &s3.BucketAclV2Args{
			Bucket: versioningBucket.ID(),
			Acl:    pulumi.String("private"),
		})
		if err != nil {
			return err
		}
		versioning, err := s3.NewBucketVersioningV2(ctx, "versioning", &s3.BucketVersioningV2Args{
			Bucket: versioningBucket.ID(),
			VersioningConfiguration: &s3.BucketVersioningV2VersioningConfigurationArgs{
				Status: pulumi.String("Enabled"),
			},
		})
		if err != nil {
			return err
		}
		_, err = s3.NewBucketLifecycleConfigurationV2(ctx, "versioning-bucket-config", &s3.BucketLifecycleConfigurationV2Args{
			Bucket: versioningBucket.ID(),
			Rules: s3.BucketLifecycleConfigurationV2RuleArray{
				&s3.BucketLifecycleConfigurationV2RuleArgs{
					Id: pulumi.String("config"),
					Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
						Prefix: pulumi.String("config/"),
					},
					NoncurrentVersionExpiration: &s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs{
						NoncurrentDays: pulumi.Int(90),
					},
					NoncurrentVersionTransitions: s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArray{
						&s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs{
							NoncurrentDays: pulumi.Int(30),
							StorageClass:   pulumi.String("STANDARD_IA"),
						},
						&s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs{
							NoncurrentDays: pulumi.Int(60),
							StorageClass:   pulumi.String("GLACIER"),
						},
					},
					Status: pulumi.String("Enabled"),
				},
			},
		}, pulumi.DependsOn([]pulumi.Resource{
			versioning,
		}))
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;
return await Deployment.RunAsync(() => 
{
    var bucket = new Aws.S3.BucketV2("bucket", new()
    {
        Bucket = "my-bucket",
    });
    var bucketAcl = new Aws.S3.BucketAclV2("bucket_acl", new()
    {
        Bucket = bucket.Id,
        Acl = "private",
    });
    var bucket_config = new Aws.S3.BucketLifecycleConfigurationV2("bucket-config", new()
    {
        Bucket = bucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "log",
                Expiration = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleExpirationArgs
                {
                    Days = 90,
                },
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    And = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs
                    {
                        Prefix = "log/",
                        Tags = 
                        {
                            { "rule", "log" },
                            { "autoclean", "true" },
                        },
                    },
                },
                Status = "Enabled",
                Transitions = new[]
                {
                    new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleTransitionArgs
                    {
                        Days = 30,
                        StorageClass = "STANDARD_IA",
                    },
                    new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleTransitionArgs
                    {
                        Days = 60,
                        StorageClass = "GLACIER",
                    },
                },
            },
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "tmp",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Prefix = "tmp/",
                },
                Expiration = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleExpirationArgs
                {
                    Date = "2023-01-13T00:00:00Z",
                },
                Status = "Enabled",
            },
        },
    });
    var versioningBucket = new Aws.S3.BucketV2("versioning_bucket", new()
    {
        Bucket = "my-versioning-bucket",
    });
    var versioningBucketAcl = new Aws.S3.BucketAclV2("versioning_bucket_acl", new()
    {
        Bucket = versioningBucket.Id,
        Acl = "private",
    });
    var versioning = new Aws.S3.BucketVersioningV2("versioning", new()
    {
        Bucket = versioningBucket.Id,
        VersioningConfiguration = new Aws.S3.Inputs.BucketVersioningV2VersioningConfigurationArgs
        {
            Status = "Enabled",
        },
    });
    var versioning_bucket_config = new Aws.S3.BucketLifecycleConfigurationV2("versioning-bucket-config", new()
    {
        Bucket = versioningBucket.Id,
        Rules = new[]
        {
            new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
            {
                Id = "config",
                Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
                {
                    Prefix = "config/",
                },
                NoncurrentVersionExpiration = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs
                {
                    NoncurrentDays = 90,
                },
                NoncurrentVersionTransitions = new[]
                {
                    new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs
                    {
                        NoncurrentDays = 30,
                        StorageClass = "STANDARD_IA",
                    },
                    new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs
                    {
                        NoncurrentDays = 60,
                        StorageClass = "GLACIER",
                    },
                },
                Status = "Enabled",
            },
        },
    }, new CustomResourceOptions
    {
        DependsOn =
        {
            versioning,
        },
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.s3.BucketV2;
import com.pulumi.aws.s3.BucketV2Args;
import com.pulumi.aws.s3.BucketAclV2;
import com.pulumi.aws.s3.BucketAclV2Args;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2;
import com.pulumi.aws.s3.BucketLifecycleConfigurationV2Args;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleExpirationArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs;
import com.pulumi.aws.s3.BucketVersioningV2;
import com.pulumi.aws.s3.BucketVersioningV2Args;
import com.pulumi.aws.s3.inputs.BucketVersioningV2VersioningConfigurationArgs;
import com.pulumi.aws.s3.inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs;
import com.pulumi.resources.CustomResourceOptions;
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 bucket = new BucketV2("bucket", BucketV2Args.builder()
            .bucket("my-bucket")
            .build());
        var bucketAcl = new BucketAclV2("bucketAcl", BucketAclV2Args.builder()
            .bucket(bucket.id())
            .acl("private")
            .build());
        var bucket_config = new BucketLifecycleConfigurationV2("bucket-config", BucketLifecycleConfigurationV2Args.builder()
            .bucket(bucket.id())
            .rules(            
                BucketLifecycleConfigurationV2RuleArgs.builder()
                    .id("log")
                    .expiration(BucketLifecycleConfigurationV2RuleExpirationArgs.builder()
                        .days(90)
                        .build())
                    .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                        .and(BucketLifecycleConfigurationV2RuleFilterAndArgs.builder()
                            .prefix("log/")
                            .tags(Map.ofEntries(
                                Map.entry("rule", "log"),
                                Map.entry("autoclean", "true")
                            ))
                            .build())
                        .build())
                    .status("Enabled")
                    .transitions(                    
                        BucketLifecycleConfigurationV2RuleTransitionArgs.builder()
                            .days(30)
                            .storageClass("STANDARD_IA")
                            .build(),
                        BucketLifecycleConfigurationV2RuleTransitionArgs.builder()
                            .days(60)
                            .storageClass("GLACIER")
                            .build())
                    .build(),
                BucketLifecycleConfigurationV2RuleArgs.builder()
                    .id("tmp")
                    .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                        .prefix("tmp/")
                        .build())
                    .expiration(BucketLifecycleConfigurationV2RuleExpirationArgs.builder()
                        .date("2023-01-13T00:00:00Z")
                        .build())
                    .status("Enabled")
                    .build())
            .build());
        var versioningBucket = new BucketV2("versioningBucket", BucketV2Args.builder()
            .bucket("my-versioning-bucket")
            .build());
        var versioningBucketAcl = new BucketAclV2("versioningBucketAcl", BucketAclV2Args.builder()
            .bucket(versioningBucket.id())
            .acl("private")
            .build());
        var versioning = new BucketVersioningV2("versioning", BucketVersioningV2Args.builder()
            .bucket(versioningBucket.id())
            .versioningConfiguration(BucketVersioningV2VersioningConfigurationArgs.builder()
                .status("Enabled")
                .build())
            .build());
        var versioning_bucket_config = new BucketLifecycleConfigurationV2("versioning-bucket-config", BucketLifecycleConfigurationV2Args.builder()
            .bucket(versioningBucket.id())
            .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
                .id("config")
                .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
                    .prefix("config/")
                    .build())
                .noncurrentVersionExpiration(BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs.builder()
                    .noncurrentDays(90)
                    .build())
                .noncurrentVersionTransitions(                
                    BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs.builder()
                        .noncurrentDays(30)
                        .storageClass("STANDARD_IA")
                        .build(),
                    BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs.builder()
                        .noncurrentDays(60)
                        .storageClass("GLACIER")
                        .build())
                .status("Enabled")
                .build())
            .build(), CustomResourceOptions.builder()
                .dependsOn(versioning)
                .build());
    }
}
resources:
  bucket:
    type: aws:s3:BucketV2
    properties:
      bucket: my-bucket
  bucketAcl:
    type: aws:s3:BucketAclV2
    name: bucket_acl
    properties:
      bucket: ${bucket.id}
      acl: private
  bucket-config:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${bucket.id}
      rules:
        - id: log
          expiration:
            days: 90
          filter:
            and:
              prefix: log/
              tags:
                rule: log
                autoclean: 'true'
          status: Enabled
          transitions:
            - days: 30
              storageClass: STANDARD_IA
            - days: 60
              storageClass: GLACIER
        - id: tmp
          filter:
            prefix: tmp/
          expiration:
            date: 2023-01-13T00:00:00Z
          status: Enabled
  versioningBucket:
    type: aws:s3:BucketV2
    name: versioning_bucket
    properties:
      bucket: my-versioning-bucket
  versioningBucketAcl:
    type: aws:s3:BucketAclV2
    name: versioning_bucket_acl
    properties:
      bucket: ${versioningBucket.id}
      acl: private
  versioning:
    type: aws:s3:BucketVersioningV2
    properties:
      bucket: ${versioningBucket.id}
      versioningConfiguration:
        status: Enabled
  versioning-bucket-config:
    type: aws:s3:BucketLifecycleConfigurationV2
    properties:
      bucket: ${versioningBucket.id}
      rules:
        - id: config
          filter:
            prefix: config/
          noncurrentVersionExpiration:
            noncurrentDays: 90
          noncurrentVersionTransitions:
            - noncurrentDays: 30
              storageClass: STANDARD_IA
            - noncurrentDays: 60
              storageClass: GLACIER
          status: Enabled
    options:
      dependsOn:
        - ${versioning}
Create BucketLifecycleConfigurationV2 Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new BucketLifecycleConfigurationV2(name: string, args: BucketLifecycleConfigurationV2Args, opts?: CustomResourceOptions);@overload
def BucketLifecycleConfigurationV2(resource_name: str,
                                   args: BucketLifecycleConfigurationV2Args,
                                   opts: Optional[ResourceOptions] = None)
@overload
def BucketLifecycleConfigurationV2(resource_name: str,
                                   opts: Optional[ResourceOptions] = None,
                                   bucket: Optional[str] = None,
                                   expected_bucket_owner: Optional[str] = None,
                                   rules: Optional[Sequence[BucketLifecycleConfigurationV2RuleArgs]] = None,
                                   timeouts: Optional[BucketLifecycleConfigurationV2TimeoutsArgs] = None,
                                   transition_default_minimum_object_size: Optional[str] = None)func NewBucketLifecycleConfigurationV2(ctx *Context, name string, args BucketLifecycleConfigurationV2Args, opts ...ResourceOption) (*BucketLifecycleConfigurationV2, error)public BucketLifecycleConfigurationV2(string name, BucketLifecycleConfigurationV2Args args, CustomResourceOptions? opts = null)
public BucketLifecycleConfigurationV2(String name, BucketLifecycleConfigurationV2Args args)
public BucketLifecycleConfigurationV2(String name, BucketLifecycleConfigurationV2Args args, CustomResourceOptions options)
type: aws:s3:BucketLifecycleConfigurationV2
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 BucketLifecycleConfigurationV2Args
- 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 BucketLifecycleConfigurationV2Args
- 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 BucketLifecycleConfigurationV2Args
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args BucketLifecycleConfigurationV2Args
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args BucketLifecycleConfigurationV2Args
- 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 bucketLifecycleConfigurationV2Resource = new Aws.S3.BucketLifecycleConfigurationV2("bucketLifecycleConfigurationV2Resource", new()
{
    Bucket = "string",
    ExpectedBucketOwner = "string",
    Rules = new[]
    {
        new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleArgs
        {
            Id = "string",
            Status = "string",
            AbortIncompleteMultipartUpload = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleAbortIncompleteMultipartUploadArgs
            {
                DaysAfterInitiation = 0,
            },
            Expiration = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleExpirationArgs
            {
                Date = "string",
                Days = 0,
                ExpiredObjectDeleteMarker = false,
            },
            Filter = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterArgs
            {
                And = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterAndArgs
                {
                    ObjectSizeGreaterThan = 0,
                    ObjectSizeLessThan = 0,
                    Prefix = "string",
                    Tags = 
                    {
                        { "string", "string" },
                    },
                },
                ObjectSizeGreaterThan = 0,
                ObjectSizeLessThan = 0,
                Prefix = "string",
                Tag = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleFilterTagArgs
                {
                    Key = "string",
                    Value = "string",
                },
            },
            NoncurrentVersionExpiration = new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs
            {
                NewerNoncurrentVersions = 0,
                NoncurrentDays = 0,
            },
            NoncurrentVersionTransitions = new[]
            {
                new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs
                {
                    StorageClass = "string",
                    NewerNoncurrentVersions = 0,
                    NoncurrentDays = 0,
                },
            },
            Transitions = new[]
            {
                new Aws.S3.Inputs.BucketLifecycleConfigurationV2RuleTransitionArgs
                {
                    StorageClass = "string",
                    Date = "string",
                    Days = 0,
                },
            },
        },
    },
    Timeouts = new Aws.S3.Inputs.BucketLifecycleConfigurationV2TimeoutsArgs
    {
        Create = "string",
        Update = "string",
    },
    TransitionDefaultMinimumObjectSize = "string",
});
example, err := s3.NewBucketLifecycleConfigurationV2(ctx, "bucketLifecycleConfigurationV2Resource", &s3.BucketLifecycleConfigurationV2Args{
	Bucket:              pulumi.String("string"),
	ExpectedBucketOwner: pulumi.String("string"),
	Rules: s3.BucketLifecycleConfigurationV2RuleArray{
		&s3.BucketLifecycleConfigurationV2RuleArgs{
			Id:     pulumi.String("string"),
			Status: pulumi.String("string"),
			AbortIncompleteMultipartUpload: &s3.BucketLifecycleConfigurationV2RuleAbortIncompleteMultipartUploadArgs{
				DaysAfterInitiation: pulumi.Int(0),
			},
			Expiration: &s3.BucketLifecycleConfigurationV2RuleExpirationArgs{
				Date:                      pulumi.String("string"),
				Days:                      pulumi.Int(0),
				ExpiredObjectDeleteMarker: pulumi.Bool(false),
			},
			Filter: &s3.BucketLifecycleConfigurationV2RuleFilterArgs{
				And: &s3.BucketLifecycleConfigurationV2RuleFilterAndArgs{
					ObjectSizeGreaterThan: pulumi.Int(0),
					ObjectSizeLessThan:    pulumi.Int(0),
					Prefix:                pulumi.String("string"),
					Tags: pulumi.StringMap{
						"string": pulumi.String("string"),
					},
				},
				ObjectSizeGreaterThan: pulumi.Int(0),
				ObjectSizeLessThan:    pulumi.Int(0),
				Prefix:                pulumi.String("string"),
				Tag: &s3.BucketLifecycleConfigurationV2RuleFilterTagArgs{
					Key:   pulumi.String("string"),
					Value: pulumi.String("string"),
				},
			},
			NoncurrentVersionExpiration: &s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs{
				NewerNoncurrentVersions: pulumi.Int(0),
				NoncurrentDays:          pulumi.Int(0),
			},
			NoncurrentVersionTransitions: s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArray{
				&s3.BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs{
					StorageClass:            pulumi.String("string"),
					NewerNoncurrentVersions: pulumi.Int(0),
					NoncurrentDays:          pulumi.Int(0),
				},
			},
			Transitions: s3.BucketLifecycleConfigurationV2RuleTransitionArray{
				&s3.BucketLifecycleConfigurationV2RuleTransitionArgs{
					StorageClass: pulumi.String("string"),
					Date:         pulumi.String("string"),
					Days:         pulumi.Int(0),
				},
			},
		},
	},
	Timeouts: &s3.BucketLifecycleConfigurationV2TimeoutsArgs{
		Create: pulumi.String("string"),
		Update: pulumi.String("string"),
	},
	TransitionDefaultMinimumObjectSize: pulumi.String("string"),
})
var bucketLifecycleConfigurationV2Resource = new BucketLifecycleConfigurationV2("bucketLifecycleConfigurationV2Resource", BucketLifecycleConfigurationV2Args.builder()
    .bucket("string")
    .expectedBucketOwner("string")
    .rules(BucketLifecycleConfigurationV2RuleArgs.builder()
        .id("string")
        .status("string")
        .abortIncompleteMultipartUpload(BucketLifecycleConfigurationV2RuleAbortIncompleteMultipartUploadArgs.builder()
            .daysAfterInitiation(0)
            .build())
        .expiration(BucketLifecycleConfigurationV2RuleExpirationArgs.builder()
            .date("string")
            .days(0)
            .expiredObjectDeleteMarker(false)
            .build())
        .filter(BucketLifecycleConfigurationV2RuleFilterArgs.builder()
            .and(BucketLifecycleConfigurationV2RuleFilterAndArgs.builder()
                .objectSizeGreaterThan(0)
                .objectSizeLessThan(0)
                .prefix("string")
                .tags(Map.of("string", "string"))
                .build())
            .objectSizeGreaterThan(0)
            .objectSizeLessThan(0)
            .prefix("string")
            .tag(BucketLifecycleConfigurationV2RuleFilterTagArgs.builder()
                .key("string")
                .value("string")
                .build())
            .build())
        .noncurrentVersionExpiration(BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs.builder()
            .newerNoncurrentVersions(0)
            .noncurrentDays(0)
            .build())
        .noncurrentVersionTransitions(BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs.builder()
            .storageClass("string")
            .newerNoncurrentVersions(0)
            .noncurrentDays(0)
            .build())
        .transitions(BucketLifecycleConfigurationV2RuleTransitionArgs.builder()
            .storageClass("string")
            .date("string")
            .days(0)
            .build())
        .build())
    .timeouts(BucketLifecycleConfigurationV2TimeoutsArgs.builder()
        .create("string")
        .update("string")
        .build())
    .transitionDefaultMinimumObjectSize("string")
    .build());
bucket_lifecycle_configuration_v2_resource = aws.s3.BucketLifecycleConfigurationV2("bucketLifecycleConfigurationV2Resource",
    bucket="string",
    expected_bucket_owner="string",
    rules=[{
        "id": "string",
        "status": "string",
        "abort_incomplete_multipart_upload": {
            "days_after_initiation": 0,
        },
        "expiration": {
            "date": "string",
            "days": 0,
            "expired_object_delete_marker": False,
        },
        "filter": {
            "and_": {
                "object_size_greater_than": 0,
                "object_size_less_than": 0,
                "prefix": "string",
                "tags": {
                    "string": "string",
                },
            },
            "object_size_greater_than": 0,
            "object_size_less_than": 0,
            "prefix": "string",
            "tag": {
                "key": "string",
                "value": "string",
            },
        },
        "noncurrent_version_expiration": {
            "newer_noncurrent_versions": 0,
            "noncurrent_days": 0,
        },
        "noncurrent_version_transitions": [{
            "storage_class": "string",
            "newer_noncurrent_versions": 0,
            "noncurrent_days": 0,
        }],
        "transitions": [{
            "storage_class": "string",
            "date": "string",
            "days": 0,
        }],
    }],
    timeouts={
        "create": "string",
        "update": "string",
    },
    transition_default_minimum_object_size="string")
const bucketLifecycleConfigurationV2Resource = new aws.s3.BucketLifecycleConfigurationV2("bucketLifecycleConfigurationV2Resource", {
    bucket: "string",
    expectedBucketOwner: "string",
    rules: [{
        id: "string",
        status: "string",
        abortIncompleteMultipartUpload: {
            daysAfterInitiation: 0,
        },
        expiration: {
            date: "string",
            days: 0,
            expiredObjectDeleteMarker: false,
        },
        filter: {
            and: {
                objectSizeGreaterThan: 0,
                objectSizeLessThan: 0,
                prefix: "string",
                tags: {
                    string: "string",
                },
            },
            objectSizeGreaterThan: 0,
            objectSizeLessThan: 0,
            prefix: "string",
            tag: {
                key: "string",
                value: "string",
            },
        },
        noncurrentVersionExpiration: {
            newerNoncurrentVersions: 0,
            noncurrentDays: 0,
        },
        noncurrentVersionTransitions: [{
            storageClass: "string",
            newerNoncurrentVersions: 0,
            noncurrentDays: 0,
        }],
        transitions: [{
            storageClass: "string",
            date: "string",
            days: 0,
        }],
    }],
    timeouts: {
        create: "string",
        update: "string",
    },
    transitionDefaultMinimumObjectSize: "string",
});
type: aws:s3:BucketLifecycleConfigurationV2
properties:
    bucket: string
    expectedBucketOwner: string
    rules:
        - abortIncompleteMultipartUpload:
            daysAfterInitiation: 0
          expiration:
            date: string
            days: 0
            expiredObjectDeleteMarker: false
          filter:
            and:
                objectSizeGreaterThan: 0
                objectSizeLessThan: 0
                prefix: string
                tags:
                    string: string
            objectSizeGreaterThan: 0
            objectSizeLessThan: 0
            prefix: string
            tag:
                key: string
                value: string
          id: string
          noncurrentVersionExpiration:
            newerNoncurrentVersions: 0
            noncurrentDays: 0
          noncurrentVersionTransitions:
            - newerNoncurrentVersions: 0
              noncurrentDays: 0
              storageClass: string
          status: string
          transitions:
            - date: string
              days: 0
              storageClass: string
    timeouts:
        create: string
        update: string
    transitionDefaultMinimumObjectSize: string
BucketLifecycleConfigurationV2 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 BucketLifecycleConfigurationV2 resource accepts the following input properties:
- Bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- Rules
List<BucketLifecycle Configuration V2Rule> 
- List of configuration blocks describing the rules managing the replication. See below.
- Timeouts
BucketLifecycle Configuration V2Timeouts 
- TransitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- Bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- Rules
[]BucketLifecycle Configuration V2Rule Args 
- List of configuration blocks describing the rules managing the replication. See below.
- Timeouts
BucketLifecycle Configuration V2Timeouts Args 
- TransitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket String
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
List<BucketLifecycle Configuration V2Rule> 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts 
- transitionDefault StringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
BucketLifecycle Configuration V2Rule[] 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts 
- transitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket str
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expected_bucket_ strowner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
Sequence[BucketLifecycle Configuration V2Rule Args] 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts Args 
- transition_default_ strminimum_ object_ size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket String
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules List<Property Map>
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts Property Map
- transitionDefault StringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
Outputs
All input properties are implicitly available as output properties. Additionally, the BucketLifecycleConfigurationV2 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 BucketLifecycleConfigurationV2 Resource
Get an existing BucketLifecycleConfigurationV2 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?: BucketLifecycleConfigurationV2State, opts?: CustomResourceOptions): BucketLifecycleConfigurationV2@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        bucket: Optional[str] = None,
        expected_bucket_owner: Optional[str] = None,
        rules: Optional[Sequence[BucketLifecycleConfigurationV2RuleArgs]] = None,
        timeouts: Optional[BucketLifecycleConfigurationV2TimeoutsArgs] = None,
        transition_default_minimum_object_size: Optional[str] = None) -> BucketLifecycleConfigurationV2func GetBucketLifecycleConfigurationV2(ctx *Context, name string, id IDInput, state *BucketLifecycleConfigurationV2State, opts ...ResourceOption) (*BucketLifecycleConfigurationV2, error)public static BucketLifecycleConfigurationV2 Get(string name, Input<string> id, BucketLifecycleConfigurationV2State? state, CustomResourceOptions? opts = null)public static BucketLifecycleConfigurationV2 get(String name, Output<String> id, BucketLifecycleConfigurationV2State state, CustomResourceOptions options)resources:  _:    type: aws:s3:BucketLifecycleConfigurationV2    get:      id: ${id}- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- Rules
List<BucketLifecycle Configuration V2Rule> 
- List of configuration blocks describing the rules managing the replication. See below.
- Timeouts
BucketLifecycle Configuration V2Timeouts 
- TransitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- Bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- ExpectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- Rules
[]BucketLifecycle Configuration V2Rule Args 
- List of configuration blocks describing the rules managing the replication. See below.
- Timeouts
BucketLifecycle Configuration V2Timeouts Args 
- TransitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket String
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
List<BucketLifecycle Configuration V2Rule> 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts 
- transitionDefault StringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket string
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket stringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
BucketLifecycle Configuration V2Rule[] 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts 
- transitionDefault stringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket str
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expected_bucket_ strowner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules
Sequence[BucketLifecycle Configuration V2Rule Args] 
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts
BucketLifecycle Configuration V2Timeouts Args 
- transition_default_ strminimum_ object_ size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
- bucket String
- Name of the source S3 bucket you want Amazon S3 to monitor.
- expectedBucket StringOwner 
- Account ID of the expected bucket owner. If the bucket is owned by a different account, the request will fail with an HTTP 403 (Access Denied) error.
- rules List<Property Map>
- List of configuration blocks describing the rules managing the replication. See below.
- timeouts Property Map
- transitionDefault StringMinimum Object Size 
- The default minimum object size behavior applied to the lifecycle configuration. Valid values: all_storage_classes_128K(default),varies_by_storage_class. To customize the minimum object size for any transition you can add afilterthat specifies a customobject_size_greater_thanorobject_size_less_thanvalue. Custom filters always take precedence over the default transition behavior.
Supporting Types
BucketLifecycleConfigurationV2Rule, BucketLifecycleConfigurationV2RuleArgs        
- Id string
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- Status string
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- AbortIncomplete BucketMultipart Upload Lifecycle Configuration V2Rule Abort Incomplete Multipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- Expiration
BucketLifecycle Configuration V2Rule Expiration 
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- Filter
BucketLifecycle Configuration V2Rule Filter 
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- NoncurrentVersion BucketExpiration Lifecycle Configuration V2Rule Noncurrent Version Expiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- NoncurrentVersion List<BucketTransitions Lifecycle Configuration V2Rule Noncurrent Version Transition> 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- Prefix string
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- Transitions
List<BucketLifecycle Configuration V2Rule Transition> 
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
- Id string
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- Status string
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- AbortIncomplete BucketMultipart Upload Lifecycle Configuration V2Rule Abort Incomplete Multipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- Expiration
BucketLifecycle Configuration V2Rule Expiration 
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- Filter
BucketLifecycle Configuration V2Rule Filter 
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- NoncurrentVersion BucketExpiration Lifecycle Configuration V2Rule Noncurrent Version Expiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- NoncurrentVersion []BucketTransitions Lifecycle Configuration V2Rule Noncurrent Version Transition 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- Prefix string
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- Transitions
[]BucketLifecycle Configuration V2Rule Transition 
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
- id String
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- status String
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- abortIncomplete BucketMultipart Upload Lifecycle Configuration V2Rule Abort Incomplete Multipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- expiration
BucketLifecycle Configuration V2Rule Expiration 
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- filter
BucketLifecycle Configuration V2Rule Filter 
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- noncurrentVersion BucketExpiration Lifecycle Configuration V2Rule Noncurrent Version Expiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- noncurrentVersion List<BucketTransitions Lifecycle Configuration V2Rule Noncurrent Version Transition> 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- prefix String
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- transitions
List<BucketLifecycle Configuration V2Rule Transition> 
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
- id string
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- status string
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- abortIncomplete BucketMultipart Upload Lifecycle Configuration V2Rule Abort Incomplete Multipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- expiration
BucketLifecycle Configuration V2Rule Expiration 
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- filter
BucketLifecycle Configuration V2Rule Filter 
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- noncurrentVersion BucketExpiration Lifecycle Configuration V2Rule Noncurrent Version Expiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- noncurrentVersion BucketTransitions Lifecycle Configuration V2Rule Noncurrent Version Transition[] 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- prefix string
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- transitions
BucketLifecycle Configuration V2Rule Transition[] 
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
- id str
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- status str
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- abort_incomplete_ Bucketmultipart_ upload Lifecycle Configuration V2Rule Abort Incomplete Multipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- expiration
BucketLifecycle Configuration V2Rule Expiration 
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- filter
BucketLifecycle Configuration V2Rule Filter 
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- noncurrent_version_ Bucketexpiration Lifecycle Configuration V2Rule Noncurrent Version Expiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- noncurrent_version_ Sequence[Buckettransitions Lifecycle Configuration V2Rule Noncurrent Version Transition] 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- prefix str
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- transitions
Sequence[BucketLifecycle Configuration V2Rule Transition] 
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
- id String
- Unique identifier for the rule. The value cannot be longer than 255 characters.
- status String
- Whether the rule is currently being applied. Valid values: EnabledorDisabled.
- abortIncomplete Property MapMultipart Upload 
- Configuration block that specifies the days since the initiation of an incomplete multipart upload that Amazon S3 will wait before permanently removing all parts of the upload. See below.
- expiration Property Map
- Configuration block that specifies the expiration for the lifecycle of the object in the form of date, days and, whether the object has a delete marker. See below.
- filter Property Map
- Configuration block used to identify objects that a Lifecycle Rule applies to. See below. If not specified, the rulewill default to usingprefix.
- noncurrentVersion Property MapExpiration 
- Configuration block that specifies when noncurrent object versions expire. See below.
- noncurrentVersion List<Property Map>Transitions 
- Set of configuration blocks that specify the transition rule for the lifecycle rule that describes when noncurrent objects transition to a specific storage class. See below.
- prefix String
- DEPRECATED Use filterinstead. This has been deprecated by Amazon S3. Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") iffilteris not specified.
- transitions List<Property Map>
- Set of configuration blocks that specify when an Amazon S3 object transitions to a specified storage class. See below.
BucketLifecycleConfigurationV2RuleAbortIncompleteMultipartUpload, BucketLifecycleConfigurationV2RuleAbortIncompleteMultipartUploadArgs                
- DaysAfter intInitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
- DaysAfter intInitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
- daysAfter IntegerInitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
- daysAfter numberInitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
- days_after_ intinitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
- daysAfter NumberInitiation 
- Number of days after which Amazon S3 aborts an incomplete multipart upload.
BucketLifecycleConfigurationV2RuleExpiration, BucketLifecycleConfigurationV2RuleExpirationArgs          
- Date string
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- Days int
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- ExpiredObject boolDelete Marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
- Date string
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- Days int
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- ExpiredObject boolDelete Marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
- date String
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days Integer
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- expiredObject BooleanDelete Marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
- date string
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days number
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- expiredObject booleanDelete Marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
- date str
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days int
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- expired_object_ booldelete_ marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
- date String
- Date the object is to be moved or deleted. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days Number
- Lifetime, in days, of the objects that are subject to the rule. The value must be a non-zero positive integer.
- expiredObject BooleanDelete Marker 
- Indicates whether Amazon S3 will remove a delete marker with no noncurrent versions. If set to true, the delete marker will be expired; if set tofalsethe policy takes no action.
BucketLifecycleConfigurationV2RuleFilter, BucketLifecycleConfigurationV2RuleFilterArgs          
- And
BucketLifecycle Configuration V2Rule Filter And 
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- ObjectSize intGreater Than 
- Minimum object size (in bytes) to which the rule applies.
- ObjectSize intLess Than 
- Maximum object size (in bytes) to which the rule applies.
- Prefix string
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- Tag
BucketLifecycle Configuration V2Rule Filter Tag 
- Configuration block for specifying a tag key and value. See below.
- And
BucketLifecycle Configuration V2Rule Filter And 
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- ObjectSize intGreater Than 
- Minimum object size (in bytes) to which the rule applies.
- ObjectSize intLess Than 
- Maximum object size (in bytes) to which the rule applies.
- Prefix string
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- Tag
BucketLifecycle Configuration V2Rule Filter Tag 
- Configuration block for specifying a tag key and value. See below.
- and
BucketLifecycle Configuration V2Rule Filter And 
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- objectSize IntegerGreater Than 
- Minimum object size (in bytes) to which the rule applies.
- objectSize IntegerLess Than 
- Maximum object size (in bytes) to which the rule applies.
- prefix String
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- tag
BucketLifecycle Configuration V2Rule Filter Tag 
- Configuration block for specifying a tag key and value. See below.
- and
BucketLifecycle Configuration V2Rule Filter And 
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- objectSize numberGreater Than 
- Minimum object size (in bytes) to which the rule applies.
- objectSize numberLess Than 
- Maximum object size (in bytes) to which the rule applies.
- prefix string
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- tag
BucketLifecycle Configuration V2Rule Filter Tag 
- Configuration block for specifying a tag key and value. See below.
- and_
BucketLifecycle Configuration V2Rule Filter And 
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- object_size_ intgreater_ than 
- Minimum object size (in bytes) to which the rule applies.
- object_size_ intless_ than 
- Maximum object size (in bytes) to which the rule applies.
- prefix str
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- tag
BucketLifecycle Configuration V2Rule Filter Tag 
- Configuration block for specifying a tag key and value. See below.
- and Property Map
- Configuration block used to apply a logical ANDto two or more predicates. See below. The Lifecycle Rule will apply to any object matching all the predicates configured inside theandblock.
- objectSize NumberGreater Than 
- Minimum object size (in bytes) to which the rule applies.
- objectSize NumberLess Than 
- Maximum object size (in bytes) to which the rule applies.
- prefix String
- Prefix identifying one or more objects to which the rule applies. Defaults to an empty string ("") if not specified.
- tag Property Map
- Configuration block for specifying a tag key and value. See below.
BucketLifecycleConfigurationV2RuleFilterAnd, BucketLifecycleConfigurationV2RuleFilterAndArgs            
- ObjectSize intGreater Than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- ObjectSize intLess Than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- Prefix string
- Prefix identifying one or more objects to which the rule applies.
- Dictionary<string, string>
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
- ObjectSize intGreater Than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- ObjectSize intLess Than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- Prefix string
- Prefix identifying one or more objects to which the rule applies.
- map[string]string
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
- objectSize IntegerGreater Than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- objectSize IntegerLess Than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- prefix String
- Prefix identifying one or more objects to which the rule applies.
- Map<String,String>
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
- objectSize numberGreater Than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- objectSize numberLess Than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- prefix string
- Prefix identifying one or more objects to which the rule applies.
- {[key: string]: string}
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
- object_size_ intgreater_ than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- object_size_ intless_ than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- prefix str
- Prefix identifying one or more objects to which the rule applies.
- Mapping[str, str]
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
- objectSize NumberGreater Than 
- Minimum object size to which the rule applies. Value must be at least 0if specified. Defaults to 128000 (128 KB) for allstorage_classvalues unlesstransition_default_minimum_object_sizespecifies otherwise.
- objectSize NumberLess Than 
- Maximum object size to which the rule applies. Value must be at least 1if specified.
- prefix String
- Prefix identifying one or more objects to which the rule applies.
- Map<String>
- Key-value map of resource tags. All of these tags must exist in the object's tag set in order for the rule to apply.
BucketLifecycleConfigurationV2RuleFilterTag, BucketLifecycleConfigurationV2RuleFilterTagArgs            
BucketLifecycleConfigurationV2RuleNoncurrentVersionExpiration, BucketLifecycleConfigurationV2RuleNoncurrentVersionExpirationArgs              
- NewerNoncurrent intVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- NoncurrentDays int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
- NewerNoncurrent intVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- NoncurrentDays int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
- newerNoncurrent IntegerVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays Integer
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
- newerNoncurrent numberVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays number
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
- newer_noncurrent_ intversions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrent_days int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
- newerNoncurrent NumberVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays Number
- Number of days an object is noncurrent before Amazon S3 can perform the associated action. Must be a positive integer.
BucketLifecycleConfigurationV2RuleNoncurrentVersionTransition, BucketLifecycleConfigurationV2RuleNoncurrentVersionTransitionArgs              
- StorageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- NewerNoncurrent intVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- NoncurrentDays int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
- StorageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- NewerNoncurrent intVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- NoncurrentDays int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
- storageClass String
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- newerNoncurrent IntegerVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays Integer
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
- storageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- newerNoncurrent numberVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays number
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
- storage_class str
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- newer_noncurrent_ intversions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrent_days int
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
- storageClass String
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- newerNoncurrent NumberVersions 
- Number of noncurrent versions Amazon S3 will retain. Must be a non-zero positive integer.
- noncurrentDays Number
- Number of days an object is noncurrent before Amazon S3 can perform the associated action.
BucketLifecycleConfigurationV2RuleTransition, BucketLifecycleConfigurationV2RuleTransitionArgs          
- StorageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- Date string
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- Days int
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
- StorageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- Date string
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- Days int
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
- storageClass String
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- date String
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days Integer
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
- storageClass string
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- date string
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days number
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
- storage_class str
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- date str
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days int
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
- storageClass String
- Class of storage used to store the object. Valid Values: GLACIER,STANDARD_IA,ONEZONE_IA,INTELLIGENT_TIERING,DEEP_ARCHIVE,GLACIER_IR.
- date String
- Date objects are transitioned to the specified storage class. The date value must be in RFC3339 full-date format e.g. 2023-08-22.
- days Number
- Number of days after creation when objects are transitioned to the specified storage class. The value must be a positive integer. If both daysanddateare not specified, defaults to0. Valid values depend onstorage_class, see Transition objects using Amazon S3 Lifecycle for more details.
BucketLifecycleConfigurationV2Timeouts, BucketLifecycleConfigurationV2TimeoutsArgs        
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- Update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- update string
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- update str
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- create String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
- update String
- A string that can be parsed as a duration consisting of numbers and unit suffixes, such as "30s" or "2h45m". Valid time units are "s" (seconds), "m" (minutes), "h" (hours).
Import
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):
Using pulumi import, import an S3 bucket lifecycle configuration using the bucket or the bucket and expected_bucket_owner separated by a comma (,). For example:
If the owner (account ID) of the source bucket is the same account used to configure the AWS Provider, import using the bucket:
$ pulumi import aws:s3/bucketLifecycleConfigurationV2:BucketLifecycleConfigurationV2 example bucket-name
If the owner (account ID) of the source bucket differs from the account used to configure the AWS Provider, import using the bucket and expected_bucket_owner separated by a comma (,):
$ pulumi import aws:s3/bucketLifecycleConfigurationV2:BucketLifecycleConfigurationV2 example bucket-name,123456789012
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- AWS Classic pulumi/pulumi-aws
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the awsTerraform Provider.