Rancher 2 v9.0.0 published on Wednesday, Apr 16, 2025 by Pulumi
rancher2.getGlobalRole
Explore with Pulumi AI
Use this data source to retrieve information about a Rancher v2 global role resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";
const foo = rancher2.getGlobalRole({
    name: "foo",
});
import pulumi
import pulumi_rancher2 as rancher2
foo = rancher2.get_global_role(name="foo")
package main
import (
	"github.com/pulumi/pulumi-rancher2/sdk/v9/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rancher2.LookupGlobalRole(ctx, &rancher2.LookupGlobalRoleArgs{
			Name: "foo",
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Rancher2 = Pulumi.Rancher2;
return await Deployment.RunAsync(() => 
{
    var foo = Rancher2.GetGlobalRole.Invoke(new()
    {
        Name = "foo",
    });
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.rancher2.Rancher2Functions;
import com.pulumi.rancher2.inputs.GetGlobalRoleArgs;
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) {
        final var foo = Rancher2Functions.getGlobalRole(GetGlobalRoleArgs.builder()
            .name("foo")
            .build());
    }
}
variables:
  foo:
    fn::invoke:
      function: rancher2:getGlobalRole
      arguments:
        name: foo
Using getGlobalRole
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getGlobalRole(args: GetGlobalRoleArgs, opts?: InvokeOptions): Promise<GetGlobalRoleResult>
function getGlobalRoleOutput(args: GetGlobalRoleOutputArgs, opts?: InvokeOptions): Output<GetGlobalRoleResult>def get_global_role(inherited_cluster_roles: Optional[Sequence[str]] = None,
                    name: Optional[str] = None,
                    opts: Optional[InvokeOptions] = None) -> GetGlobalRoleResult
def get_global_role_output(inherited_cluster_roles: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                    name: Optional[pulumi.Input[str]] = None,
                    opts: Optional[InvokeOptions] = None) -> Output[GetGlobalRoleResult]func LookupGlobalRole(ctx *Context, args *LookupGlobalRoleArgs, opts ...InvokeOption) (*LookupGlobalRoleResult, error)
func LookupGlobalRoleOutput(ctx *Context, args *LookupGlobalRoleOutputArgs, opts ...InvokeOption) LookupGlobalRoleResultOutput> Note: This function is named LookupGlobalRole in the Go SDK.
public static class GetGlobalRole 
{
    public static Task<GetGlobalRoleResult> InvokeAsync(GetGlobalRoleArgs args, InvokeOptions? opts = null)
    public static Output<GetGlobalRoleResult> Invoke(GetGlobalRoleInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetGlobalRoleResult> getGlobalRole(GetGlobalRoleArgs args, InvokeOptions options)
public static Output<GetGlobalRoleResult> getGlobalRole(GetGlobalRoleArgs args, InvokeOptions options)
fn::invoke:
  function: rancher2:index/getGlobalRole:getGlobalRole
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
 - The name of the Global Role (string)
 - Inherited
Cluster List<string>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- Name string
 - The name of the Global Role (string)
 - Inherited
Cluster []stringRoles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- name String
 - The name of the Global Role (string)
 - inherited
Cluster List<String>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- name string
 - The name of the Global Role (string)
 - inherited
Cluster string[]Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- name str
 - The name of the Global Role (string)
 - inherited_
cluster_ Sequence[str]roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- name String
 - The name of the Global Role (string)
 - inherited
Cluster List<String>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
getGlobalRole Result
The following output properties are available:
- Annotations Dictionary<string, string>
 - (Computed) Annotations for global role object (map)
 - Builtin bool
 - (Computed) Builtin global role (bool)
 - Description string
 - (Computed) Global role description (string)
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Labels Dictionary<string, string>
 - (Computed) Labels for global role object (map)
 - Name string
 - New
User boolDefault  - (Computed) Whether or not this role should be added to new users (bool)
 - Rules
List<Get
Global Role Rule>  - (Computed) Global role policy rules (list)
 - Inherited
Cluster List<string>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- Annotations map[string]string
 - (Computed) Annotations for global role object (map)
 - Builtin bool
 - (Computed) Builtin global role (bool)
 - Description string
 - (Computed) Global role description (string)
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - Labels map[string]string
 - (Computed) Labels for global role object (map)
 - Name string
 - New
User boolDefault  - (Computed) Whether or not this role should be added to new users (bool)
 - Rules
[]Get
Global Role Rule  - (Computed) Global role policy rules (list)
 - Inherited
Cluster []stringRoles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- annotations Map<String,String>
 - (Computed) Annotations for global role object (map)
 - builtin Boolean
 - (Computed) Builtin global role (bool)
 - description String
 - (Computed) Global role description (string)
 - id String
 - The provider-assigned unique ID for this managed resource.
 - labels Map<String,String>
 - (Computed) Labels for global role object (map)
 - name String
 - new
User BooleanDefault  - (Computed) Whether or not this role should be added to new users (bool)
 - rules
List<Get
Global Role Rule>  - (Computed) Global role policy rules (list)
 - inherited
Cluster List<String>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- annotations {[key: string]: string}
 - (Computed) Annotations for global role object (map)
 - builtin boolean
 - (Computed) Builtin global role (bool)
 - description string
 - (Computed) Global role description (string)
 - id string
 - The provider-assigned unique ID for this managed resource.
 - labels {[key: string]: string}
 - (Computed) Labels for global role object (map)
 - name string
 - new
User booleanDefault  - (Computed) Whether or not this role should be added to new users (bool)
 - rules
Get
Global Role Rule[]  - (Computed) Global role policy rules (list)
 - inherited
Cluster string[]Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- annotations Mapping[str, str]
 - (Computed) Annotations for global role object (map)
 - builtin bool
 - (Computed) Builtin global role (bool)
 - description str
 - (Computed) Global role description (string)
 - id str
 - The provider-assigned unique ID for this managed resource.
 - labels Mapping[str, str]
 - (Computed) Labels for global role object (map)
 - name str
 - new_
user_ booldefault  - (Computed) Whether or not this role should be added to new users (bool)
 - rules
Sequence[Get
Global Role Rule]  - (Computed) Global role policy rules (list)
 - inherited_
cluster_ Sequence[str]roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
- annotations Map<String>
 - (Computed) Annotations for global role object (map)
 - builtin Boolean
 - (Computed) Builtin global role (bool)
 - description String
 - (Computed) Global role description (string)
 - id String
 - The provider-assigned unique ID for this managed resource.
 - labels Map<String>
 - (Computed) Labels for global role object (map)
 - name String
 - new
User BooleanDefault  - (Computed) Whether or not this role should be added to new users (bool)
 - rules List<Property Map>
 - (Computed) Global role policy rules (list)
 - inherited
Cluster List<String>Roles  - (Optional) Names of role templates whose permissions are granted by this global role in every cluster besides the local cluster (list)
 
Supporting Types
GetGlobalRoleRule   
- Api
Groups List<string> - Policy rule api groups
 - Non
Resource List<string>Urls  - Policy rule non resource urls
 - Resource
Names List<string> - Policy rule resource names
 - Resources List<string>
 - Policy rule resources
 - Verbs List<string>
 - Policy rule verbs
 
- Api
Groups []string - Policy rule api groups
 - Non
Resource []stringUrls  - Policy rule non resource urls
 - Resource
Names []string - Policy rule resource names
 - Resources []string
 - Policy rule resources
 - Verbs []string
 - Policy rule verbs
 
- api
Groups List<String> - Policy rule api groups
 - non
Resource List<String>Urls  - Policy rule non resource urls
 - resource
Names List<String> - Policy rule resource names
 - resources List<String>
 - Policy rule resources
 - verbs List<String>
 - Policy rule verbs
 
- api
Groups string[] - Policy rule api groups
 - non
Resource string[]Urls  - Policy rule non resource urls
 - resource
Names string[] - Policy rule resource names
 - resources string[]
 - Policy rule resources
 - verbs string[]
 - Policy rule verbs
 
- api_
groups Sequence[str] - Policy rule api groups
 - non_
resource_ Sequence[str]urls  - Policy rule non resource urls
 - resource_
names Sequence[str] - Policy rule resource names
 - resources Sequence[str]
 - Policy rule resources
 - verbs Sequence[str]
 - Policy rule verbs
 
- api
Groups List<String> - Policy rule api groups
 - non
Resource List<String>Urls  - Policy rule non resource urls
 - resource
Names List<String> - Policy rule resource names
 - resources List<String>
 - Policy rule resources
 - verbs List<String>
 - Policy rule verbs
 
Package Details
- Repository
 - Rancher2 pulumi/pulumi-rancher2
 - License
 - Apache-2.0
 - Notes
 - This Pulumi package is based on the 
rancher2Terraform Provider.