1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. ClusterRoleTemplateBinding
Rancher 2 v9.0.0 published on Wednesday, Apr 16, 2025 by Pulumi

rancher2.ClusterRoleTemplateBinding

Explore with Pulumi AI

Provides a Rancher v2 Cluster Role Template Binding resource. This can be used to create Cluster 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 Cluster Role Template Binding
const foo = new rancher2.ClusterRoleTemplateBinding("foo", {
    name: "foo",
    clusterId: "<cluster_id>",
    roleTemplateId: "<role_template_id>",
    userId: "<user_id>",
});
Copy
import pulumi
import pulumi_rancher2 as rancher2

# Create a new Rancher2 Cluster Role Template Binding
foo = rancher2.ClusterRoleTemplateBinding("foo",
    name="foo",
    cluster_id="<cluster_id>",
    role_template_id="<role_template_id>",
    user_id="<user_id>")
Copy
package main

import (
	"github.com/pulumi/pulumi-rancher2/sdk/v9/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		// Create a new Rancher2 Cluster Role Template Binding
		_, err := rancher2.NewClusterRoleTemplateBinding(ctx, "foo", &rancher2.ClusterRoleTemplateBindingArgs{
			Name:           pulumi.String("foo"),
			ClusterId:      pulumi.String("<cluster_id>"),
			RoleTemplateId: pulumi.String("<role_template_id>"),
			UserId:         pulumi.String("<user_id>"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rancher2 = Pulumi.Rancher2;

return await Deployment.RunAsync(() => 
{
    // Create a new Rancher2 Cluster Role Template Binding
    var foo = new Rancher2.ClusterRoleTemplateBinding("foo", new()
    {
        Name = "foo",
        ClusterId = "<cluster_id>",
        RoleTemplateId = "<role_template_id>",
        UserId = "<user_id>",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rancher2.ClusterRoleTemplateBinding;
import com.pulumi.rancher2.ClusterRoleTemplateBindingArgs;
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 Cluster Role Template Binding
        var foo = new ClusterRoleTemplateBinding("foo", ClusterRoleTemplateBindingArgs.builder()
            .name("foo")
            .clusterId("<cluster_id>")
            .roleTemplateId("<role_template_id>")
            .userId("<user_id>")
            .build());

    }
}
Copy
resources:
  # Create a new Rancher2 Cluster Role Template Binding
  foo:
    type: rancher2:ClusterRoleTemplateBinding
    properties:
      name: foo
      clusterId: <cluster_id>
      roleTemplateId: <role_template_id>
      userId: <user_id>
Copy

Create ClusterRoleTemplateBinding Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new ClusterRoleTemplateBinding(name: string, args: ClusterRoleTemplateBindingArgs, opts?: CustomResourceOptions);
@overload
def ClusterRoleTemplateBinding(resource_name: str,
                               args: ClusterRoleTemplateBindingArgs,
                               opts: Optional[ResourceOptions] = None)

@overload
def ClusterRoleTemplateBinding(resource_name: str,
                               opts: Optional[ResourceOptions] = None,
                               cluster_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 NewClusterRoleTemplateBinding(ctx *Context, name string, args ClusterRoleTemplateBindingArgs, opts ...ResourceOption) (*ClusterRoleTemplateBinding, error)
public ClusterRoleTemplateBinding(string name, ClusterRoleTemplateBindingArgs args, CustomResourceOptions? opts = null)
public ClusterRoleTemplateBinding(String name, ClusterRoleTemplateBindingArgs args)
public ClusterRoleTemplateBinding(String name, ClusterRoleTemplateBindingArgs args, CustomResourceOptions options)
type: rancher2:ClusterRoleTemplateBinding
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. ClusterRoleTemplateBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. ClusterRoleTemplateBindingArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. ClusterRoleTemplateBindingArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. ClusterRoleTemplateBindingArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. ClusterRoleTemplateBindingArgs
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 clusterRoleTemplateBindingResource = new Rancher2.ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource", new()
{
    ClusterId = "string",
    RoleTemplateId = "string",
    Annotations = 
    {
        { "string", "string" },
    },
    GroupId = "string",
    GroupPrincipalId = "string",
    Labels = 
    {
        { "string", "string" },
    },
    Name = "string",
    UserId = "string",
    UserPrincipalId = "string",
});
Copy
example, err := rancher2.NewClusterRoleTemplateBinding(ctx, "clusterRoleTemplateBindingResource", &rancher2.ClusterRoleTemplateBindingArgs{
	ClusterId:      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"),
})
Copy
var clusterRoleTemplateBindingResource = new ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource", ClusterRoleTemplateBindingArgs.builder()
    .clusterId("string")
    .roleTemplateId("string")
    .annotations(Map.of("string", "string"))
    .groupId("string")
    .groupPrincipalId("string")
    .labels(Map.of("string", "string"))
    .name("string")
    .userId("string")
    .userPrincipalId("string")
    .build());
Copy
cluster_role_template_binding_resource = rancher2.ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource",
    cluster_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")
Copy
const clusterRoleTemplateBindingResource = new rancher2.ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource", {
    clusterId: "string",
    roleTemplateId: "string",
    annotations: {
        string: "string",
    },
    groupId: "string",
    groupPrincipalId: "string",
    labels: {
        string: "string",
    },
    name: "string",
    userId: "string",
    userPrincipalId: "string",
});
Copy
type: rancher2:ClusterRoleTemplateBinding
properties:
    annotations:
        string: string
    clusterId: string
    groupId: string
    groupPrincipalId: string
    labels:
        string: string
    name: string
    roleTemplateId: string
    userId: string
    userPrincipalId: string
Copy

ClusterRoleTemplateBinding 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 ClusterRoleTemplateBinding resource accepts the following input properties:

ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id where bind cluster role template binding (string)
RoleTemplateId
This property is required.
Changes to this property will trigger replacement.
string
The role template id from create cluster role template binding (string)
Annotations Dictionary<string, string>
Annotations for cluster role template binding (map)
GroupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
GroupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
Labels Dictionary<string, string>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

Name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
UserId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
UserPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
ClusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id where bind cluster role template binding (string)
RoleTemplateId
This property is required.
Changes to this property will trigger replacement.
string
The role template id from create cluster role template binding (string)
Annotations map[string]string
Annotations for cluster role template binding (map)
GroupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
GroupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
Labels map[string]string

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

Name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
UserId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
UserPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The cluster id where bind cluster role template binding (string)
roleTemplateId
This property is required.
Changes to this property will trigger replacement.
String
The role template id from create cluster role template binding (string)
annotations Map<String,String>
Annotations for cluster role template binding (map)
groupId Changes to this property will trigger replacement. String
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. String
The group_principal ID to assign cluster role template binding (string)
labels Map<String,String>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. String
The name of the cluster role template binding (string)
userId Changes to this property will trigger replacement. String
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. String
The user_principal ID to assign cluster role template binding (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
string
The cluster id where bind cluster role template binding (string)
roleTemplateId
This property is required.
Changes to this property will trigger replacement.
string
The role template id from create cluster role template binding (string)
annotations {[key: string]: string}
Annotations for cluster role template binding (map)
groupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
labels {[key: string]: string}

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
userId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
cluster_id
This property is required.
Changes to this property will trigger replacement.
str
The cluster id where bind cluster role template binding (string)
role_template_id
This property is required.
Changes to this property will trigger replacement.
str
The role template id from create cluster role template binding (string)
annotations Mapping[str, str]
Annotations for cluster role template binding (map)
group_id Changes to this property will trigger replacement. str
The group ID to assign cluster role template binding (string)
group_principal_id Changes to this property will trigger replacement. str
The group_principal ID to assign cluster role template binding (string)
labels Mapping[str, str]

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. str
The name of the cluster role template binding (string)
user_id Changes to this property will trigger replacement. str
The user ID to assign cluster role template binding (string)
user_principal_id Changes to this property will trigger replacement. str
The user_principal ID to assign cluster role template binding (string)
clusterId
This property is required.
Changes to this property will trigger replacement.
String
The cluster id where bind cluster role template binding (string)
roleTemplateId
This property is required.
Changes to this property will trigger replacement.
String
The role template id from create cluster role template binding (string)
annotations Map<String>
Annotations for cluster role template binding (map)
groupId Changes to this property will trigger replacement. String
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. String
The group_principal ID to assign cluster role template binding (string)
labels Map<String>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. String
The name of the cluster role template binding (string)
userId Changes to this property will trigger replacement. String
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. String
The user_principal ID to assign cluster role template binding (string)

Outputs

All input properties are implicitly available as output properties. Additionally, the ClusterRoleTemplateBinding 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 ClusterRoleTemplateBinding Resource

Get an existing ClusterRoleTemplateBinding 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?: ClusterRoleTemplateBindingState, opts?: CustomResourceOptions): ClusterRoleTemplateBinding
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        annotations: Optional[Mapping[str, str]] = None,
        cluster_id: Optional[str] = None,
        group_id: Optional[str] = None,
        group_principal_id: Optional[str] = None,
        labels: Optional[Mapping[str, str]] = None,
        name: Optional[str] = None,
        role_template_id: Optional[str] = None,
        user_id: Optional[str] = None,
        user_principal_id: Optional[str] = None) -> ClusterRoleTemplateBinding
func GetClusterRoleTemplateBinding(ctx *Context, name string, id IDInput, state *ClusterRoleTemplateBindingState, opts ...ResourceOption) (*ClusterRoleTemplateBinding, error)
public static ClusterRoleTemplateBinding Get(string name, Input<string> id, ClusterRoleTemplateBindingState? state, CustomResourceOptions? opts = null)
public static ClusterRoleTemplateBinding get(String name, Output<String> id, ClusterRoleTemplateBindingState state, CustomResourceOptions options)
resources:  _:    type: rancher2:ClusterRoleTemplateBinding    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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 This property is required.
The unique name of the resulting resource.
id This property is required.
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.
The following state arguments are supported:
Annotations Dictionary<string, string>
Annotations for cluster role template binding (map)
ClusterId Changes to this property will trigger replacement. string
The cluster id where bind cluster role template binding (string)
GroupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
GroupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
Labels Dictionary<string, string>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

Name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
RoleTemplateId Changes to this property will trigger replacement. string
The role template id from create cluster role template binding (string)
UserId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
UserPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
Annotations map[string]string
Annotations for cluster role template binding (map)
ClusterId Changes to this property will trigger replacement. string
The cluster id where bind cluster role template binding (string)
GroupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
GroupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
Labels map[string]string

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

Name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
RoleTemplateId Changes to this property will trigger replacement. string
The role template id from create cluster role template binding (string)
UserId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
UserPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
annotations Map<String,String>
Annotations for cluster role template binding (map)
clusterId Changes to this property will trigger replacement. String
The cluster id where bind cluster role template binding (string)
groupId Changes to this property will trigger replacement. String
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. String
The group_principal ID to assign cluster role template binding (string)
labels Map<String,String>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. String
The name of the cluster role template binding (string)
roleTemplateId Changes to this property will trigger replacement. String
The role template id from create cluster role template binding (string)
userId Changes to this property will trigger replacement. String
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. String
The user_principal ID to assign cluster role template binding (string)
annotations {[key: string]: string}
Annotations for cluster role template binding (map)
clusterId Changes to this property will trigger replacement. string
The cluster id where bind cluster role template binding (string)
groupId Changes to this property will trigger replacement. string
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. string
The group_principal ID to assign cluster role template binding (string)
labels {[key: string]: string}

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. string
The name of the cluster role template binding (string)
roleTemplateId Changes to this property will trigger replacement. string
The role template id from create cluster role template binding (string)
userId Changes to this property will trigger replacement. string
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. string
The user_principal ID to assign cluster role template binding (string)
annotations Mapping[str, str]
Annotations for cluster role template binding (map)
cluster_id Changes to this property will trigger replacement. str
The cluster id where bind cluster role template binding (string)
group_id Changes to this property will trigger replacement. str
The group ID to assign cluster role template binding (string)
group_principal_id Changes to this property will trigger replacement. str
The group_principal ID to assign cluster role template binding (string)
labels Mapping[str, str]

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. str
The name of the cluster role template binding (string)
role_template_id Changes to this property will trigger replacement. str
The role template id from create cluster role template binding (string)
user_id Changes to this property will trigger replacement. str
The user ID to assign cluster role template binding (string)
user_principal_id Changes to this property will trigger replacement. str
The user_principal ID to assign cluster role template binding (string)
annotations Map<String>
Annotations for cluster role template binding (map)
clusterId Changes to this property will trigger replacement. String
The cluster id where bind cluster role template binding (string)
groupId Changes to this property will trigger replacement. String
The group ID to assign cluster role template binding (string)
groupPrincipalId Changes to this property will trigger replacement. String
The group_principal ID to assign cluster role template binding (string)
labels Map<String>

Labels for cluster role template binding (map)

Note: user user_id | user_principal_id OR group group_id | group_principal_id must be defined

name Changes to this property will trigger replacement. String
The name of the cluster role template binding (string)
roleTemplateId Changes to this property will trigger replacement. String
The role template id from create cluster role template binding (string)
userId Changes to this property will trigger replacement. String
The user ID to assign cluster role template binding (string)
userPrincipalId Changes to this property will trigger replacement. String
The user_principal ID to assign cluster role template binding (string)

Import

Cluster Role Template Bindings can be imported using the Rancher cluster Role Template Binding ID

$ pulumi import rancher2:index/clusterRoleTemplateBinding:ClusterRoleTemplateBinding foo &lt;CLUSTER_ROLE_TEMPLATE_BINDING_ID&gt;
Copy

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.