0 votes
1 view
in AWS by (12.2k 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.6k 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/

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