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

(self-answer)

Because it seems there was no such way, I have created one:

pip install aws-s3-url2uri

And command aws_s3_url2uri will be available after installation.

This command internally converts the web console URLs to S3 URIs, so works with URLs and URIs and local paths:

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

calls

aws s3 ls s3://mybucket/mydir/mydir2/

internally.


It looks like this feature is now available in the AWS Web Console.

It is accessible in two ways:

  • Selecting the checkbox next to the file and clicking on "Copy S3 URI" button.

    enter image description here

  • Clicking on the file, and clicking on the "Copy S3 URI" button on the top right.

    enter image description here


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.


To convert an S3 URL displayed in the console such as https://s3.us-east-2.amazonaws.com/my-bucket-name/filename to an S3 URI, remove the https://s3.us-east-2.amazonaws.com/ portion and replace it with s3://, like so:

s3://my-bucket-name/filename