Skip to content

Resource: awsS3ControlBucketLifecycleConfiguration

Provides a resource to manage an S3 Control Bucket Lifecycle Configuration.

\~> NOTE: Each S3 Control Bucket can only have one Lifecycle Configuration. Using multiple of this resource against the same S3 Control Bucket will result in perpetual differences each Terraform run.

-> This functionality is for managing S3 on Outposts. To manage S3 Bucket Lifecycle Configurations in an AWS Partition, see the awsS3Bucket resource.

Example Usage

/*Provider bindings are generated by running cdktf get.
See https://cdk.tf/provider-generation for more details.*/
import * as aws from "./.gen/providers/aws";
new aws.s3ControlBucketLifecycleConfiguration.S3ControlBucketLifecycleConfiguration(
  this,
  "example",
  {
    bucket: "${aws_s3control_bucket.example.arn}",
    rule: [
      {
        expiration: {
          days: 365,
        },
        filter: {
          prefix: "logs/",
        },
        id: "logs",
      },
      {
        expiration: {
          days: 7,
        },
        filter: {
          prefix: "temp/",
        },
        id: "temp",
      },
    ],
  }
);

Argument Reference

The following arguments are required:

  • bucket - (Required) Amazon Resource Name (ARN) of the bucket.
  • rule - (Required) Configuration block(s) containing lifecycle rules for the bucket.
  • abortIncompleteMultipartUpload - (Optional) Configuration block containing settings for abort incomplete multipart upload.
    • daysAfterInitiation - (Required) Number of days after which Amazon S3 aborts an incomplete multipart upload.
  • expiration - (Optional) Configuration block containing settings for expiration of objects.
    • date - (Optional) Date the object is to be deleted. Should be in yyyyMmDd date format, e.g., 20200930.
    • days - (Optional) Number of days before the object is to be deleted.
    • expiredObjectDeleteMarker - (Optional) Enable to remove a delete marker with no noncurrent versions. Cannot be specified with date or days.
  • filter - (Optional) Configuration block containing settings for filtering.
    • prefix - (Optional) Object prefix for rule filtering.
    • tags - (Optional) Key-value map of object tags for rule filtering.
  • id - (Required) Unique identifier for the rule.
  • status - (Optional) Status of the rule. Valid values: enabled and disabled. Defaults to enabled.

Attributes Reference

In addition to all arguments above, the following attributes are exported:

  • id - Amazon Resource Name (ARN) of the bucket.

Import

S3 Control Bucket Lifecycle Configurations can be imported using the Amazon Resource Name (ARN), e.g.,

$ terraform import aws_s3control_bucket_lifecycle_configuration.example arn:aws:s3-outposts:us-east-1:123456789012:outpost/op-12345678/bucket/example