Lua Requires Chilkat v11.0.0+
Lua
Generate S3 Signed URL
See more Amazon S3 Examples
Demonstrates how to generate a pre-signed S3 URL.Chilkat Lua Downloads
local chilkat = require("chilkat")
-- This example assumes the Chilkat API to have been previously unlocked.
-- See Global Unlock Sample for sample code.
local http = chilkat.Http.new()
-- Insert your access key here:
http.aws_access_key = "AWS_ACCESS_KEY"
-- Insert your secret key here:
http.aws_secret_key = "AWS_SECRET_KEY"
http.aws_region = "us-west-2"
http.aws_endpoint = "s3-us-west-2.amazonaws.com"
local bucketName = "chilkattest"
local path = "starfish.jpg"
local signedUrl = http:s3_gen_presigned_url("GET", true, bucketName, path, 3600, "s3")
if not http.last_method_success then
print(http.last_error_text)
return
end
print(signedUrl)