如何使用 gsutil 通过 http link 从 google 云存储下载到 AWS 实例或 s3 存储桶?

How to use gsutil to download from google cloud storage to AWS instance or s3 bucket with a http link?

我有一个 google 云存储下载 http link,我想直接将文件下载到 AWS 实例或 s3 存储桶。我试过 gsutil cp 或 rsync,但它们不支持将凭据作为参数发送。
这是 link.

https://storage.googleapis.com/<FILE PATH>?x-goog-signature=<SIGNATURE>&x-goog-algorithm=GOOG4-RSA-SHA256&x-goog-credential=<CREDENTIAL>goog4_request&x-goog-date=<DATE>Z&x-goog-expires=<EXPIRES>&x-goog-signedheaders=host

正如 @jarmod 提到的,您应该能够使用 wgetcurl 等工具从 GCS 下载对象,一旦您拥有可访问的URL 到它,然后上传到 Amazon S3。

但是,GCP 为 gsutil 提供了其他 ways to achieve that as well. For instance, you can interact with Amazon S3 using the gsutil tool as you intended initially by running gsutil cp or gsutil rsync. For that, you would need to add your Amazon S3 credentials to the .boto 配置文件。

如果您手头有一个已签名的 URL,就像您看到的那样,那么您不需要提供任何凭据(已签名的 URL 包含了所需的一切)并且您不需要需要使用 gsutil 或 rsync。

您可以使用 curl 或 wget 等 HTTP 客户端。例如:

wget -O filename.zip "https://the-signed-url-here"

请务必引用带符号的 URL,如上所示,因为其中包含与号 (&) 字符,许多操作系统和 shell 以特殊方式处理这些字符(通常 start in background)。