1. Packages
  2. Rancher2
  3. API Docs
  4. ClusterRoleTemplateBinding
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

rancher2.ClusterRoleTemplateBinding

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 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", {
        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",
        cluster_id="<cluster_id>",
        role_template_id="<role_template_id>",
        user_id="<user_id>")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-rancher2/sdk/v6/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{
    			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()
        {
            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) {
            var foo = new ClusterRoleTemplateBinding("foo", ClusterRoleTemplateBindingArgs.builder()        
                .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:
          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, Any]] = None,
                                   group_id: Optional[str] = None,
                                   group_principal_id: Optional[str] = None,
                                   labels: Optional[Mapping[str, Any]] = 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.

    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", "any" },
        },
        GroupId = "string",
        GroupPrincipalId = "string",
        Labels = 
        {
            { "string", "any" },
        },
        Name = "string",
        UserId = "string",
        UserPrincipalId = "string",
    });
    
    example, err := rancher2.NewClusterRoleTemplateBinding(ctx, "clusterRoleTemplateBindingResource", &rancher2.ClusterRoleTemplateBindingArgs{
    	ClusterId:      pulumi.String("string"),
    	RoleTemplateId: pulumi.String("string"),
    	Annotations: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	GroupId:          pulumi.String("string"),
    	GroupPrincipalId: pulumi.String("string"),
    	Labels: pulumi.Map{
    		"string": pulumi.Any("any"),
    	},
    	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", "any"))
        .groupId("string")
        .groupPrincipalId("string")
        .labels(Map.of("string", "any"))
        .name("string")
        .userId("string")
        .userPrincipalId("string")
        .build());
    
    cluster_role_template_binding_resource = rancher2.ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource",
        cluster_id="string",
        role_template_id="string",
        annotations={
            "string": "any",
        },
        group_id="string",
        group_principal_id="string",
        labels={
            "string": "any",
        },
        name="string",
        user_id="string",
        user_principal_id="string")
    
    const clusterRoleTemplateBindingResource = new rancher2.ClusterRoleTemplateBinding("clusterRoleTemplateBindingResource", {
        clusterId: "string",
        roleTemplateId: "string",
        annotations: {
            string: "any",
        },
        groupId: "string",
        groupPrincipalId: "string",
        labels: {
            string: "any",
        },
        name: "string",
        userId: "string",
        userPrincipalId: "string",
    });
    
    type: rancher2:ClusterRoleTemplateBinding
    properties:
        annotations:
            string: any
        clusterId: string
        groupId: string
        groupPrincipalId: string
        labels:
            string: any
        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

    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, object>
    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, object>

    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]interface{}
    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]interface{}

    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,Object>
    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,Object>

    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]: any}
    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]: any}

    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, Any]
    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, Any]

    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<Any>
    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<Any>

    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, Any]] = None,
            cluster_id: Optional[str] = None,
            group_id: Optional[str] = None,
            group_principal_id: Optional[str] = None,
            labels: Optional[Mapping[str, Any]] = 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, object>
    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, object>

    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]interface{}
    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]interface{}

    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,Object>
    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,Object>

    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]: any}
    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]: any}

    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, Any]
    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, Any]

    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<Any>
    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<Any>

    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 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi