Sample code for 30+ languages & platforms
Rust Requires Chilkat v11.0.0+

Generate S3 Signed URL

See more Amazon S3 Examples

Demonstrates how to generate a pre-signed S3 URL.

Chilkat Rust Downloads

Rust
// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

let http = chilkat::Http::new();

// Insert your access key here:
http.set_aws_access_key("AWS_ACCESS_KEY");

// Insert your secret key here:
http.set_aws_secret_key("AWS_SECRET_KEY");

http.set_aws_region("us-west-2");
http.set_aws_endpoint("s3-us-west-2.amazonaws.com");

let bucket_name = "chilkattest".to_string();
let path = "starfish.jpg".to_string();

let Ok(signed_url) = http.s3_gen_presigned_url("GET", true, &bucket_name, &path, 3600, "s3") else {
    println!("{}", http.last_error_text());
    return;
};

println!("{}", signed_url);