Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to remove a lien from Google Cloud project?

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 has a lien against it.

Tracking Number: {tracking number}

How do I delete the lien so that I can delete the project?

Thanks.

like image 700
asportnoy Avatar asked Dec 09 '17 19:12

asportnoy


People also ask

How many days Google take to remove a project completely after shutdown?

All project data associated with Google Cloud and Google APIs services becomes inaccessible. After a 30-day waiting period, the project and associated data are permanently deleted from the console. Note that after the 30-day waiting period ends, the time it takes to completely delete a project may vary.


2 Answers

  • Go to https://console.cloud.google.com/
  • Click >- icon beside search bar on top right corner
  • The cloud shell cmd will show on the bottom
  • Type gcloud alpha resource-manager liens list which will give you the list of liens
  • Following the instruction to remove the lien
like image 130
starbugs Avatar answered Oct 20 '22 08:10

starbugs


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.

like image 31
Jerry Chong Avatar answered Oct 20 '22 08:10

Jerry Chong