Geek Logbook

Tech sea log book

Using Presing in AWS

Presing is a command you can use in the AWS CLI that allows anyone to have the pre-signed URL to make and HTTP get request to retrieve the data that is inside the bucket pre-signed. In the CLI you will execute:

aws s3 presign s3://DOC-EXAMPLE-BUCKET/test2.txt

And the output you’re going to receive is the following:

Then you can do an HTTP get request or, for example, load CSV for NEO4J:

LOAD CSV WITH HEADERS FROM "PRESING URL" as row return count(row)

One interesting feauture about presing is the possibilit to reduce the time the URL generated is exposed. For that, you have to use the command --expires-in The important values are:

  • Default is 3600 seconds = 60 minutes
  • The maximum is 604800 seconds = 10080 minutes = 168 hours = 7 days
  • The minimum is 300 seconds = 5 minutes


aws s3 presign s3://DOC-EXAMPLE-BUCKET/test2.txt --expires-in 300

You can also presing from python. For example:

import boto3
    url = boto3.client('s3').generate_presigned_url(
    Params={'Bucket': 'BUCKET_NAME', 'Key': 'OBJECT_KEY'},

Official documentation:

Leave a Reply

Your email address will not be published. Required fields are marked *.