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

rancher2.GlobalRoleBinding

Explore with Pulumi AI

rancher2 logo
Rancher 2 v6.1.0 published on Tuesday, Mar 12, 2024 by Pulumi

    Provides a Rancher v2 Global Role Binding resource. This can be used to create Global Role 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 Global Role Binding using user_id
    const foo = new rancher2.GlobalRoleBinding("foo", {
        globalRoleId: "admin",
        userId: "user-XXXXX",
    });
    // Create a new rancher2 Global Role Binding using group_principal_id
    const foo2 = new rancher2.GlobalRoleBinding("foo2", {
        globalRoleId: "admin",
        groupPrincipalId: "local://g-XXXXX",
    });
    
    import pulumi
    import pulumi_rancher2 as rancher2
    
    # Create a new rancher2 Global Role Binding using user_id
    foo = rancher2.GlobalRoleBinding("foo",
        global_role_id="admin",
        user_id="user-XXXXX")
    # Create a new rancher2 Global Role Binding using group_principal_id
    foo2 = rancher2.GlobalRoleBinding("foo2",
        global_role_id="admin",
        group_principal_id="local://g-XXXXX")
    
    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 Global Role Binding using user_id
    		_, err := rancher2.NewGlobalRoleBinding(ctx, "foo", &rancher2.GlobalRoleBindingArgs{
    			GlobalRoleId: pulumi.String("admin"),
    			UserId:       pulumi.String("user-XXXXX"),
    		})
    		if err != nil {
    			return err
    		}
    		// Create a new rancher2 Global Role Binding using group_principal_id
    		_, err = rancher2.NewGlobalRoleBinding(ctx, "foo2", &rancher2.GlobalRoleBindingArgs{
    			GlobalRoleId:     pulumi.String("admin"),
    			GroupPrincipalId: pulumi.String("local://g-XXXXX"),
    		})
    		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 Global Role Binding using user_id
        var foo = new Rancher2.GlobalRoleBinding("foo", new()
        {
            GlobalRoleId = "admin",
            UserId = "user-XXXXX",
        });
    
        // Create a new rancher2 Global Role Binding using group_principal_id
        var foo2 = new Rancher2.GlobalRoleBinding("foo2", new()
        {
            GlobalRoleId = "admin",
            GroupPrincipalId = "local://g-XXXXX",
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.rancher2.GlobalRoleBinding;
    import com.pulumi.rancher2.GlobalRoleBindingArgs;
    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 GlobalRoleBinding("foo", GlobalRoleBindingArgs.builder()        
                .globalRoleId("admin")
                .userId("user-XXXXX")
                .build());
    
            var foo2 = new GlobalRoleBinding("foo2", GlobalRoleBindingArgs.builder()        
                .globalRoleId("admin")
                .groupPrincipalId("local://g-XXXXX")
                .build());
    
        }
    }
    
    resources:
      # Create a new rancher2 Global Role Binding using user_id
      foo:
        type: rancher2:GlobalRoleBinding
        properties:
          globalRoleId: admin
          userId: user-XXXXX
      # Create a new rancher2 Global Role Binding using group_principal_id
      foo2:
        type: rancher2:GlobalRoleBinding
        properties:
          globalRoleId: admin
          groupPrincipalId: local://g-XXXXX
    

    Create GlobalRoleBinding Resource

    new GlobalRoleBinding(name: string, args: GlobalRoleBindingArgs, opts?: CustomResourceOptions);
    @overload
    def GlobalRoleBinding(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          annotations: Optional[Mapping[str, Any]] = None,
                          global_role_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)
    @overload
    def GlobalRoleBinding(resource_name: str,
                          args: GlobalRoleBindingArgs,
                          opts: Optional[ResourceOptions] = None)
    func NewGlobalRoleBinding(ctx *Context, name string, args GlobalRoleBindingArgs, opts ...ResourceOption) (*GlobalRoleBinding, error)
    public GlobalRoleBinding(string name, GlobalRoleBindingArgs args, CustomResourceOptions? opts = null)
    public GlobalRoleBinding(String name, GlobalRoleBindingArgs args)
    public GlobalRoleBinding(String name, GlobalRoleBindingArgs args, CustomResourceOptions options)
    
    type: rancher2:GlobalRoleBinding
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    
    name string
    The unique name of the resource.
    args GlobalRoleBindingArgs
    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 GlobalRoleBindingArgs
    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 GlobalRoleBindingArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args GlobalRoleBindingArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args GlobalRoleBindingArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

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

    GlobalRoleId string
    The role id from create global role binding (string)
    Annotations Dictionary<string, object>
    Annotations for global role binding (map)
    GroupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    Labels Dictionary<string, object>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    Name string
    The name of the global role binding (string)
    UserId string
    The user ID to assign global role binding (string)
    GlobalRoleId string
    The role id from create global role binding (string)
    Annotations map[string]interface{}
    Annotations for global role binding (map)
    GroupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    Labels map[string]interface{}

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    Name string
    The name of the global role binding (string)
    UserId string
    The user ID to assign global role binding (string)
    globalRoleId String
    The role id from create global role binding (string)
    annotations Map<String,Object>
    Annotations for global role binding (map)
    groupPrincipalId String
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Map<String,Object>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name String
    The name of the global role binding (string)
    userId String
    The user ID to assign global role binding (string)
    globalRoleId string
    The role id from create global role binding (string)
    annotations {[key: string]: any}
    Annotations for global role binding (map)
    groupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels {[key: string]: any}

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name string
    The name of the global role binding (string)
    userId string
    The user ID to assign global role binding (string)
    global_role_id str
    The role id from create global role binding (string)
    annotations Mapping[str, Any]
    Annotations for global role binding (map)
    group_principal_id str
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Mapping[str, Any]

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name str
    The name of the global role binding (string)
    user_id str
    The user ID to assign global role binding (string)
    globalRoleId String
    The role id from create global role binding (string)
    annotations Map<Any>
    Annotations for global role binding (map)
    groupPrincipalId String
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Map<Any>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name String
    The name of the global role binding (string)
    userId String
    The user ID to assign global role binding (string)

    Outputs

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

    Get an existing GlobalRoleBinding 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?: GlobalRoleBindingState, opts?: CustomResourceOptions): GlobalRoleBinding
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            annotations: Optional[Mapping[str, Any]] = None,
            global_role_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) -> GlobalRoleBinding
    func GetGlobalRoleBinding(ctx *Context, name string, id IDInput, state *GlobalRoleBindingState, opts ...ResourceOption) (*GlobalRoleBinding, error)
    public static GlobalRoleBinding Get(string name, Input<string> id, GlobalRoleBindingState? state, CustomResourceOptions? opts = null)
    public static GlobalRoleBinding get(String name, Output<String> id, GlobalRoleBindingState 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 global role binding (map)
    GlobalRoleId string
    The role id from create global role binding (string)
    GroupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    Labels Dictionary<string, object>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    Name string
    The name of the global role binding (string)
    UserId string
    The user ID to assign global role binding (string)
    Annotations map[string]interface{}
    Annotations for global role binding (map)
    GlobalRoleId string
    The role id from create global role binding (string)
    GroupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    Labels map[string]interface{}

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    Name string
    The name of the global role binding (string)
    UserId string
    The user ID to assign global role binding (string)
    annotations Map<String,Object>
    Annotations for global role binding (map)
    globalRoleId String
    The role id from create global role binding (string)
    groupPrincipalId String
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Map<String,Object>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name String
    The name of the global role binding (string)
    userId String
    The user ID to assign global role binding (string)
    annotations {[key: string]: any}
    Annotations for global role binding (map)
    globalRoleId string
    The role id from create global role binding (string)
    groupPrincipalId string
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels {[key: string]: any}

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name string
    The name of the global role binding (string)
    userId string
    The user ID to assign global role binding (string)
    annotations Mapping[str, Any]
    Annotations for global role binding (map)
    global_role_id str
    The role id from create global role binding (string)
    group_principal_id str
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Mapping[str, Any]

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name str
    The name of the global role binding (string)
    user_id str
    The user ID to assign global role binding (string)
    annotations Map<Any>
    Annotations for global role binding (map)
    globalRoleId String
    The role id from create global role binding (string)
    groupPrincipalId String
    The group principal ID to assign global role binding (only works with external auth providers that support groups). Rancher v2.4.0 or higher is required (string)
    labels Map<Any>

    Labels for global role binding (map)

    Note: user user_id OR group group_principal_id must be defined

    name String
    The name of the global role binding (string)
    userId String
    The user ID to assign global role binding (string)

    Import

    Global Role Bindings can be imported using the Rancher Global Role Binding ID

    $ pulumi import rancher2:index/globalRoleBinding:GlobalRoleBinding foo &lt;GLOBAL_ROLE_BINDING_ID&gt;
    

    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