Expiring journal table records
By default, the records in your journal table don't expire. To help minimize the storage costs for your journal table, you can enable journal table record expiration.
Note
If you created your S3 Metadata configuration before July 15, 2025, you can't enable journal table record expiration on that configuration. We recommend that you delete and re-create your configuration so that you can expire journal table records and create an inventory table. For more information, see Enabling inventory tables on metadata configurations created before July 15, 2025.
If you enable journal table record expiration, you can set the number of days to retain your journal
table records. To set this value, specify any whole number between 7
and
2147483647
. For example, to retain your journal table records for one year, set this
value to 365
.
Important
After journal table records expire, they can't be recovered.
Records are expired within 24 to 48 hours after they become eligible for expiration. Journal records are removed from the latest snapshot. The data and storage for the deleted records is removed through table maintenance operations.
If you've enabled journal table record expiration, you can disable it at any time to stop expiring your journal table records.
You can expire journal table records by using the Amazon S3 console, the AWS Command Line Interface (AWS CLI), the AWS SDKs, or the Amazon S3 REST API.
How to expire journal table records
To expire journal table records
Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/
. -
In the left navigation pane, choose General purpose buckets.
-
Choose the general purpose bucket that contains the metadata table configuration with the journal table that you want to expire records from.
-
On the bucket's details page, choose the Metadata tab.
-
On the Metadata tab, choose Edit, then choose Edit journal table record expiration.
-
On the Edit journal table record expiration page, choose Enabled under Record expiration.
-
Set the number of days to retain your journal table records. To set the Days after which records expire value, specify any whole number between
7
and2147483647
. For example, to retain your journal table records for one year, set this value to365
.Important
After journal table records expire, they can't be recovered.
-
Under Journal table records will expire after the specified number of days, select the checkbox.
-
Choose Save changes.
If you want to disable journal table record expiration, repeat the preceding steps, but choose Disabled instead of Enabled for step 6.
To run the following commands, you must have the AWS CLI installed and configured. If you don't have the AWS CLI installed, see Install or update to the latest version of the AWS CLI in the AWS Command Line Interface User Guide.
You can also run AWS CLI commands from the console by using AWS CloudShell. AWS CloudShell is a browser-based, pre-authenticated shell that you can launch directly from the AWS Management Console. For more information, see What is CloudShell? and Getting started with AWS CloudShell in the AWS CloudShell User Guide.
To expire journal table records by using the AWS CLI
To use the following example commands, replace the
with your own information. user input
placeholders
-
Create a JSON file that contains your journal table configuration, and save it (for example,
journal-config.json
). The following is a sample configuration.To set the
Days
value, specify any whole number between7
and2147483647
. For example, to retain your journal table records for one year, set this value to365
.{ "RecordExpiration": { "Expiration": "ENABLED", "Days":
10
} }To disable journal table record expiration, create the following sample configuration instead. If
Expiration
is set toDISABLED
, you must not specify aDays
value in the configuration.{ "RecordExpiration": { "Expiration": "DISABLED" } }
-
Use the following command to expire records from the journal table in your general purpose bucket (for example,
):amzn-s3-demo-bucket
aws s3api update-bucket-metadata-journal-table-configuration \ --bucket
amzn-s3-demo-bucket
\ --journal-table-configuration file://./journal-config
.json \ --regionus-east-2
You can send REST requests to expire journal table records. For more information, see UpdateBucketMetadataJournalTableConfiguration.
You can use the AWS SDKs to expire journal table records in Amazon S3. For information, see the list of supported SDKs.