1. Packages
  2. Rancher2
  3. API Docs
  4. GlobalRoleBinding
Rancher 2 v7.1.0 published on Friday, Sep 27, 2024 by Pulumi

rancher2.GlobalRoleBinding

Explore with Pulumi AI

rancher2 logo
Rancher 2 v7.1.0 published on Friday, Sep 27, 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", {
        name: "foo",
        globalRoleId: "admin",
        userId: "user-XXXXX",
    });
    // Create a new rancher2 Global Role Binding using group_principal_id
    const foo2 = new rancher2.GlobalRoleBinding("foo2", {
        name: "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",
        name="foo",
        global_role_id="admin",
        user_id="user-XXXXX")
    # Create a new rancher2 Global Role Binding using group_principal_id
    foo2 = rancher2.GlobalRoleBinding("foo2",
        name="foo2",
        global_role_id="admin",
        group_principal_id="local://g-XXXXX")
    
    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 Global Role Binding using user_id
    		_, err := rancher2.NewGlobalRoleBinding(ctx, "foo", &rancher2.GlobalRoleBindingArgs{
    			Name:         pulumi.String("foo"),
    			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{
    			Name:             pulumi.String("foo2"),
    			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()
        {
            Name = "foo",
            GlobalRoleId = "admin",
            UserId = "user-XXXXX",
        });
    
        // Create a new rancher2 Global Role Binding using group_principal_id
        var foo2 = new Rancher2.GlobalRoleBinding("foo2", new()
        {
            Name = "foo2",
            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) {
            // Create a new rancher2 Global Role Binding using user_id
            var foo = new GlobalRoleBinding("foo", GlobalRoleBindingArgs.builder()
                .name("foo")
                .globalRoleId("admin")
                .userId("user-XXXXX")
                .build());
    
            // Create a new rancher2 Global Role Binding using group_principal_id
            var foo2 = new GlobalRoleBinding("foo2", GlobalRoleBindingArgs.builder()
                .name("foo2")
                .globalRoleId("admin")
                .groupPrincipalId("local://g-XXXXX")
                .build());
    
        }
    }
    
    resources:
      # Create a new rancher2 Global Role Binding using user_id
      foo:
        type: rancher2:GlobalRoleBinding
        properties:
          name: foo
          globalRoleId: admin
          userId: user-XXXXX
      # Create a new rancher2 Global Role Binding using group_principal_id
      foo2:
        type: rancher2:GlobalRoleBinding
        properties:
          name: foo2
          globalRoleId: admin
          groupPrincipalId: local://g-XXXXX
    

    Create GlobalRoleBinding Resource

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

    Constructor syntax

    new GlobalRoleBinding(name: string, args: GlobalRoleBindingArgs, opts?: CustomResourceOptions);
    @overload
    def GlobalRoleBinding(resource_name: str,
                          args: GlobalRoleBindingArgs,
                          opts: Optional[ResourceOptions] = None)
    
    @overload
    def GlobalRoleBinding(resource_name: str,
                          opts: Optional[ResourceOptions] = None,
                          global_role_id: Optional[str] = None,
                          annotations: Optional[Mapping[str, str]] = None,
                          group_principal_id: Optional[str] = None,
                          labels: Optional[Mapping[str, str]] = None,
                          name: Optional[str] = None,
                          user_id: Optional[str] = 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.
    
    

    Parameters

    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.

    Constructor example

    The following reference example uses placeholder values for all input properties.

    var globalRoleBindingResource = new Rancher2.GlobalRoleBinding("globalRoleBindingResource", new()
    {
        GlobalRoleId = "string",
        Annotations = 
        {
            { "string", "string" },
        },
        GroupPrincipalId = "string",
        Labels = 
        {
            { "string", "string" },
        },
        Name = "string",
        UserId = "string",
    });
    
    example, err := rancher2.NewGlobalRoleBinding(ctx, "globalRoleBindingResource", &rancher2.GlobalRoleBindingArgs{
    	GlobalRoleId: pulumi.String("string"),
    	Annotations: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	GroupPrincipalId: pulumi.String("string"),
    	Labels: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	Name:   pulumi.String("string"),
    	UserId: pulumi.String("string"),
    })
    
    var globalRoleBindingResource = new GlobalRoleBinding("globalRoleBindingResource", GlobalRoleBindingArgs.builder()
        .globalRoleId("string")
        .annotations(Map.of("string", "string"))
        .groupPrincipalId("string")
        .labels(Map.of("string", "string"))
        .name("string")
        .userId("string")
        .build());
    
    global_role_binding_resource = rancher2.GlobalRoleBinding("globalRoleBindingResource",
        global_role_id="string",
        annotations={
            "string": "string",
        },
        group_principal_id="string",
        labels={
            "string": "string",
        },
        name="string",
        user_id="string")
    
    const globalRoleBindingResource = new rancher2.GlobalRoleBinding("globalRoleBindingResource", {
        globalRoleId: "string",
        annotations: {
            string: "string",
        },
        groupPrincipalId: "string",
        labels: {
            string: "string",
        },
        name: "string",
        userId: "string",
    });
    
    type: rancher2:GlobalRoleBinding
    properties:
        annotations:
            string: string
        globalRoleId: string
        groupPrincipalId: string
        labels:
            string: string
        name: string
        userId: string
    

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

    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]string
    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]string

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

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

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

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

    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, str]] = None,
            global_role_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) -> 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, string>
    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, string>

    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]string
    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]string

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

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

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

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

    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;
    

    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.0 published on Friday, Sep 27, 2024 by Pulumi