I have a Google Cloud project that I want to delete.
However, when I press delete and enter the project id, I get the following error messages:
The project
Perform following steps as mentioned in Google Cloud's documentation on Forcibly delete a host project (Source: https://cloud.google.com/vpc/docs/deprovisioning-shared-vpc#removelien):
1) Authenticate to gcloud as an IAM member who can remove a project lien. If you have an organizational policy that limits which members can remove liens, you must authenticate as an IAM member with the resourcemanager.lienModifier role for your organization. If you do not have such a policy in place, the project owner for the host project can remove the lien.
Replace [ACCOUNT]
with the name of the appropriate IAM member:
gcloud auth login [ACCOUNT]
2) List the liens associated with the host project. Replace [HOST_PROJECT_ID]
with the ID of the host project.
gcloud alpha resource-manager liens list \
--project [HOST_PROJECT_ID]
3) Remove each lien by name, one at a time, until no more liens are present. Replace [LIEN_NAME]
with the name of the lien to remove.
gcloud alpha resource-manager liens delete [LIEN_NAME] \
--project [HOST_PROJECT_ID]
4) Confirm that all liens have been removed.
gcloud alpha resource-manager liens list \
--project [HOST_PROJECT_ID]
5) After removing the lien, you can log out of gcloud to protect the credentials of the IAM member which has permission to remove liens.
gcloud auth revoke [ACCOUNT]
6) The host project can now be shut down.
I know this is the late response to the question. However, the lien doesn't always mean payment due. You might have some projects linked with it. In my case, I have integrated projects from dialog flow and Firebase in google cloud.
Once unlinked, those projects from the main cloud project I was able to delete the project from Google Cloud.
>-
icon beside search bar on top right cornergcloud alpha resource-manager liens list
which will give you the list of liensthis sounds, as if you wouldn't have paid on time; according to the definition of a lien
:
a right to keep possession of property belonging to another person
until a debt owed by that person is discharged.
paying the outstanding debt is required, which would subsequently remove the lien.
until then, your project will be held hostage ...
the other answers refer to self-created liens; see Protecting Projects from Accidental Deletion with Liens; while in case Google's accounting has filed them, because of said reasons, you won't be able to remove them by yourself, unless complying with the invoices. you could check for the concrete reason
why the lien had been filed, with gcloud alpha resource-manager liens list
.
The cloud shell command is:
gcloud alpha resource-manager liens list
From that, you will get lists or instructions on what to do.