我正在努力了解如何使用Elixir AWS S3 SDK 2.0.1为特定版本生成预签名的URL。
https://github.com/ex-aws/ex_aws_s3 https://hexdocs.pm/ex_aws_s3/2.0.1/ExAws.S3.html#presigned_url/5
我试图:
我的功能
def generate_presigned_url(s3_bucket, object, version_id \\\\ nil) do
s3_config = ExAws.Config.new(:s3, []);
query_params = [];
query_params =
if String.valid?(version_id) do
query_params ++ [{"versionId", version_id}];
else
query_params
end
presign_options = [query_params: query_params];
{:ok, presigned_url} =
ExAws.S3.presigned_url(
s3_config,
:get,
s3_bucket,
object,
presign_options
);
presigned_url;
end
如何获取给定版本的预签名网址?
谢谢!