I'm developing an application that utilizes Amazon S3, and I've encountered some confusion regarding its pricing model. When I generate a pre-signed URL for a `PUT` request, I see it costs around $0.005 for every 1,000 requests. To make things a bit easier for users uploading images, I set the expiration time for these URLs to one hour. This allows users to re-upload the same image without needing a new URL each time.
However, I'm concerned about whether repeatedly uploading to that same pre-signed URL incurs additional costs. Will I only be charged for generating the pre-signed URL, or will each upload to that URL also come with its own fee?
5 Answers
Remember, every time a user uploads something, that's considered a PUT request and will incur charges. So watch out for users that might keep uploading without stopping!
You'll actually be charged for every request made to S3 through that pre-signed URL. The pre-signing just gives temporary access to the bucket, but each upload still counts as a PUT request, which will cost you.
Good point! If users can only get a signed URL for a limited time, it'll help limit how often they hit your bucket and keep the costs lower.
It's generally best to set a shorter expiration for these URLs, like 1 minute, especially if you expect users to upload frequently. This way, you can control access more tightly while keeping costs in check.
Just to clarify, creating the pre-signed URL itself doesn't cost anything. It's an offline operation that doesn't hit AWS servers, but every upload will add to your bill.
Got it, thanks for clarifying!