Lien Args
data class LienArgs(val origin: Output<String>? = null, val parent: Output<String>? = null, val reason: Output<String>? = null, val restrictions: Output<List<String>>? = null) : ConvertibleToJava<LienArgs>
A Lien represents an encumbrance on the actions that can be performed on a resource. To get more information about Lien, see:
How-to Guides
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",
});
Content copied to clipboard
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")
Content copied to clipboard
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",
});
});
Content copied to clipboard
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v8/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v8/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
})
}
Content copied to clipboard
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.List;
import java.util.ArrayList;
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());
}
}
Content copied to clipboard
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
Content copied to clipboard
Import
Lien can be imported using any of these accepted formats:
{{parent}}/{{name}}
When using thepulumi import
command, Lien can be imported using one of the formats above. For example:
$ pulumi import gcp:resourcemanager/lien:Lien default {{parent}}/{{name}}
Content copied to clipboard
Constructors
Properties
Link copied to clipboard
Link copied to clipboard
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'