February 2020
Intermediate to advanced
440 pages
13h 51m
English
We can create a pre-signed URL using the Python SDK and test it as follows:
import boto3boto3.setup_default_session(profile_name='awssecadmin')s3_client = boto3.client('s3')url = s3_client.generate_presigned_url('get_object', Params={'Bucket': 'awsseccookbook', 'Key': 'mission-impossible.txt'}, ExpiresIn=300)print(url)
This will return the pre-signed URL:

Run the URL from a browser (much as we did in the previous section) before and after the specified time.
Read now
Unlock full access