This page describes how to delete existing previews. When you delete a
preview, you delete the
[preview's metadata](https://docs.cloud.google.com/infrastructure-manager/docs/deployments-revisions.md.txt#preview_metadata).

Previews are automatically deleted if they target a deployment and that
deployment is updated or deleted.

If you have not created a preview, see
[Preview a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/preview-deployment.md.txt).

If you want to delete a deployment, see
[Delete a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/delete-deployments.md.txt).

## Before you begin

Ensure that you have the IAM permissions needed to delete previews: `roles/config.admin`.

## Delete a preview

To delete a preview:

    gcloud infra-manager previews delete projects/PROJECT_ID/locations/LOCATION/previews/PREVIEW_ID

Replace:

- <var translate="no">PROJECT_ID</var> is the project ID where Infrastructure Manager runs.
- <var translate="no">LOCATION</var> is the location where Infra Manager runs. See [Infrastructure Manager locations](https://docs.cloud.google.com/infrastructure-manager/docs/locations.md.txt) for the list of valid locations.
- <var translate="no">PREVIEW_ID</var> is the preview identifier of the preview.

## What's next

- [Create a new preview](https://docs.cloud.google.com/infrastructure-manager/docs/preview-deployment.md.txt).
- [View and list previews](https://docs.cloud.google.com/infrastructure-manager/docs/list-preview.md.txt).
- Use Infra Manager to [deploy resources](https://docs.cloud.google.com/infrastructure-manager/docs/deploy-resources.md.txt).
- Learn more about [Terraform with Infra Manager](https://docs.cloud.google.com/infrastructure-manager/docs/infra-manager-terraform.md.txt).