Lien class

A Lien represents an encumbrance on the actions that can be performed on a resource.

To get more information about Lien, see:

Example Usage

Resource Manager Lien

import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";

const project = new gcp.organizations.Project("project", {
    projectId: "staging-project",
    name: "A very important project!",
    deletionPolicy: "DELETE",
});
const lien = new gcp.resourcemanager.Lien("lien", {
    parent: pulumi.interpolate`projects/${project.number}`,
    restrictions: ["resourcemanager.projects.delete"],
    origin: "machine-readable-explanation",
    reason: "This project is an important environment",
});
import pulumi
import pulumi_gcp as gcp

project = gcp.organizations.Project("project",
    project_id="staging-project",
    name="A very important project!",
    deletion_policy="DELETE")
lien = gcp.resourcemanager.Lien("lien",
    parent=project.number.apply(lambda number: f"projects/{number}"),
    restrictions=["resourcemanager.projects.delete"],
    origin="machine-readable-explanation",
    reason="This project is an important environment")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;

return await Deployment.RunAsync(() =>
{
    var project = new Gcp.Organizations.Project("project", new()
    {
        ProjectId = "staging-project",
        Name = "A very important project!",
        DeletionPolicy = "DELETE",
    });

    var lien = new Gcp.ResourceManager.Lien("lien", new()
    {
        Parent = project.Number.Apply(number => $"projects/{number}"),
        Restrictions = new[]
        {
            "resourcemanager.projects.delete",
        },
        Origin = "machine-readable-explanation",
        Reason = "This project is an important environment",
    });

});
package main

import (
	"fmt"

	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/organizations"
	"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/resourcemanager"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		project, err := organizations.NewProject(ctx, "project", &organizations.ProjectArgs{
			ProjectId:      pulumi.String("staging-project"),
			Name:           pulumi.String("A very important project!"),
			DeletionPolicy: pulumi.String("DELETE"),
		})
		if err != nil {
			return err
		}
		_, err = resourcemanager.NewLien(ctx, "lien", &resourcemanager.LienArgs{
			Parent: project.Number.ApplyT(func(number string) (string, error) {
				return fmt.Sprintf("projects/%v", number), nil
			}).(pulumi.StringOutput),
			Restrictions: pulumi.StringArray{
				pulumi.String("resourcemanager.projects.delete"),
			},
			Origin: pulumi.String("machine-readable-explanation"),
			Reason: pulumi.String("This project is an important environment"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
pulumi {
  required_providers {
    gcp = {
      source = "pulumi/gcp"
    }
  }
}

resource "gcp_resourcemanager_lien" "lien" {
  parent       ="projects/${gcp_organizations_project.project.number}"
  restrictions = ["resourcemanager.projects.delete"]
  origin       = "machine-readable-explanation"
  reason       = "This project is an important environment"
}
resource "gcp_organizations_project" "project" {
  project_id      = "staging-project"
  name            = "A very important project!"
  deletion_policy = "DELETE"
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.organizations.Project;
import com.pulumi.gcp.organizations.ProjectArgs;
import com.pulumi.gcp.resourcemanager.Lien;
import com.pulumi.gcp.resourcemanager.LienArgs;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var project = new Project("project", ProjectArgs.builder()
            .projectId("staging-project")
            .name("A very important project!")
            .deletionPolicy("DELETE")
            .build());

        var lien = new Lien("lien", LienArgs.builder()
            .parent(project.number().applyValue(_number -> String.format("projects/%s", _number)))
            .restrictions("resourcemanager.projects.delete")
            .origin("machine-readable-explanation")
            .reason("This project is an important environment")
            .build());

    }
}
resources:
  lien:
    type: gcp:resourcemanager:Lien
    properties:
      parent: projects/${project.number}
      restrictions:
        - resourcemanager.projects.delete
      origin: machine-readable-explanation
      reason: This project is an important environment
  project:
    type: gcp:organizations:Project
    properties:
      projectId: staging-project
      name: A very important project!
      deletionPolicy: DELETE

Import

Lien can be imported using any of these accepted formats:

  • {{parent}}/{{name}}

When using the pulumi import command, Lien can be imported using one of the formats above. For example:

$ pulumi import gcp:resourcemanager/lien:Lien default {{parent}}/{{name}}

Constructors

Lien(String name, {LienArgs? args, CustomResourceOptions? options})
Creates a new Lien. name The Pulumi resource name. args Arguments used to configure this Lien. The set of arguments for Lien. options Resource options controlling this resource's behavior.
Lien.reference(String urn)
Creates a typed reference to an existing Lien resource.

Properties

childResources → Set<Resource>
finalinherited
completionSources ↔ Map<String, IOutputCompletionSource>
latefinalinherited
createTime ↔ Output<String>
Time of creation
latefinal
deletionPolicy ↔ Output<String>
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE. When a 'terraform destroy' or 'pulumi up' would delete the resource, the command will fail if this field is set to "PREVENT" in Terraform state. When set to "ABANDON", the command will remove the resource from Terraform management without updating or deleting the resource in the API. When set to "DELETE", deleting the resource is allowed.
latefinal
hashCode → int
The hash code for this object.
no setterinherited
id ↔ Output<String>
getter/setter pairinherited
isCustom → bool
Returns whether this resource is provider-managed.
no setterinherited
isProtected → bool
Returns whether this resource is protected from deletion.
no setterinherited
isRemote → bool
Whether this resource is registered as remote.
no setterinherited
isResourceReference → bool
Whether this instance represents a resource value returned over RPC.
finalinherited
name ↔ Output<String>
A system-generated unique identifier for this Lien.
latefinal
origin ↔ Output<String>
A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
latefinal
parent ↔ Output<String>
A reference to the resource this Lien is attached to. The server will validate the parent against those for which Liens are supported. Since a variety of objects can have Liens against them, you must provide the type prefix (e.g. "projects/my-project-name").
latefinal
reason ↔ Output<String>
Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
latefinal
resourceTransforms → List<ResourceTransform>
Inherited/explicit async transforms.
no setterinherited
restrictions ↔ Output<List<String>>
The types of operations which should be blocked as a result of this Lien. Each value should correspond to an IAM permission. The server will validate the permissions against those for which Liens are supported. An empty list is meaningless and will be rejected. e.g. 'resourcemanager.projects.delete'
latefinal
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
transformations → List<ResourceTransformation>
Inherited/explicit legacy transformations.
no setterinherited
urn ↔ Output<String>
latefinalinherited

Methods

failId(Object error) → void
Completes this resource ID with an error when registration fails.
inherited
failOutputs(Object error) → void
Completes all output properties with error.
inherited
failUrn(Object error) → void
Completes this resource URN with an error when registration fails.
inherited
getProvider(String moduleMember) → ProviderResource?
Returns provider for moduleMember's package, if configured.
inherited
getResourceName() → String
Returns this resource's logical name.
inherited
getResourceType() → String
Returns this resource's Pulumi type token.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerOutput<T>(String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output<T>
Registers a dynamic output property for this resource.
inherited
resolveId(String? value, {required bool isKnown}) → void
Resolves the provider-assigned ID for this resource.
inherited
resolveOutputs(Struct outputs) → void
Resolves all output properties from a monitor response payload.
inherited
resolveUrn(String value) → void
Resolves this resource's URN once assigned by the engine.
inherited
serializeProperties(Map<String, dynamic> properties) → Future<Struct>
Serializes resource properties for RPC transmission.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

get(String name, Input<String> id, {LienState? state, CustomResourceOptions? options}) → Lien
Gets an existing Lien resource's state with the given name and id.