> ## Documentation Index
> Fetch the complete documentation index at: https://deployz.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Remove a deployment

> Remove a deployment from a customer's AWS account, then delete the data it leaves behind.

Removing a deployment takes the application down in your customer's AWS account. It happens in up to three steps, and each one is separate on purpose so data is never deleted by accident:

1. **You remove the deployment.** Deployz deletes the application and most of its networking, and keeps the data.
2. **You delete retained data**, when your customer no longer needs it. Deployz deletes the database, stored files, and the rest.
3. **Your customer deletes the connector stack** in their AWS account.

## What removal deletes and keeps

> [!WARNING]
>
> Removing a deployment keeps the database, its credentials, and the storage bucket in your customer's AWS account. These retained resources keep costing your customer money in AWS until you [delete retained data](#delete-retained-data).

| Removed with the deployment | Retained until you delete retained data |
| - | - |
| The running application | The database, with deletion protection on. AWS automated backups continue. |
| The load balancer and most of the networking | The database credentials |
| The cache, if there is one | The storage bucket and the files in it |
| The certificates, the HTTPS listener, and the custom domain | The network parts the database uses |

The connector removes only resources tagged for this deployment. The removal dialog lists exactly what this deployment removes and keeps. Task-definition revisions that the connector registered, and AWS service-linked roles, also remain after removal. They cost nothing. Deployz also keeps its operational records of the deployment. For every AWS resource and what happens to it at each step, see [What remains after removal](https://deployz.dev/docs/reference/aws-resources.md#what-remains-after-removal).

> [!NOTE]
>
> Neither step deletes the Deployz connector stack, because your customer created it. Your customer deletes it last. See [Your customer deletes the connector stack](#your-customer-deletes-the-connector-stack).

Billing for the deployment stops when Deployz accepts the removal. If it was a live production deployment, your active production deployment count drops, and billing adjusts automatically if the billable quantity changes. See [Pricing and billing](https://deployz.dev/docs/account/billing.md). AWS charges for retained resources are on your customer's AWS bill, and they continue until the resources are deleted.

![What stays in the customer's AWS account after each removal step. Before removal, everything is in place. Step 1, Remove deployment in Deployz, deletes the application containers, the load balancer and most networking, the cache, configuration secret, and log groups, the custom domain, and the certificates. It keeps the database, its credentials, the storage bucket, the network the database uses, and the connector stack. Retained resources keep costing money in AWS. Step 2, Delete retained data, deletes everything retained except the connector stack. Step 3, deleting the connector stack in the AWS console, removes the last part. Delete the connector stack last.](https://mintcdn.com/deployz/nc75CAXckUHn4GYF/images/diagrams/removal-steps.svg?fit=max\&auto=format\&n=nc75CAXckUHn4GYF\&q=85\&s=8698f2600e311364e101859518265c03)

![What stays in the customer's AWS account after each removal step. Before removal, everything is in place. Step 1, Remove deployment in Deployz, deletes the application containers, the load balancer and most networking, the cache, configuration secret, and log groups, the custom domain, and the certificates. It keeps the database, its credentials, the storage bucket, the network the database uses, and the connector stack. Retained resources keep costing money in AWS. Step 2, Delete retained data, deletes everything retained except the connector stack. Step 3, deleting the connector stack in the AWS console, removes the last part. Delete the connector stack last.](https://mintcdn.com/deployz/nc75CAXckUHn4GYF/images/diagrams/removal-steps-mobile.svg?fit=max\&auto=format\&n=nc75CAXckUHn4GYF\&q=85\&s=6c936afa2e973f5dea7d09a6bea30bad)

What stays in the customer's AWS account after each step.

## Remove the deployment

**Who:** you (an owner or admin), in the Deployz dashboard. Members and your customer can't remove a deployment.

1. In **Deployments**, open the customer's deployment.
2. Open the **More actions** menu (the three-dot button next to the actions), then select **Remove deployment**.
3. In **Remove `<application>` for `<customer>`?**, wait for the removal plan to load. Review **Removed** and **Kept after removal**.
4. Type the customer's name exactly as shown, to confirm.
5. Select **Remove deployment**.

If the removal plan can't load, the dialog warns that removing the deployment may leave billable resources in your customer's AWS account.

**Remove deployment** is unavailable while another operation is running on the deployment. Once the connector has connected at least once, **Remove deployment** stays available when the connector is offline, so you can remove a deployment whose connector is gone.

### Remove a deployment that never connected

If the connector has never connected, for example the deployment still shows **Waiting for customer**, **Remove deployment** is available. Nothing is installed yet, so the dialog says nothing is removed from your customer's AWS account, and the removal completes right away. The install link stops working. If your customer already created the connector stack, it stays in their AWS account until they delete it.

## While the deployment is being removed

The deployment shows **Removing**, and the detail page shows **Removing deployment** with the connector's status and a list of the deployment's parts. The label next to each part says what the removal plan does with it: **Removing**, **Kept after removal**, **Kept as snapshot**, or **Kept if configured**. The labels don't change as the removal progresses, so a part marked **Removing** may already be gone. Other actions are unavailable until removal finishes.

When removal finishes, the deployment shows **Removed**, and the detail page shows **Deployment removed**.

### If removal fails

The detail page shows **Removal failed** and what went wrong. Select **Retry removal** to try again. It opens the same confirmation dialog. Until a removal succeeds, Deployz refuses to deploy, roll back, or restart the deployment. If it keeps failing, see [Find your problem](https://deployz.dev/docs/troubleshooting/overview.md).

If removal has failed at least twice, [contact Deployz support](https://share.hsforms.com/1dOsn_DJtRhq47DXIaRjeLw5auur). Support can complete the removal in Deployz. As with **Mark as removed without cleanup**, that doesn't remove anything that's left in your customer's AWS account.

### If the connector is offline

Deployz can only remove resources through the connector. If the connector is offline and removal has been waiting for an hour or more, the detail page shows **The Deployz connector is offline.** and a **Mark as removed without cleanup** button.

> [!WARNING]
>
> Only an owner or admin can select **Mark as removed without cleanup**. It finishes the removal in Deployz only, and you can't undo it. Deployz can't verify or remove anything in your customer's AWS account, so everything there may remain and keep costing money. Try to [reconnect the connector](https://deployz.dev/docs/operate/connector.md) first.

To go ahead, select **Mark as removed without cleanup**, then select **Mark as removed** in the confirmation dialog. The deployment shows **Removed**, with **Resources may remain in `<customer>`'s AWS account**. Your customer may need to delete those resources in their AWS console. See [Remove the application from your AWS account](https://deployz.dev/docs/customers/remove.md).

## Delete retained data

When your customer no longer needs the data, delete what removal kept. If they need the data, have them export or back it up first.

> [!WARNING]
>
> Deleting retained data can't be undone. Deployz deletes the database without a final snapshot, together with its automated backups. It also deletes the database credentials and any other secret of this deployment that's still in the account, the storage bucket and its files, any remaining cache, task-definition revisions, and the remaining network. If a removal was interrupted, it also deletes leftover certificates.

**Who:** you (an owner or admin), in the Deployz dashboard. The deletion runs through the connector, so the connector must be online. If it isn't, see [If the connector is gone](#if-the-connector-is-gone).

1. Open the removed deployment. You can find it with the **Removed** filter in **Deployments**.
2. Under the note about retained resources, select **Delete retained data**.
3. In **Delete `<customer>`'s retained data?**, review **This deletes**.
4. Type the customer's name exactly as shown, to confirm.
5. Select **Delete retained data**.

The detail page shows **Deleting retained data** until the deletion finishes. When it completes, the **Deployz connector** row shows **Removed · Deployz no longer has access**.

### If the connector is gone

If the connector is offline, for example because your customer already deleted the connector stack, Deployz can't delete the retained data through it. The detail page shows **The Deployz connector is offline** and a **Reconnect AWS** button instead of **Delete retained data**.

**Reconnect AWS** gives your customer a new install link that creates only the connector stack. It doesn't install the application again. When the connector is back, Deployz deletes the retained data.

> [!WARNING]
>
> Reconnecting AWS can't be undone. When your customer opens the new install link and connects their AWS account, Deployz deletes the retained data without a final database snapshot.

**Who:** you (an owner or admin), in the Deployz dashboard, then your customer on the install page.

1. Open the removed deployment, then select **Reconnect AWS**.
2. In **Reconnect AWS and delete retained data?**, type the customer's name exactly as shown, to confirm.
3. Select **Reconnect AWS**.
4. Select **Copy install link** and send the link to your customer.
5. Your customer opens the link. The page is titled **Reconnect `<application>` to delete its retained data**. They select **Connect AWS account** and create the connector stack, as in [Install the application](https://deployz.dev/docs/customers/install.md). If the old connector stack is still in their account, the page offers to update it instead.

While Deployz waits, the detail page shows **Waiting for `<customer>`** with the link. The link doesn't change if you reload the page. When the connector is back, Deployz deletes the retained data, and the page shows **Deleting retained data** as usual.

If your customer installed a new connector themselves after the removal, AWS refuses to let it delete the retained data, because that data belongs to the old connector. The connector row shows **Online · cannot delete this data**, and the page says **The connector is online, but it cannot delete this data**. Use **Reconnect AWS** in the same way. The new link installs a connector that can delete the data.

## Your customer deletes the connector stack

**Who:** your customer, in their AWS console.

When the retained data is deleted, the detail page shows **The Deployz connector is still installed in the customer AWS account** and the stack's name. Ask your customer to delete that stack. Their install link shows the same step.

Your customer should delete the connector stack last. After it's gone, Deployz can delete retained data only after a [Reconnect AWS](#if-the-connector-is-gone) step. Send your customer [Remove the application from your AWS account](https://deployz.dev/docs/customers/remove.md).

## Delete an application

When an application has no deployments left, you can delete it from Deployz. Its deployment history stays, and nothing changes in your customers' AWS accounts. Its install links stop working. You can't undo this, but you can add the same repository again later as a new application.

**Who:** you (an owner or admin), in the Deployz dashboard.

You can delete an application only when every deployment of it is removed and the retained data of each removed deployment is deleted. Until then, the **Danger zone** shows **Delete unavailable** with the reason.

1. Open the application and select **Configuration**.
2. Select the **Settings** tab.
3. In **Danger zone**, select **Delete application**.
4. Type the repository name exactly as shown, for example `owner/repo`, to confirm.
5. Select **Delete application**.

Deployz returns you to **Applications**.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.