Getting Information About the Lifecycle Configuration of Your Bucket

You can get information about the lifecycle configuration currently applied to the objects of a bucket.

Getting Information About the Lifecycle Configuration of Your Bucket Using AWS CLI

Before you begin: Install and configure AWS CLI. For more information, see Installing and Configuring AWS CLI.

To get information about the lifecycle configuration applied to a bucket, use the get-bucket-lifecycle-configuration command following this syntax:

Request sample
$ aws s3api get-bucket-lifecycle-configuration \
    --profile YOUR_PROFILE \
    --bucket BUCKET \
    --endpoint https://oos.eu-west-2.outscale.com

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • bucket: The name of the bucket whose lifecycle configuration you want to retrieve.

  • endpoint: The endpoint corresponding to the Region you want to send the request to. For more information, see Installing and Configuring AWS CLI.

The get-bucket-lifecycle-configuration command returns the following elements:

  • Rules: One or more rules in the lifecycle configuration.

    • ID: A unique name for the rule.

    • Status: If Enabled, the rule is applied. If Disabled, the rule is not applied.

    • Expiration: Specifies the expiration date for the objects.

      • Days: The lifetime of the objects, in days.

      • ExpiredObjectDeleteMarker: If true, the expired delete markers of the objects are deleted. For more information, see About Delete Markers.

    • NoncurrentVersionExpiration: Specifies the expiration of noncurrent versions of your objects. For more information, see Enabling or Disabling Bucket Versioning.

      • NoncurrentDays: The lifetime, in days, of noncurrent versions of your objects.

    • AbortIncompleteMultipartUpload: Specifies when an incomplete multipart upload is aborted. For more information, see Creating a Multipart Upload.

      • DaysAfterInitiation: The number of days after which an incomplete multipart upload is aborted.

    • Filter: Specifies the objects the rule applies to.

      • And: A logical operator enabling multiple filters.

      • Prefix: The prefix of the objects.

      • Tags: A list of tags associated with the objects.

        • Key: The key of the tag.

        • Value: The value of the tag.

Result sample
{
   "Rules": [
      {
         "ID": "string",
         "Status": "Enabled",
         "Expiration": {
            "Days": integer,
            "ExpiredObjectDeleteMarker": false
         },
         "NoncurrentVersionExpiration": {
            "NoncurrentDays": integer
         },
         "AbortIncompleteMultipartUpload": {
            "DaysAfterInitiation": integer
         },
         "Filter": {
            "And": {
               "Prefix": "string",
               "Tags": [
                  {
                     "Key": "test",
                     "Value": "test"
                  }
               ]
            }
         }
      }
   ]
}

Related Pages

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.