1. Packages
  2. Rancher2 Provider
  3. API Docs
  4. ClusterRoleTemplateBinding
Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi

rancher2.ClusterRoleTemplateBinding

Explore with Pulumi AI

rancher2 logo
Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi

    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>",
    });
    
    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>")
    
    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 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
    	})
    }
    
    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>",
        });
    
    });
    
    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());
    
        }
    }
    
    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>
    

    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 string
    The unique name of the resource.
    args ClusterRoleTemplateBindingArgs
    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 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 string
    The unique name of the resource.
    args ClusterRoleTemplateBindingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args ClusterRoleTemplateBindingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args 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",
    });
    
    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"),
    })
    
    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());
    
    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")
    
    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",
    });
    
    type: rancher2:ClusterRoleTemplateBinding
    properties:
        annotations:
            string: string
        clusterId: string
        groupId: string
        groupPrincipalId: string
        labels:
            string: string
        name: string
        roleTemplateId: string
        userId: string
        userPrincipalId: string
    

    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 string
    The cluster id where bind cluster role template binding (string)
    RoleTemplateId string
    The role template id from create cluster role template binding (string)
    Annotations Dictionary<string, string>
    Annotations for cluster role template binding (map)
    GroupId string
    The group ID to assign cluster role template binding (string)
    GroupPrincipalId 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 string
    The name of the cluster role template binding (string)
    UserId string
    The user ID to assign cluster role template binding (string)
    UserPrincipalId string
    The user_principal ID to assign cluster role template binding (string)
    ClusterId string
    The cluster id where bind cluster role template binding (string)
    RoleTemplateId string
    The role template id from create cluster role template binding (string)
    Annotations map[string]string
    Annotations for cluster role template binding (map)
    GroupId string
    The group ID to assign cluster role template binding (string)
    GroupPrincipalId 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 string
    The name of the cluster role template binding (string)
    UserId string
    The user ID to assign cluster role template binding (string)
    UserPrincipalId string
    The user_principal ID to assign cluster role template binding (string)
    clusterId String
    The cluster id where bind cluster role template binding (string)
    roleTemplateId String
    The role template id from create cluster role template binding (string)
    annotations Map<String,String>
    Annotations for cluster role template binding (map)
    groupId String
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 String
    The name of the cluster role template binding (string)
    userId String
    The user ID to assign cluster role template binding (string)
    userPrincipalId String
    The user_principal ID to assign cluster role template binding (string)
    clusterId string
    The cluster id where bind cluster role template binding (string)
    roleTemplateId string
    The role template id from create cluster role template binding (string)
    annotations {[key: string]: string}
    Annotations for cluster role template binding (map)
    groupId string
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 string
    The name of the cluster role template binding (string)
    userId string
    The user ID to assign cluster role template binding (string)
    userPrincipalId string
    The user_principal ID to assign cluster role template binding (string)
    cluster_id str
    The cluster id where bind cluster role template binding (string)
    role_template_id 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 str
    The group ID to assign cluster role template binding (string)
    group_principal_id 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 str
    The name of the cluster role template binding (string)
    user_id str
    The user ID to assign cluster role template binding (string)
    user_principal_id str
    The user_principal ID to assign cluster role template binding (string)
    clusterId String
    The cluster id where bind cluster role template binding (string)
    roleTemplateId String
    The role template id from create cluster role template binding (string)
    annotations Map<String>
    Annotations for cluster role template binding (map)
    groupId String
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 String
    The name of the cluster role template binding (string)
    userId String
    The user ID to assign cluster role template binding (string)
    userPrincipalId 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)
    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.
    The following state arguments are supported:
    Annotations Dictionary<string, string>
    Annotations for cluster role template binding (map)
    ClusterId string
    The cluster id where bind cluster role template binding (string)
    GroupId string
    The group ID to assign cluster role template binding (string)
    GroupPrincipalId 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 string
    The name of the cluster role template binding (string)
    RoleTemplateId string
    The role template id from create cluster role template binding (string)
    UserId string
    The user ID to assign cluster role template binding (string)
    UserPrincipalId string
    The user_principal ID to assign cluster role template binding (string)
    Annotations map[string]string
    Annotations for cluster role template binding (map)
    ClusterId string
    The cluster id where bind cluster role template binding (string)
    GroupId string
    The group ID to assign cluster role template binding (string)
    GroupPrincipalId 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 string
    The name of the cluster role template binding (string)
    RoleTemplateId string
    The role template id from create cluster role template binding (string)
    UserId string
    The user ID to assign cluster role template binding (string)
    UserPrincipalId string
    The user_principal ID to assign cluster role template binding (string)
    annotations Map<String,String>
    Annotations for cluster role template binding (map)
    clusterId String
    The cluster id where bind cluster role template binding (string)
    groupId String
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 String
    The name of the cluster role template binding (string)
    roleTemplateId String
    The role template id from create cluster role template binding (string)
    userId String
    The user ID to assign cluster role template binding (string)
    userPrincipalId String
    The user_principal ID to assign cluster role template binding (string)
    annotations {[key: string]: string}
    Annotations for cluster role template binding (map)
    clusterId string
    The cluster id where bind cluster role template binding (string)
    groupId string
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 string
    The name of the cluster role template binding (string)
    roleTemplateId string
    The role template id from create cluster role template binding (string)
    userId string
    The user ID to assign cluster role template binding (string)
    userPrincipalId 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 str
    The cluster id where bind cluster role template binding (string)
    group_id str
    The group ID to assign cluster role template binding (string)
    group_principal_id 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 str
    The name of the cluster role template binding (string)
    role_template_id str
    The role template id from create cluster role template binding (string)
    user_id str
    The user ID to assign cluster role template binding (string)
    user_principal_id str
    The user_principal ID to assign cluster role template binding (string)
    annotations Map<String>
    Annotations for cluster role template binding (map)
    clusterId String
    The cluster id where bind cluster role template binding (string)
    groupId String
    The group ID to assign cluster role template binding (string)
    groupPrincipalId 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 String
    The name of the cluster role template binding (string)
    roleTemplateId String
    The role template id from create cluster role template binding (string)
    userId String
    The user ID to assign cluster role template binding (string)
    userPrincipalId 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;
    

    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.
    rancher2 logo
    Rancher 2 v7.1.1 published on Monday, Oct 7, 2024 by Pulumi