rancher2.ProjectRoleTemplateBinding
Explore with Pulumi AI
Provides a Rancher v2 Project Role Template Binding resource. This can be used to create Project Role Template Bindings for Rancher v2 environments and retrieve their information.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";
// Create a new rancher2 Project Role Template Binding
const foo = new rancher2.ProjectRoleTemplateBinding("foo", {
name: "foo",
projectId: "<project_id>",
roleTemplateId: "<role_template_id>",
userId: "<user_id>",
});
import pulumi
import pulumi_rancher2 as rancher2
# Create a new rancher2 Project Role Template Binding
foo = rancher2.ProjectRoleTemplateBinding("foo",
name="foo",
project_id="<project_id>",
role_template_id="<role_template_id>",
user_id="<user_id>")
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v7/go/rancher2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
// Create a new rancher2 Project Role Template Binding
_, err := rancher2.NewProjectRoleTemplateBinding(ctx, "foo", &rancher2.ProjectRoleTemplateBindingArgs{
Name: pulumi.String("foo"),
ProjectId: pulumi.String("<project_id>"),
RoleTemplateId: pulumi.String("<role_template_id>"),
UserId: pulumi.String("<user_id>"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rancher2 = Pulumi.Rancher2;
return await Deployment.RunAsync(() =>
{
// Create a new rancher2 Project Role Template Binding
var foo = new Rancher2.ProjectRoleTemplateBinding("foo", new()
{
Name = "foo",
ProjectId = "<project_id>",
RoleTemplateId = "<role_template_id>",
UserId = "<user_id>",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rancher2.ProjectRoleTemplateBinding;
import com.pulumi.rancher2.ProjectRoleTemplateBindingArgs;
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) {
// Create a new rancher2 Project Role Template Binding
var foo = new ProjectRoleTemplateBinding("foo", ProjectRoleTemplateBindingArgs.builder()
.name("foo")
.projectId("<project_id>")
.roleTemplateId("<role_template_id>")
.userId("<user_id>")
.build());
}
}
resources:
# Create a new rancher2 Project Role Template Binding
foo:
type: rancher2:ProjectRoleTemplateBinding
properties:
name: foo
projectId: <project_id>
roleTemplateId: <role_template_id>
userId: <user_id>
Create ProjectRoleTemplateBinding Resource
Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.
Constructor syntax
new ProjectRoleTemplateBinding(name: string, args: ProjectRoleTemplateBindingArgs, opts?: CustomResourceOptions);
@overload
def ProjectRoleTemplateBinding(resource_name: str,
args: ProjectRoleTemplateBindingArgs,
opts: Optional[ResourceOptions] = None)
@overload
def ProjectRoleTemplateBinding(resource_name: str,
opts: Optional[ResourceOptions] = None,
project_id: Optional[str] = None,
role_template_id: Optional[str] = None,
annotations: Optional[Mapping[str, str]] = None,
group_id: Optional[str] = None,
group_principal_id: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
user_id: Optional[str] = None,
user_principal_id: Optional[str] = None)
func NewProjectRoleTemplateBinding(ctx *Context, name string, args ProjectRoleTemplateBindingArgs, opts ...ResourceOption) (*ProjectRoleTemplateBinding, error)
public ProjectRoleTemplateBinding(string name, ProjectRoleTemplateBindingArgs args, CustomResourceOptions? opts = null)
public ProjectRoleTemplateBinding(String name, ProjectRoleTemplateBindingArgs args)
public ProjectRoleTemplateBinding(String name, ProjectRoleTemplateBindingArgs args, CustomResourceOptions options)
type: rancher2:ProjectRoleTemplateBinding
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 ProjectRoleTemplateBindingArgs
- 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 ProjectRoleTemplateBindingArgs
- 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 ProjectRoleTemplateBindingArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args ProjectRoleTemplateBindingArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args ProjectRoleTemplateBindingArgs
- 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 projectRoleTemplateBindingResource = new Rancher2.ProjectRoleTemplateBinding("projectRoleTemplateBindingResource", new()
{
ProjectId = "string",
RoleTemplateId = "string",
Annotations =
{
{ "string", "string" },
},
GroupId = "string",
GroupPrincipalId = "string",
Labels =
{
{ "string", "string" },
},
Name = "string",
UserId = "string",
UserPrincipalId = "string",
});
example, err := rancher2.NewProjectRoleTemplateBinding(ctx, "projectRoleTemplateBindingResource", &rancher2.ProjectRoleTemplateBindingArgs{
ProjectId: pulumi.String("string"),
RoleTemplateId: pulumi.String("string"),
Annotations: pulumi.StringMap{
"string": pulumi.String("string"),
},
GroupId: pulumi.String("string"),
GroupPrincipalId: pulumi.String("string"),
Labels: pulumi.StringMap{
"string": pulumi.String("string"),
},
Name: pulumi.String("string"),
UserId: pulumi.String("string"),
UserPrincipalId: pulumi.String("string"),
})
var projectRoleTemplateBindingResource = new ProjectRoleTemplateBinding("projectRoleTemplateBindingResource", ProjectRoleTemplateBindingArgs.builder()
.projectId("string")
.roleTemplateId("string")
.annotations(Map.of("string", "string"))
.groupId("string")
.groupPrincipalId("string")
.labels(Map.of("string", "string"))
.name("string")
.userId("string")
.userPrincipalId("string")
.build());
project_role_template_binding_resource = rancher2.ProjectRoleTemplateBinding("projectRoleTemplateBindingResource",
project_id="string",
role_template_id="string",
annotations={
"string": "string",
},
group_id="string",
group_principal_id="string",
labels={
"string": "string",
},
name="string",
user_id="string",
user_principal_id="string")
const projectRoleTemplateBindingResource = new rancher2.ProjectRoleTemplateBinding("projectRoleTemplateBindingResource", {
projectId: "string",
roleTemplateId: "string",
annotations: {
string: "string",
},
groupId: "string",
groupPrincipalId: "string",
labels: {
string: "string",
},
name: "string",
userId: "string",
userPrincipalId: "string",
});
type: rancher2:ProjectRoleTemplateBinding
properties:
annotations:
string: string
groupId: string
groupPrincipalId: string
labels:
string: string
name: string
projectId: string
roleTemplateId: string
userId: string
userPrincipalId: string
ProjectRoleTemplateBinding Resource Properties
To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.
Inputs
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The ProjectRoleTemplateBinding resource accepts the following input properties:
- Project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - Role
Template stringId - The role template id from create project role template binding (string)
- Annotations Dictionary<string, string>
- Annotations of the resource (map)
- Group
Id string - The group ID to assign project role template binding (string)
- Group
Principal stringId - The group_principal ID to assign project role template binding (string)
- Labels Dictionary<string, string>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- Name string
- The name of the project role template binding (string)
- User
Id string - The user ID to assign project role template binding (string)
- User
Principal stringId - The user_principal ID to assign project role template binding (string)
- Project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - Role
Template stringId - The role template id from create project role template binding (string)
- Annotations map[string]string
- Annotations of the resource (map)
- Group
Id string - The group ID to assign project role template binding (string)
- Group
Principal stringId - The group_principal ID to assign project role template binding (string)
- Labels map[string]string
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- Name string
- The name of the project role template binding (string)
- User
Id string - The user ID to assign project role template binding (string)
- User
Principal stringId - The user_principal ID to assign project role template binding (string)
- project
Id String - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template StringId - The role template id from create project role template binding (string)
- annotations Map<String,String>
- Annotations of the resource (map)
- group
Id String - The group ID to assign project role template binding (string)
- group
Principal StringId - The group_principal ID to assign project role template binding (string)
- labels Map<String,String>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name String
- The name of the project role template binding (string)
- user
Id String - The user ID to assign project role template binding (string)
- user
Principal StringId - The user_principal ID to assign project role template binding (string)
- project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template stringId - The role template id from create project role template binding (string)
- annotations {[key: string]: string}
- Annotations of the resource (map)
- group
Id string - The group ID to assign project role template binding (string)
- group
Principal stringId - The group_principal ID to assign project role template binding (string)
- labels {[key: string]: string}
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name string
- The name of the project role template binding (string)
- user
Id string - The user ID to assign project role template binding (string)
- user
Principal stringId - The user_principal ID to assign project role template binding (string)
- project_
id str - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role_
template_ strid - The role template id from create project role template binding (string)
- annotations Mapping[str, str]
- Annotations of the resource (map)
- group_
id str - The group ID to assign project role template binding (string)
- group_
principal_ strid - The group_principal ID to assign project role template binding (string)
- labels Mapping[str, str]
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name str
- The name of the project role template binding (string)
- user_
id str - The user ID to assign project role template binding (string)
- user_
principal_ strid - The user_principal ID to assign project role template binding (string)
- project
Id String - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template StringId - The role template id from create project role template binding (string)
- annotations Map<String>
- Annotations of the resource (map)
- group
Id String - The group ID to assign project role template binding (string)
- group
Principal StringId - The group_principal ID to assign project role template binding (string)
- labels Map<String>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name String
- The name of the project role template binding (string)
- user
Id String - The user ID to assign project role template binding (string)
- user
Principal StringId - The user_principal ID to assign project role template binding (string)
Outputs
All input properties are implicitly available as output properties. Additionally, the ProjectRoleTemplateBinding resource produces the following output properties:
- Id string
- The provider-assigned unique ID for this managed resource.
- Id string
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
- id string
- The provider-assigned unique ID for this managed resource.
- id str
- The provider-assigned unique ID for this managed resource.
- id String
- The provider-assigned unique ID for this managed resource.
Look up Existing ProjectRoleTemplateBinding Resource
Get an existing ProjectRoleTemplateBinding 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?: ProjectRoleTemplateBindingState, opts?: CustomResourceOptions): ProjectRoleTemplateBinding
@staticmethod
def get(resource_name: str,
id: str,
opts: Optional[ResourceOptions] = None,
annotations: Optional[Mapping[str, str]] = None,
group_id: Optional[str] = None,
group_principal_id: Optional[str] = None,
labels: Optional[Mapping[str, str]] = None,
name: Optional[str] = None,
project_id: Optional[str] = None,
role_template_id: Optional[str] = None,
user_id: Optional[str] = None,
user_principal_id: Optional[str] = None) -> ProjectRoleTemplateBinding
func GetProjectRoleTemplateBinding(ctx *Context, name string, id IDInput, state *ProjectRoleTemplateBindingState, opts ...ResourceOption) (*ProjectRoleTemplateBinding, error)
public static ProjectRoleTemplateBinding Get(string name, Input<string> id, ProjectRoleTemplateBindingState? state, CustomResourceOptions? opts = null)
public static ProjectRoleTemplateBinding get(String name, Output<String> id, ProjectRoleTemplateBindingState 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.
- Annotations Dictionary<string, string>
- Annotations of the resource (map)
- Group
Id string - The group ID to assign project role template binding (string)
- Group
Principal stringId - The group_principal ID to assign project role template binding (string)
- Labels Dictionary<string, string>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- Name string
- The name of the project role template binding (string)
- Project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - Role
Template stringId - The role template id from create project role template binding (string)
- User
Id string - The user ID to assign project role template binding (string)
- User
Principal stringId - The user_principal ID to assign project role template binding (string)
- Annotations map[string]string
- Annotations of the resource (map)
- Group
Id string - The group ID to assign project role template binding (string)
- Group
Principal stringId - The group_principal ID to assign project role template binding (string)
- Labels map[string]string
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- Name string
- The name of the project role template binding (string)
- Project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - Role
Template stringId - The role template id from create project role template binding (string)
- User
Id string - The user ID to assign project role template binding (string)
- User
Principal stringId - The user_principal ID to assign project role template binding (string)
- annotations Map<String,String>
- Annotations of the resource (map)
- group
Id String - The group ID to assign project role template binding (string)
- group
Principal StringId - The group_principal ID to assign project role template binding (string)
- labels Map<String,String>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name String
- The name of the project role template binding (string)
- project
Id String - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template StringId - The role template id from create project role template binding (string)
- user
Id String - The user ID to assign project role template binding (string)
- user
Principal StringId - The user_principal ID to assign project role template binding (string)
- annotations {[key: string]: string}
- Annotations of the resource (map)
- group
Id string - The group ID to assign project role template binding (string)
- group
Principal stringId - The group_principal ID to assign project role template binding (string)
- labels {[key: string]: string}
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name string
- The name of the project role template binding (string)
- project
Id string - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template stringId - The role template id from create project role template binding (string)
- user
Id string - The user ID to assign project role template binding (string)
- user
Principal stringId - The user_principal ID to assign project role template binding (string)
- annotations Mapping[str, str]
- Annotations of the resource (map)
- group_
id str - The group ID to assign project role template binding (string)
- group_
principal_ strid - The group_principal ID to assign project role template binding (string)
- labels Mapping[str, str]
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name str
- The name of the project role template binding (string)
- project_
id str - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role_
template_ strid - The role template id from create project role template binding (string)
- user_
id str - The user ID to assign project role template binding (string)
- user_
principal_ strid - The user_principal ID to assign project role template binding (string)
- annotations Map<String>
- Annotations of the resource (map)
- group
Id String - The group ID to assign project role template binding (string)
- group
Principal StringId - The group_principal ID to assign project role template binding (string)
- labels Map<String>
Labels of the resource (map)
Note: user
user_id | user_principal_id
OR groupgroup_id | group_principal_id
must be defined- name String
- The name of the project role template binding (string)
- project
Id String - The project id where bind project role template, in format
cluster_id:project_id
, e.g.c-abc12:p-def34
(string) - role
Template StringId - The role template id from create project role template binding (string)
- user
Id String - The user ID to assign project role template binding (string)
- user
Principal StringId - The user_principal ID to assign project role template binding (string)
Import
Project Role Template Bindings can be imported using the Rancher Project Role Template Binding ID
$ pulumi import rancher2:index/projectRoleTemplateBinding:ProjectRoleTemplateBinding foo <project_role_template_binding_id>
To learn more about importing existing cloud resources, see Importing resources.
Package Details
- Repository
- Rancher2 pulumi/pulumi-rancher2
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rancher2
Terraform Provider.