gcp.resourcemanager.Lien
Explore with Pulumi AI
A Lien represents an encumbrance on the actions that can be performed on a resource.
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!",
});
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!")
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")
package main
import (
"fmt"
"github.com/pulumi/pulumi-gcp/sdk/v7/go/gcp/organizations"
"github.com/pulumi/pulumi-gcp/sdk/v7/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!"),
})
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
})
}
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!",
});
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 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!")
.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!
Create Lien Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new Lien(name: string, args: LienArgs, opts?: CustomResourceOptions);
@overload
def Lien(resource_name: str,
args: LienArgs,
opts: Optional[ResourceOptions] = None)
@overload
def Lien(resource_name: str,
opts: Optional[ResourceOptions] = None,
origin: Optional[str] = None,
parent: Optional[str] = None,
reason: Optional[str] = None,
restrictions: Optional[Sequence[str]] = None)
func NewLien(ctx *Context, name string, args LienArgs, opts ...ResourceOption) (*Lien, error)
public Lien(string name, LienArgs args, CustomResourceOptions? opts = null)
type: gcp:resourcemanager:Lien
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.
Parameters
- name string
- The unique name of the resource.
- args LienArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args LienArgs
- The arguments to resource properties.
- opts ResourceOptions
- Bag of options to control resource's behavior.
- ctx Context
- Context object for the current deployment.
- name string
- The unique name of the resource.
- args LienArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args LienArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args LienArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Constructor example
The following reference example uses placeholder values for all input properties.
var lienResource = new Gcp.ResourceManager.Lien("lienResource", new()
{
Origin = "string",
Parent = "string",
Reason = "string",
Restrictions = new[]
{
"string",
},
});
example, err := resourcemanager.NewLien(ctx, "lienResource", &resourcemanager.LienArgs{
Origin: pulumi.String("string"),
Parent: pulumi.String("string"),
Reason: pulumi.String("string"),
Restrictions: pulumi.StringArray{
pulumi.String("string"),
},
})
var lienResource = new Lien("lienResource", LienArgs.builder()
.origin("string")
.parent("string")
.reason("string")
.restrictions("string")
.build());
lien_resource = gcp.resourcemanager.Lien("lienResource",
origin="string",
parent="string",
reason="string",
restrictions=["string"])
const lienResource = new gcp.resourcemanager.Lien("lienResource", {
origin: "string",
parent: "string",
reason: "string",
restrictions: ["string"],
});
type: gcp:resourcemanager:Lien
properties:
origin: string
parent: string
reason: string
restrictions:
- string
Lien Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
The Lien resource accepts the following input properties:
- Origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- Parent 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").
- Reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- Restrictions 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']
- Origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- Parent 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").
- Reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- Restrictions []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']
- origin String
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason String
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
- origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
- origin str
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent str
- 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").
- reason str
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions Sequence[str]
- 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']
- origin String
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason String
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
Outputs
All input properties are implicitly available as output properties. Additionally, the Lien resource produces the following output properties:
- Create
Time string - Time of creation
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- A system-generated unique identifier for this Lien.
- Create
Time string - Time of creation
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- A system-generated unique identifier for this Lien.
- create
Time String - Time of creation
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- A system-generated unique identifier for this Lien.
- create
Time string - Time of creation
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- A system-generated unique identifier for this Lien.
- create_
time str - Time of creation
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- A system-generated unique identifier for this Lien.
- create
Time String - Time of creation
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- A system-generated unique identifier for this Lien.
Look up Existing Lien Resource
Get an existing Lien resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.
public static get(name: string, id: Input<ID>, state?: LienState, opts?: CustomResourceOptions): Lien
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
create_time: Optional[str] = None,
name: Optional[str] = None,
origin: Optional[str] = None,
parent: Optional[str] = None,
reason: Optional[str] = None,
restrictions: Optional[Sequence[str]] = None) -> Lien
func GetLien(ctx *Context, name string, id IDInput, state *LienState, opts ...ResourceOption) (*Lien, error)
public static Lien Get(string name, Input<string> id, LienState? state, CustomResourceOptions? opts = null)
public static Lien get(String name, Output<String> id, LienState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- resource_name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- name
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- state
- Any extra arguments used during the lookup.
- opts
- A bag of options that control this resource's behavior.
- Create
Time string - Time of creation
- Name string
- A system-generated unique identifier for this Lien.
- Origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- Parent 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").
- Reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- Restrictions 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']
- Create
Time string - Time of creation
- Name string
- A system-generated unique identifier for this Lien.
- Origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- Parent 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").
- Reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- Restrictions []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']
- create
Time String - Time of creation
- name String
- A system-generated unique identifier for this Lien.
- origin String
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason String
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
- create
Time string - Time of creation
- name string
- A system-generated unique identifier for this Lien.
- origin string
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason string
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
- create_
time str - Time of creation
- name str
- A system-generated unique identifier for this Lien.
- origin str
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent str
- 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").
- reason str
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions Sequence[str]
- 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']
- create
Time String - Time of creation
- name String
- A system-generated unique identifier for this Lien.
- origin String
- A stable, user-visible/meaningful string identifying the origin of the Lien, intended to be inspected programmatically. Maximum length of 200 characters.
- parent 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").
- reason String
- Concise user-visible strings indicating why an action cannot be performed on a resource. Maximum length of 200 characters.
- restrictions 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']
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}}
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Google Cloud (GCP) Classic pulumi/pulumi-gcp
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
google-beta
Terraform Provider.