A Presigned URL in S3 allows temporary access to an object in storage without the need to change the object's access permissions. It is a convenient tool for downloading files by third-party users. In this article, we will look at how to create a Presigned URL in two ways: in the Hostman control panel or via AWS CLI.
Presigned URL generation is only available for private buckets. To generate a Presigned URL:
The link will be copied to the clipboard and will remain active for 60 minutes. After this time, an attempt to follow the link will return a 403 error.
You can create a Presigned URL using AWS CLI with the following command:
aws s3 presign s3://<bucket>/<object> --expires-in 60 --endpoint-url https://s3.hostman.com
The --expires-in
parameter is optional. It defines how long the object will be available via the link (in seconds). If the parameter is not specified, the object will be available for 3600 seconds (1 hour).