我有一项服务,可以为可通过互联网访问的 S3 对象生成预签名 URL。
我试图弄清楚如何在使用存储桶/对象的 VPC 端点来将流量限制为仅该端点的本地网络时生成类似的预签名 URL。
这怎么能做到呢?
我可以从 CLI 访问,但无法获取要工作的对象的预签名 URL(通过 VPC 终端节点)...
aws s3 --region us-west-2 --endpoint-url https://bucket.vpce-xxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com
上面的 ls s3://bucket_name/ 有效,因此 vpc 终端节点正在运行。我需要如何创建预签名 URL 才能使用它而不是公共互联网?
因此,假设预签名 URL 是:
https://tl -vpc-endpoint-test.s3.us-west-2.amazonaws.com/test1.zip?....。
使用 VPC 端点需要什么?
I have a service that generates a pre-signed URL for S3 objects accessible via the internet.
I am trying to figure out how to generate a similar pre-signed URL while using a VPC endpoint to the bucket/object to limit the traffic to only that endpoint's local network.
How can this be done?
I can access from CLI, but cannot get the pre-signed URL for an object to work (over the VPC endpoint)...
aws s3 --region us-west-2 --endpoint-url https://bucket.vpce-xxxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com ls s3://bucket_name/
above works, so the vpc endpoint is functioning. How do I need to create the pre-signed URL to utilize it and not the public internet networking?
So, let's say the pre-signed URL is:
https://tl-vpc-endpoint-test.s3.us-west-2.amazonaws.com/test1.zip?.....
What does it need to be to utilize the VPC endpoint?
发布评论
评论(1)
您可以像这样生成 vpc 终端节点预签名 URL:
aws s3 --endpoint-url https://bucket.vpce-xxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com presign s3://awsexamplebucket/test2.txt
然后你会得到类似这样的内容:
<一href="https://bucket.vpce-xxxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com/awsexamplebucket/test2.txt?......" rel="nofollow noreferrer">https://bucket.vpce-xxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com/awsexamplebucket/test2.txt?......。
You can generate your vpc endpoint presigned url like this:
aws s3 --endpoint-url https://bucket.vpce-xxxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com presign s3://awsexamplebucket/test2.txt
Then you will get something like this:
https://bucket.vpce-xxxxxxxxx-xxxxxxx.s3.us-west-2.vpce.amazonaws.com/awsexamplebucket/test2.txt?.......