
If the cost of your versioning is significant, you will an increase for those 10 days with a drop when you rollback the change. For example, you can increase the retention to 40 days, wait 10 days and rollback the change to 30 days. You can temporarily increase it and use the daily view of S3 costs in Cost Explorer to see if and how much it affects your billing. Let us assume you have a retention of 30 days for previous versions. But it can be used as a proxy, if you have a lifecycle rule in place to permanently delete previous versions. We said that Cost Explorer does not expose the cost of versioning. For example, if the prefix of all your objects is randomly distributed between aa and zz, you can use a subset of objects using S3 Inventory or AWS CLI to estimate your costs.įor example, out of the 676 prefixes (26 × 26) below you can sample just a handful of them. If you have a well distributed bucket, you can analyze only a meaningful subset of your data.

After calculating the size from both the reports, subtract the current version objects size from all version objects size.īut even easier, we can generate a single inventory report including only the current versions, compute the storage and compare it to the total bucket size from CloudWatch. We can generate two inventory reports in which the first report includes all versions of object and the second includes only the current versions. What is it?Īmazon S3 inventory provides comma-separated values (CSV), Apache optimized row columnar (ORC) or Apache Parquet (Parquet) output files that list your objects and their corresponding metadata on a daily or weekly basis for an S3 bucket or a shared prefix (that is, objects that have names that begin with a common string). S3 Inventory then!Ī not immediate but very accurate way to determine the cost of versioning is using S3 Inventory. Besides, listing periodically all the objects has its own costs and you might end up paying more than what you spend in versioning. Unfortunately, the approach does not scale when you have a large bucket. The output can be processed and the compared with the total size from the CloudWatch metric to get the estimate of the total version size. A very dummy command could be: $ aws s3 ls s3://YourBucketName -summarize -human-readable –recursive

Including listing all the objects in your bucket and figure out their size and versioning status. You can do almost everything using the AWS CLI. The current metrics available for a S3 bucket refer only to the number of objects or to the different storage classes, for example: Available metrics for the bucketĬloudWatch could only help if we knew upfront the ratio between current and previous versions. Unfortunately there is no metric that covers versioning. What about CloudWatch?Ī metric in CloudWatch would be the perfect solution, as it would be easy to track and monitor. And the Cost and Usage Report provides only the total cost of your bucket. There is no direct way to find the added cost of the versioned objects using Cost Explorer. It would be anyway too costly to do that. If you have 100s of TB or PB of data, millions or billions of objects, you cannot list the bucket and check the items one by one.

Knowing that normal rates apply for every version of an object does not answer the questions: Versioning has a simple price structure but how do you monitor the impact on your storage costs? If you spend 10K every month on S3, it is useful to know if versioning is 5%, 10% or 20% of the bill. Normal Amazon S3 rates apply for every version of an object stored or requested And as for S3 FAQ, the billing for once is obvious: Keeping many variants of an object will not be free. With versioning, you can easily recover from both unintended user actions and application failures. You can use versioning to preserve, retrieve, and restore every version of every object stored in your Amazon S3 bucket. Versioning is a means of keeping multiple variants of an object in the same bucket. It gives us peace of mind and the ability to recover our data if something goes wrong.
