> **Page index:** https://kmtest.yngvar-hey-dev.oslo.systems/llms.txt lists every page on this site, with a link to its Markdown version.
>
> **Beyond these docs:** Team Utviklerflyt's golden-path plugin for Claude Code answers golden path questions from the source code of the platform's templates, Terraform modules and workflows. [Golden path plugin for Claude Code](/set-up-your-machine/golden-path-plugin-for-claude-code/index.md) shows how to install it.

# Delete remote state bucket

After destroying each stack using `terraform destroy`, manually delete the S3 bucket used for remote state storage. Terraform does not support deleting S3 buckets that are not empty.

## Using the AWS CLI

List the buckets in the AWS account:

```bash
aws s3 ls
```

```bash
2020-01-01 00:00:00 ok-iac-config-12345678910-eu-west-1-my-team-dev
```

Delete the bucket:

```bash
aws s3 rb s3://ok-iac-config-12345678910-eu-west-1-my-team-dev --force
```

## Using the AWS Management Console

<!-- prettier-ignore-start -->
!!! info "Bucket name"
    The name of the bucket is inherited from the `metadata.environment` value in the `env.yml` file.

    ```text title="Example bucket name"
    ok-iac-config-12345678910-eu-west-1-my-team-dev
    ```
<!-- prettier-ignore-end -->

1. Go to the AWS console and navigate to the [S3 list](https://s3.console.aws.amazon.com/s3/home?region=eu-west-1){:target="_blank"}.
1. Click on the bucket that was created by the `remote_state` stack.
1. Click on the **Empty** button.
1. Click on the **Delete** button.

## Verification

List the buckets again and confirm the deleted bucket is no longer in the output:

```bash
aws s3 ls
```
