Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Amazon S3 Expiration Date?

I hope this question isn't too rudimentary, but I'm confused...

In the S3 documentation I read:

All HTTP queries have an expiration parameter that allows you to set how long the query will be valid. For example, you can configure a web page graphic to expire after a very long period of time or a software download to only last for 24 hours.

For a publicly accessible data object (file), does this mean that the data object (file) itself will not be valid anymore, or that the browser will simply re-cache the object after the expiration date. As in, will I lose my data after ten years if I set my expirations that long? Or if I set a download for 24 hours, is it gone/inaccessible past that?

What if I don't set an expiration date?

like image 393
Asher Avatar asked Jan 10 '11 02:01

Asher


People also ask

What happens when an S3 object expires?

During this time, based on their expiration dates, any object found to be expired will be queued for removal. You will not be billed for any associated storage for those objects on or after their expiration date. If server access logging has been enabled for that S3 bucket, an S3. EXPIRE.

What is life cycle of S3?

An S3 Lifecycle configuration is an XML file that consists of a set of rules with predefined actions that you want Amazon S3 to perform on objects during their lifetime. You can also configure the lifecycle by using the Amazon S3 console, REST API, AWS SDKs, and the AWS Command Line Interface (AWS CLI).

Is S3 storage limited?

The total volume of data and number of objects you can store are unlimited. Individual Amazon S3 objects can range in size from a minimum of 0 bytes to a maximum of 5 TB. The largest object that can be uploaded in a single PUT is 5 GB.

How do I check my S3 bucket life cycle policy?

Sign in to the AWS Management Console and open the Amazon S3 console at https://console.aws.amazon.com/s3/ . In the Buckets list, choose the name of the bucket that you want to create a lifecycle rule for. Choose the Management tab, and choose Create lifecycle rule. In Lifecycle rule name, enter a name for your rule.


1 Answers

I believe you are referring to the signed urls for private data stored on Amazon S3.

If files are publicly accessible they can be accessed with a simple url to the file:

eg http://s3.amazonaws.com/[bucket]/[key]

However, they can be set to private in which case you need to provide a signed url to access the file. This url is created using your public and secret keys, and its this url that has an expiry time. eg

http://[bucket].s3.amazonaws.com/[key]?AWSAccessKeyId=[AWS_Public_Key]&Expires=1294766482&Signature=[generated_hash] 

As per your question, for web graphics, you might re-use the same generated url with the expiry time set far into the future so that browsers can cache the file, whereas for file downloads you'd probably create a new url for each request with the url set to expire only a day in advance to protect your data.

This DOES NOT expire/delete/remove your data stored on S3. It only affects the url to the file and you can generate as many urls with different expiry dates as you require.

like image 56
Geoff Appleford Avatar answered Oct 10 '22 12:10

Geoff Appleford