Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any way to get s3 uri from aws web console?

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!

like image 316
keisuke Avatar asked Nov 15 '16 03:11

keisuke


People also ask

What is AWS S3 URI?

If you access a bucket programmatically, Amazon S3 supports RESTful architecture in which your buckets and objects are resources, each with a resource URI that uniquely identifies the resource. Amazon S3 supports both virtual-hosted–style and path-style URLs to access a bucket.

What is the URL of my S3 bucket?

An S3 bucket can be accessed through its URL. The URL format of a bucket is either of two options: http://s3.amazonaws.com/[bucket_name]/ http://[bucket_name].s3.amazonaws.com/

How do I get my S3 upload URL?

You can get the resource URL either by calling getResourceUrl or getUrl . AmazonS3Client s3Client = (AmazonS3Client)AmazonS3ClientBuilder. defaultClient(); s3Client. putObject(new PutObjectRequest("your-bucket", "some-path/some-key.

Is S3 URL public?

If you're using an Amazon S3 bucket to share files, you'll first need to make those files public. If you don't, when your users try to access the URL they'll get an Access Denied error.


1 Answers

No, it is not displayed in the console. However, it is simply:

s3://<bucket-name>/<key> 

Directories are actually part of the key. For example, foo.jpg stored in an images directory will actually have a key (filename) of images/foo.jpg.

like image 92
John Rotenstein Avatar answered Oct 08 '22 04:10

John Rotenstein