Sample code for 30+ languages & platforms
Lua

Wasabi Delete Bucket

See more Wasabi Examples

Demonstrates how to delete a new Wasabi bucket.

Chilkat Lua Downloads

Lua
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 = "access-key"

-- Insert your secret key here:
http.aws_secret_key = "secret-key"

-- To delete a bucket located in a different region, use the domain for that region, such as "s3.eu-central-1.wasabisys.com"
http.aws_endpoint = "s3.wasabisys.com"

http.keep_response_body = true

local success = http:s3_delete_bucket("chilkat-wasabi-testbucket")

if not success then
    print(http.last_error_text)
    -- Also examine the error response body from Wasabi:
    print(http.last_response_body)
else
    print("Bucket deleted.")
end