Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in AWS by (12.9k points)

Is there a way to create presigned URL for objects in S3 bucket using AWS CLI?

I know that could be done using SDK, but is it possible with CLI?

I found this on one of the AWS docs, but can't complete the command:

s3cmd signurl s3://BUCKET/OBJECT <expiry_epoch|+expiry_offset>

Any help?

1 Answer

0 votes
by (18.2k points)

You can create a presigned URL using S3 presign. The following command will generate a URL that expires in 3600 seconds.

aws s3 presign s3://mybucket/myobject

You can modify the time for the expiration of URL by adding --expires-in as shown below

The following command will generate a URL that expires in 300 seconds.

aws s3 presign s3://mybucket/myobject  --expires-in 300

This pre-assigned URL allows anyone who has this URL to retrieve an S3 object with an HTTP GET request.

Learn more about AWS by going through AWS course and master this trending technology.

Related questions

Want to get 50% Hike on your Salary?

Learn how we helped 50,000+ professionals like you !

0 votes
1 answer
0 votes
1 answer

Browse Categories

...