Delete GCP Project With a Lien
A project lien in Google Cloud Platform (GCP) is a mechanism for preventing the deletion of a project until the lien is removed. Liens are typically used to protect projects that are considered to be important or that contain resources that are used by other projects.
There are two main types of project liens:
- User-created liens: These liens are created by users to protect projects from accidental deletion.
- System-generated liens: These liens are created automatically by GCP to protect projects that contain certain types of resources, such as shared VPC networks.
How to Delete a Google Cloud Project
Are you experiencing issues when trying to delete your Google Cloud project? Are you seeing an error in the project interface? If you are receiving any of these error messages when you delete one of your Google Cloud projects – You have come to the right place – This blog can help you.
Below is the dreaded error message:
A “lien” is a lock you can put on an account to prevent accidental deletion, it is easy to apply a lien without even knowing you have enabled the feature. You can still delete a project with a Lien against it – here is how to do it:
Step 1 – Log into the Google Cloud Console
Open your browser and log in to the Google Cloud Console – https://cloud.google.com/
Step 2 – Start the gCloud Console
From the Google Cloud Interface, open the Google Cloud console (gcloud)
Wait for the console to start, if you havent used GCloud before it will take a few moments to start your GCloud Resources
Once the console is started, connect to the require project by typing
gcloud config set project <my-project>
Step 3 – Validate your Project has a Lien
You can validate the lien by typing
gcloud alpha resource-manager liens list
Step 4 – Delete the Lein
To delete the lien type
gcloud alpha resource-manager liens delete [LIEN_NAME]
You can now delete the project. That’s it.
For further information and technical details, the Google Cloud documentation is a great resource for all things Google Cloud Projects.
Step 6 – Delete the Project
In this example, we will move over to the Google Cloud Console
Navigate to IAM and Admin, then press the Settings Button
Make sure you have your project selected at the top, in this example the project is called a “Richards Backups”. Then hit the “Shutdown” button to close and delete the project.
Confirm the project name and then shutdown
If successful, you should get this confirmation