Delete a project

Delete a project to remove a group of resources within an organization. When deleting a project in Google Distributed Cloud (GDC) air-gapped, the system first verifies the project is eligible for deletion. If the system reports precheck errors, you must manually fix the issues before you can initiate project deletion.

Before you begin

To get the permissions needed to delete a project, ask your Organization IAM Admin to grant you the Project Editor role (project-editor).

Delete a project and its resources

To delete a project, complete the following steps:

Console

  1. From the navigation menu of the GDC console, click Projects.

  2. Select the project that you want to delete.

  3. Ensure the clusters attached to the project are assigned to other projects. A cluster must be attached to a project.

  4. Click delete Delete Project.

  5. When prompted, type remove and click Confirm to initiate the project deletion prechecks.

If the project deletion prechecks complete successfully, the GDC system begins deleting the project. If the prechecks fail, error codes are reported in a prompt.

gdcloud

  1. Ensure you have the gdcloud CLI installed. For more information, see the gdcloud CLI Overview page.

  2. To delete the project, run:

    gdcloud projects delete PROJECT_ID
    

    Replace PROJECT_ID with the unique identifier for the project to delete.

If the project deletion prechecks complete successfully, the GDC system begins deleting the project. If the prechecks don't complete successfully, precheck failures with corresponding error codes are reported in the gdcloud CLI.

Terraform

  • To delete a project using Terraform, run:

    terraform destroy -target kubernetes_manifest.project-create
    

You must manually fix the issues reported before you can delete the project. See the Handle project deletion precheck failures section for steps to manually fix precheck failures.

Handle project deletion precheck failures

If the project deletion precheck task isn't successful, you are given a code that maps to the issue. Locate the code in the following sections, and complete the outlined steps to fix the issue.

OBJ-E0001: Buckets must be deleted in project

This error occurs when deleting a project if it has storage buckets remaining. You must remove the buckets before the project can be deleted successfully.

Follow the Delete storage buckets section to manually delete your project's storage buckets.

DBS-E000X: Database clusters must be deleted in project

This error occurs when deleting a project if it has database clusters remaining.

DBS-E0001: PostgreSQL database clusters must be deleted

This error indicates that you still have PostgreSQL database clusters remaining in the project you are trying to delete.

You must remove all of the PostgreSQL database clusters in your project before the project can be deleted successfully.

Follow the Delete database clusters section to manually delete your project's database clusters.

DBS-E0002: Oracle database clusters must be deleted

This error indicates that you still have Oracle database clusters remaining in the project you are trying to delete.

You must remove all of the Oracle database clusters in your project before the project can be deleted successfully.

Follow the Delete database clusters section to manually delete your project's database clusters.

DBS-E0003: AlloyDB Omni database clusters must be deleted

This error indicates that you still have AlloyDB Omni database clusters remaining in the project you are trying to delete.

You must remove all of the AlloyDB Omni database clusters in your project before the project can be deleted successfully.

Follow the Delete database clusters section to manually delete your project's database clusters.

VMM0001: Buckets must be deleted in shadow project

This error occurs when deleting a project if it has VM image buckets remaining in an internal project named a shadow project. Because this is an internal project, you must ask your Infrastructure Operator (IO) to complete this task.

Ask your IO to complete the VMM-R0101 runbook to delete the VM image buckets remaining in the shadow project. Be sure to provide the shadow project name to the IO, which follows the following format:

PROJECT_NAME-vm-system

Replace PROJECT_NAME with the name of the project you want to delete.