3

We provide REST api to upload user files, on backend we use S3 Bucket to store the user uploads.

As our REST api has timeout of 30sec, user may get timeouts based on filesize and his network.

So we thought of providing him a S3 Pre-Sign URLs for uploads, through which user can upload his large files using AJAX calls from frontend or using backend scheduled script.

Everything looks OK but we don't have any clue about provided s3 Pre-Signs: - whether he attempted to upload or not:

  • if attempted whether the upload is success or not
  • if failed, what was the error (url expired or something other..)

We can know about success case by searching the object key in our bucket. But in case of failures we don't have any clue.

Please let me know if there is anyway to track the S3 pre-sign access/uploads.

John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
Venkat Papana
  • 4,757
  • 13
  • 52
  • 74

1 Answers1

0

You will not know when a pre-signed URL is used, but another couple of options are:

  • You can configure an Amazon S3 Event to trigger when a new file is uploaded to a bucket. This could trigger an AWS Lambda function that can process the file or, at least, make a log that the file was uploaded.
  • You can use Amazon S3 Server Access Logging to track access to the bucket.
John Rotenstein
  • 241,921
  • 22
  • 380
  • 470
  • 1. I dont have any control on when and how user uploads a file using provided presign 2. I have a lambda trigger for S3 PUT events but it is being triggered for successful PUTs, but I want to log failures too. – Venkat Papana Oct 30 '19 at 18:43