# Deleting cloud accounts

An AWS account Productmind manages for your workspace is deleted from its page under
**Settings > Cloud accounts**: Productmind closes it in AWS, with everything in it. An account your
company connected itself is disconnected instead: see
[Disconnecting an account](/user-guide/settings/workspace-settings/cloud-accounts#disconnecting-an-account).

:::note
Cloud accounts is in early access, and is being turned on for a few organizations first.
:::

<Availability rollout permission="Owners and Admins, signed in to Productmind themselves, whatever your plan and the rollout." />

## Deleting an account Productmind manages

Deleting an account Productmind manages closes it in AWS, with everything in it: the apps that run
there and their data are gone for good, and their addresses stop answering until their environments
deploy to another account. Before you delete one, export the data you want to keep and move
anything that must keep running.

### To delete an account Productmind manages

1. In the **Cloud accounts** tab, choose the account.
2. Choose **Delete account**.
3. Productmind asks, for example, **Delete AWS account 210987654321?**. Enter its AWS account id
   to confirm.
4. Choose **Delete account**.

The account shows **Deleting**, and its page shows the date Productmind closes it. Until then the
account is frozen: what runs in it keeps serving, but nothing new can be deployed, created or
started. On that date Productmind closes it in AWS, and it shows **Closing**, then **Closed**. An
account whose setup failed is closed at once. One whose setup stopped before AWS created it shows
**Delete request** instead: nothing is closed, as nothing was made.

You can't delete an account while an environment deploys to it: the confirm says which ones do, and
its button stays off. Stop each environment deploying first. See
[To stop an environment deploying to an account](/user-guide/settings/workspace-settings/cloud-accounts#to-stop-an-environment-deploying-to-an-account).

Deleting the account also deletes the DNS zone of each domain you own that is in it: a detached
environment keeps its domain, so its zone can still be there. Your Owners and Admins get an email for
each domain that may point at the zone, which for a whole domain carries the records you keep in
Productmind as a zone file, and Productmind deletes the zone when it closes the account, whether or not
the domain still points at it. Remove the domain's NS records before then, and export its records under
[DNS records](/user-guide/settings/workspace-settings/dns-records) if you keep them in Productmind. The
confirm names each whole domain in the account: move its name servers first, or its mail stops with the
zone. It also names your other domains whose NS records Productmind keeps in those zones while their
own zones are in another account: add those NS records where the zone's domain moves (its export lists
them), or they stop resolving when the account closes. That includes the zone of a domain you removed
whose zone still stands in the account: it goes with the account too, with the NS records it holds. See
[Domains](/user-guide/settings/workspace-settings/domains) and
[Whole domains](/user-guide/settings/workspace-settings/whole-domains#mail-and-the-end-of-the-zone).

### To cancel the deletion

1. In the **Cloud accounts** tab, choose the account, which shows **Deleting**.
2. Choose **Cancel deletion**.

The account is **Ready** again, and takes deploys again within a few minutes. Once it shows
**Closing**, its deletion can no longer be cancelled.

## When Productmind closes an account

Productmind closes the accounts it manages for your organization before it suspends or deletes the
organization. Each one shows **Closing** at once, then **Closed**: there is no waiting period, it
offers no **Cancel deletion**, and the environments deploying to it stop deploying to it first. Your
organization's Owner gets an email naming the accounts. An account holding the DNS zone of a domain
you own, while the domain still points at it, stays open for at least seven days from the email your
Owners and Admins get about the domain, as for an account you delete. Creating an account Productmind manages stays off for your
organization until Productmind turns it back on. See
[Cloud accounts](/user-guide/settings/workspace-settings/cloud-accounts#how-cloud-accounts-behave).

## Permissions

| To | You need |
| --- | --- |
| Delete an account Productmind manages and cancel its deletion | The **Owner** or **Admin** role, signed in to Productmind yourself |

## Related topics

- [Cloud accounts](/user-guide/settings/workspace-settings/cloud-accounts)
- [Domains](/user-guide/settings/workspace-settings/domains)
- [Whole domains](/user-guide/settings/workspace-settings/whole-domains)
- [DNS records](/user-guide/settings/workspace-settings/dns-records)
- [Workspace settings](/user-guide/settings/workspace-settings/workspace)
