如何在单个URL中包含S3存储桶名称和区域/端点? [英] How do I include an S3 bucket name and region/endpoint in a single URL?

查看:214
本文介绍了如何在单个URL中包含S3存储桶名称和区域/端点?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如果我在region=us-east-1中有一个名为mybucket的存储桶,那么我可以使用

If I have a bucket named mybucket in region=us-east-1, then I can access it using

aws s3 ls s3://mybucket --region=us-east-1

但是,这需要传递两条信息:

However, that requires passing two pieces of information:

  1. URL s3://mybucket
  2. 区域us-east-1(或终点,以任何一个为准)
  1. The URL s3://mybucket
  2. The region us-east-1 (or the endpoint, whichever)

理想情况下,URL是统一资源定位符.它具有协议(s3)和存储桶名称非常好,但是有一个AWS S3标准的单个URL可以对区域和存储桶名称进行编码,这样我就可以做到:

Ideally, a URL is a uniform resource locator. It is great that it has the protocol (s3) and the bucket name, but is there an AWS S3-standard single URL that encodes both the region and the bucket name, such that I can do:

aws s3 ls s3://mybucket_url_including_region_or_endpoint

为了澄清,我不是正在寻找端点列表.我正在寻找一个s3 URL真正如何成为一个统一的资源定位器,方法是将所有必要的信息封装在其中以获取资源(当然要减去auth凭证).

To clarify, I am not looking for the list of endpoints. I am looking for how an s3 URL really can be a uniform resource locator, by encapsulating all of the necessary information inside it to obtain the resource (minus auth credentials, of course).

推荐答案

s3://方案中没有规定对该区域进行编码.

There is no provision in the s3:// scheme for encoding the region.

还请注意,URL中的"U"代表统一,而不是通用.

Note also that the "U" in URL stands for uniform, not universal.

这篇关于如何在单个URL中包含S3存储桶名称和区域/端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆