使用 aws cli 将 S3 对象 url 上传到存储桶后如何获取它?

How to get S3 object url after it's been uploaded to a bucket using aws cli?

我有一个文件需要上传到具有 public 读取权限的 s3 存储桶。

上传文件后,我需要在其他地方使用那个 s3 对象的 url。

s3对象上传到bucket后如何获取url?

我正在使用 aws-cli 上传文件:

aws s3 cp local_file s3_location

我正在寻找类似 https://s3_bucket-region.amazonaws.com/folder/filename.format

的内容

你可以构建URLPath-style access,你有所有的信息。

https://bucket-name.s3.Region.amazonaws.com/key name

In this example, my-bucket is the bucket name, US West (Oregon) is the Region, and puppy.png is the key name

https://my-bucket.s3.us-west-2.amazonaws.com/puppy.png

NOTE: path-style URLs 风格即将弃用。