Configuring a Pre-Signed URL

You can configure a pre-signed URL that enables an object to be accessible through the Internet. Any user to whom you send the pre-signed URL can access the object for the time you specify.

Using a pre-signed URL, the user you send the URL to does not need any permission or authentication to download your object.

You can manage your object storage resources using s3cmd commands. For more information, see s3cmd.

Configuring a Pre-signed URL Using AWS CLI

Before you begin: Install and configure AWS CLI and set up your profile. For more information, see Installing and Configuring AWS CLI.

To configure a pre-signed URL, use the presign command following this syntax:

Request sample
$ aws s3 presign s3://BUCKET/OBJECT \
    --profile YOUR_PROFILE \
    --expires-in 3600 \

This command contains the following attributes that you need to specify:

  • (optional) profile: The named profile you want to use, created when configuring AWS CLI. For more information, see Installing and Configuring AWS CLI.

  • s3://BUCKET/OBJECT: The path to the object you want to share in its bucket.

  • expires-in: The time left before the URL expires, in seconds.

    The maximum duration of a pre-signed URL is 604800 seconds (or 1 week).

  • endpoint: The endpoint corresponding to the Region you want to send the request to.

The presign command returns the following element:

  • URL: The URL at which your object is available.

Result sample

Related Page

AWS™ and Amazon Web Services™ are trademarks of Amazon Technologies, Inc or its affiliates in the United States and/or other countries.