5

I have a process where I get a signed url for a bucket that expires in 5 minutes. As soon as I get the signed url I start to upload the file to the bucket.

Lets say, it takes 6 minutes to fully upload the file. What will happen?

Is the expiration time referring to when the action (e.g. download, upload) can begin or is it for the action to complete?

Gary Holiday
  • 3,297
  • 3
  • 31
  • 72

2 Answers2

8

Is the expiration time referring to when the action (e.g. download, upload) can begin or is it for the action to complete?

Both :-)
When the action is atomic and it was started when the link was valid, this action will be completed even if the link became not valid during the process.
However if the action is mutli-step (e.g. multi part file upload), then the step that is performed with invalid link will be failed.

Source of truth.

nickolay.laptev
  • 2,253
  • 1
  • 21
  • 31
-1

Based on you use case, I simulated the environment in such a way that while initiating the upload, there was no error but as soon as the url expires upload fails.

So below is the response I get when I upload using a presigned URL and while uploading the url getting expired:

    <?xml version="1.0" encoding="UTF-8"?>
<Error>
    <Code>AccessDenied</Code>
    <Message>Request has expired</Message>
    <Expires>2019-12-13T06:45:29Z</Expires>
    <ServerTime>2019-12-13T06:45:33Z</ServerTime>
    <RequestId>8D0F75A23E9A1EC2</RequestId>
    <HostId>CNhlDK4RRVowLZSHdSF7pPJksIhnZdh99M3Sc9aBqnyCxLDlGG3XYMV0GMIdpz1pgM+HKLxsKVE=</HostId>
</Error>

So it is clear that, presigned url irrespective of POST or PUT, while uploading if the url is getting expired there, will be no file getting created in AWS s3 bucket console, and also AWS will give a response telling Request Expired

Varun Singh
  • 444
  • 6
  • 21
  • This is incorrect or perhaps unclear in its terminology. If the URL expires "while uploading" -- that is, *after the upload starts* -- the upload is allowed to continue and will succeed. – Michael - sqlbot Dec 15 '19 at 15:21