Infrastructure Manager lets you delete existing previews to remove obsolete
[preview metadata](https://docs.cloud.google.com/infrastructure-manager/docs/deployments-revisions.md.txt#preview_metadata)
and clean up preview resources.

Previews are automatically deleted if they target a deployment and that
deployment is updated or deleted. To remove an entire deployment instead, see
[Delete a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/delete-deployments.md.txt).

To preview a deployment before deleting or provisioning resources, see
[Preview a deployment](https://docs.cloud.google.com/infrastructure-manager/docs/preview-deployment.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 Infra 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).