Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

GlobalRoleBinding

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

using Pulumi;
using Rancher2 = Pulumi.Rancher2;

class MyStack : Stack
{
    public MyStack()
    {
        // Create a new rancher2 Global Role Binding using user_id
        var foo = new Rancher2.GlobalRoleBinding("foo", new Rancher2.GlobalRoleBindingArgs
        {
            GlobalRoleId = "admin",
            UserId = "user-XXXXX",
        });
        // Create a new rancher2 Global Role Binding using group_principal_id
        var foo2 = new Rancher2.GlobalRoleBinding("foo2", new Rancher2.GlobalRoleBindingArgs
        {
            GlobalRoleId = "admin",
            GroupPrincipalId = "local://g-XXXXX",
        });
    }

}
package main

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

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        _, err := rancher2.NewGlobalRoleBinding(ctx, "foo", &rancher2.GlobalRoleBindingArgs{
            GlobalRoleId: pulumi.String("admin"),
            UserId:       pulumi.String("user-XXXXX"),
        })
        if err != nil {
            return err
        }
        _, err = rancher2.NewGlobalRoleBinding(ctx, "foo2", &rancher2.GlobalRoleBindingArgs{
            GlobalRoleId:     pulumi.String("admin"),
            GroupPrincipalId: pulumi.String("local://g-XXXXX"),
        })
        if err != nil {
            return err
        }
        return nil
    })
}
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")
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",
});

Create a GlobalRoleBinding Resource

new GlobalRoleBinding(name: string, args: GlobalRoleBindingArgs, opts?: CustomResourceOptions);
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)
func NewGlobalRoleBinding(ctx *Context, name string, args GlobalRoleBindingArgs, opts ...ResourceOption) (*GlobalRoleBinding, error)
public GlobalRoleBinding(string name, GlobalRoleBindingArgs args, CustomResourceOptions? opts = null)
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.
opts ResourceOptions
A bag of options that control this 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.

GlobalRoleBinding Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Programming Model 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)

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)

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)

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)

name str

The name of the global role binding (string)

user_id str

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 str
The provider-assigned unique ID for this managed resource.

Look up an 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)
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.

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)

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)

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)

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)

name str

The name of the global role binding (string)

user_id str

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
https://github.com/pulumi/pulumi-rancher2
License
Apache-2.0
Notes
This Pulumi package is based on the rancher2 Terraform Provider.