Back

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

I want to download a directory from my s3.

When I need a file, the s3 management console (aws web console) allows me to download it, but when a directory, I have to use aws-cli, like:

$ aws s3 cp s3://mybucket/mydirectory/ . --recursive

My question is: Is there any way to get the s3 uri (s3://mybucket/mydirectory/) from s3 management console?

It's URL is available, but it is slightly different from s3 URI required by aws-cli. I could not find any menu to get the uri.

Thank you in advance!

1 Answer

0 votes
by (18.2k points)

Even though I couldn't find any official way of doing it, there is, in fact, a quick hack to do it.

Here's what I did:

pip install aws-s3-url2uri

The aws_s3_url2uri will be available for you to use after the installation. This command will convert the URLs to S3 URIs internally.

aws_s3_url2uri ls "https://console.aws.amazon.com/s3/home?region=<regionname>#&bucket=mybucket&prefix=mydir/newdir/"

Running the above command will call:

aws s3 ls s3://mybucket/mydir/newdir/

Related questions

Want to get 50% Hike on your Salary?

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

Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94.2k users

Browse Categories

...