Stay organized with collections Save and categorize content based on your preferences.
This document is for Project owners and Organization administrators looking to add protections against project deletion.
You can place a lien upon a project to block the project's deletion until you remove the lien. This can be useful to protect projects of particular importance.
Liens can also be placed upon a project automatically. For example, if you allow Identity and Access Management (IAM) service accounts from one project to be attached to resources in other projects, a lien is placed upon the project where the service accounts are located.
Before you beginThe gcloud CLI is the easiest way to interact with project liens. If you don't have it installed, you can use Google Cloud Shell.
Required rolesTo get the permissions that you need to modify liens, ask your administrator to grant you the Project lien modifier (roles/resourcemanager.lienModifier
) IAM role on projects. For more information about granting roles, see Manage access to projects, folders, and organizations.
This predefined role contains the permissions required to modify liens. To see the exact permissions that are required, expand the Required permissions section:
Required permissionsThe following permissions are required to modify liens:
resourcemanager.projects.updateLiens
resourcemanager.projects.get
You might also be able to get these permissions with custom roles or other predefined roles.
Placing a lien on a projectTo place a lien on a project, use the alpha resource-manager liens create
command.
gcloud alpha resource-manager liens create \ --project=PROJECT_ID \ --restrictions=PERMISSION_RESTRICTION \ --reason=LIEN_REASON \ --origin=LIEN_ORIGIN
Replace the following:
resourcemanager.projects.delete
."This project is protected by a lien"
.To list all liens applied to a project, use the alpha resource-manager liens list
command.
gcloud alpha resource-manager liens list
The output is similar to the following:
gcloud alpha resource-manager liens list
NAME ORIGIN REASON
p1061081023732-l3d8032b3-ea2c-4683-ad48-5ca23ddd00e7 user@example.com testing
Removing liens from a project
To remove a lien from a project, use the alpha resource-manager liens delete
command.
gcloud alpha resource-manager liens delete LIEN_NAME
Replace LIEN_NAME with the name of the lien to be deleted, such as p1061081023732-l3d8032b3-ea2c-4683-ad48-5ca23ddd00e7
.
API Reference: REST Resource: liens
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2025-10-02 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-10-02 UTC."],[],[]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.5