# DeleteBucket

Required Frends version: 5.7+

Required .NET version: 8.0

Compatible Agents: Unknown

Source code: <https://github.com/FrendsPlatform/Frends.AmazonS3>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                  | Description                                                                                                                                                                                                                                                           |
| --------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| BucketName : `String` | <p>AWS S3 bucket's name to be deleted.</p><p>Must follow AWS S3 bucket naming requirements.</p><p>See <https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucketnamingrules.html></p><p><br>Default: <code>-</code><br>Example: <code>my-example-bucket</code></p> |
| {% endtab %}          |                                                                                                                                                                                                                                                                       |

{% tab title="Parameter: Connection" %}

| Name                            | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      |
| ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| 🗝AwsAccessKeyId : `String`     | <p>AWS Access Key ID for authentication.</p><p>This is the public part of your AWS credentials.</p><p><br>Default: <code>-</code><br>Example: <code>AKIAQWERTY7NJ5Q7NZ6Q</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              |
| 🗝AwsSecretAccessKey : `String` | <p>AWS Secret Access Key for authentication.</p><p>This is the private part of your AWS credentials and should be kept secure.</p><p><br>Default: <code>-</code><br>Example: <code>TVh5hgd3uGY/2CqH+Kkrrg3dadbXLsYe0jC3h+WD</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           |
| Region : `Region`               | <p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><p>Possible values:</p><ul><li><code>AfSouth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApEast1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApNortheast1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApNortheast2</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApNortheast3</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApSouth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApSoutheast1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>ApSoutheast2</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>CaCentral1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>CnNorth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>CnNorthWest1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuCentral1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuNorth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuSouth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuWest1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuWest2</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>EuWest3</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>MeSouth1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>SaEast1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>UsEast1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>UsEast2</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>UsWest1</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><ul><li><code>UsWest2</code>:</li></ul><p>AWS region where the S3 bucket is located.</p><p>Must match the region where the bucket was created.</p><p><br>Default: <code>-</code><br>Example: <code>EuCentral1</code></p> |
| {% endtab %}                    |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                                                                                                                         |
| -------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`  | <p>Determines whether to throw an exception when the operation fails.</p><p>If false, errors will be returned in the Result object instead of throwing exceptions.</p><p><br>Default: <code>True</code><br>Example: <code>false</code></p>                                                          |
| ErrorMessageOnFailure : `String` | <p>Custom error message to use when an error occurs.</p><p>If empty, a default error message will be used.</p><p>This message will be included in both thrown exceptions and Error objects.</p><p><br>Default: <code>-</code><br>Example: <code>Failed to delete the specified S3 bucket</code></p> |
| {% endtab %}                     |                                                                                                                                                                                                                                                                                                     |

{% tab title="Result: Result" %}

| Name                | Description                                                                                                                                                                                                                                                   |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Success : `Boolean` | <p>Indicates whether the delete bucket operation completed successfully. Returns true if the bucket was deleted or if the bucket did not exist. Returns false only when an error occurred and ThrowErrorOnFailure is false.<br>Example: <code>true</code></p> |
| Error : `Error`     | <p>Contains error information when the operation fails. This property is null when Success is true. Only populated when ThrowErrorOnFailure is false and an error occurs.<br>Example: <code>null</code></p>                                                   |
| {% endtab %}        |                                                                                                                                                                                                                                                               |

{% tab title="Changelog" %}

## Changelog

### \[2.1.0] - 2025-12-29

#### Changed

* Updated AWS SDK version.

### \[2.0.0] - 2025-07-16

* **\[Breaking]** Moved `Connection.BucketName` to `Input.BucketName` - update your processes to use the Input tab for bucket name configuration
* **\[Breaking]** Added new `Options` parameter class with error handling configuration
* **\[Breaking]** Updated Result class structure - removed `Data` property and added `Error` property for consistent error reporting
* Added `ThrowErrorOnFailure` option (default: false) to control exception throwing behavior
* Added `ErrorMessageOnFailure` option for custom error messages
* Updated project to target .NET 8.0 for improved performance and compatibility
* Enhanced XML documentation with better examples and descriptions

### \[1.0.0] - 2023-07-31

#### Added

* Initial implementation
  {% endtab %}
  {% endtabs %}
