使用AWS开发工具包生成指向S3对象的预签名URL是否需要花费任何费用? [英] Does generating a pre-signed URL to an S3 object using the AWS SDK cost anything?

查看:199
本文介绍了使用AWS开发工具包生成指向S3对象的预签名URL是否需要花费任何费用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用任何语言的AWS开发工具包,您都可以生成指向PRIVATE S3对象的预签名URL,然后拥有该URL的任何人都可以使用它下载该对象.解释如下:

Using the AWS SDK in any language, you can generate a pre-signed URL to an PRIVATE S3 object and then anyone who has the URL can use it download the object. This is explained here:

https://docs.aws.amazon.com/AmazonS3/Latest/dev/ShareObjectPreSignedURL.html

这是减少您自己的服务器上的负载的好方法.如果您的客户端遵循重定向,则可以将实际的下载工作传递给S3.我的问题是,实际上生成该URL是否会花费任何成本-我的意思是实际的钱.我了解使用URL将产生GET请求费用,但是实际生成URL会如何?它是否等于S3 GET请求(每1000个请求$ .0004)或PUT请求(每1000个请求$ .005)或两者兼而有之?我似乎找不到任何文档.如果您要谈论数以千万计的请求,那么这一点很重要.

This is a great way to reduce load on your own server. You can pass off the actual download work to S3 if your clients with follow a redirect. My question is, does actually generating that URL cost anything--I mean actual MONEY. I understand that USING the URL will incur a GET request charge but what about actually generating the URL? Is it equivalent to an S3 GET request ($.0004 per 1000 requests) or a PUT request ($.005 per 1000 requests) or both or neither or something else? I can't seem to find any documentation this. This is important if you're talking about 10s of millions of requests.

推荐答案

不,它不需要任何费用.生成预签名URL是纯粹的客户端操作.没有与此相关的AWS成本,也没有网络活动.您正在使用的SDK会获取当前凭据,对象的存储桶和密钥,选择的方法(例如GET),到期时间,可选的HTTP标头以及计算和签名URL,所有这些都在本地完成.

No, it doesn't cost anything. Generating a pre-signed URL is a purely client-side operation. There are no AWS costs associated with this and there is no network activity. The SDK you're using takes your current credentials, the bucket and key for your object, your method of choice (e.g. GET), an expiration time, optional HTTP headers, and calculates and signs a URL, all done locally.

值得注意的是,您可以创建实际上不可用的预签名URL.例如,如果您使用无效或过期的凭据.或不存在的存储桶或对象密钥.在这两种情况下,您都可以创建一个预签名的URL,但是当该URL最终呈现给S3时,访问将被拒绝.

It's worth noting that you can create a pre-signed URL that's not actually usable. If you use invalid, or expired, credentials for example. Or a non-existent bucket or object key. In both cases, you will be able to create a pre-signed URL but access will be denied when the URL is eventually presented to S3.

这篇关于使用AWS开发工具包生成指向S3对象的预签名URL是否需要花费任何费用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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