Jump to Content

Class DeleteBucketCommandProtected

Deletes the S3 bucket. All objects (including all object versions and delete markers) in the bucket must be deleted before the bucket itself can be deleted.

Related Resources

Example

Use a bare-bones client and the command you need to make an API call.

import { S3Client, DeleteBucketCommand } from "@aws-sdk/client-s3"; // ES Modules import
// const { S3Client, DeleteBucketCommand } = require("@aws-sdk/client-s3"); // CommonJS import
const client = new S3Client(config);
const command = new DeleteBucketCommand(input);
const response = await client.send(command);

See

Example

To delete a bucket

// The following example deletes the specified bucket.
const input = {
"Bucket": "forrandall2"
};
const command = new DeleteBucketCommand(input);
await client.send(command);
// example id: to-delete-a-bucket-1473108514262

Hierarchy

Constructors

Properties

middlewareStack: MiddlewareStack<DeleteBucketCommandInput, DeleteBucketCommandOutput>

Methods