Rancher 2 v8.1.2 published on Thursday, Mar 13, 2025 by Pulumi
rancher2.getRoleTemplate
Explore with Pulumi AI
Use this data source to retrieve information about a Rancher v2 role template resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";
const foo = rancher2.getRoleTemplate({
    name: "foo",
});
import pulumi
import pulumi_rancher2 as rancher2
foo = rancher2.get_role_template(name="foo")
package main
import (
	"github.com/pulumi/pulumi-rancher2/sdk/v8/go/rancher2"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := rancher2.LookupRoleTemplate(ctx, &rancher2.LookupRoleTemplateArgs{
			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.GetRoleTemplate.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.GetRoleTemplateArgs;
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.getRoleTemplate(GetRoleTemplateArgs.builder()
            .name("foo")
            .build());
    }
}
variables:
  foo:
    fn::invoke:
      function: rancher2:getRoleTemplate
      arguments:
        name: foo
Using getRoleTemplate
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 getRoleTemplate(args: GetRoleTemplateArgs, opts?: InvokeOptions): Promise<GetRoleTemplateResult>
function getRoleTemplateOutput(args: GetRoleTemplateOutputArgs, opts?: InvokeOptions): Output<GetRoleTemplateResult>def get_role_template(context: Optional[str] = None,
                      external_rules: Optional[Sequence[GetRoleTemplateExternalRule]] = None,
                      name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetRoleTemplateResult
def get_role_template_output(context: Optional[pulumi.Input[str]] = None,
                      external_rules: Optional[pulumi.Input[Sequence[pulumi.Input[GetRoleTemplateExternalRuleArgs]]]] = None,
                      name: Optional[pulumi.Input[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetRoleTemplateResult]func LookupRoleTemplate(ctx *Context, args *LookupRoleTemplateArgs, opts ...InvokeOption) (*LookupRoleTemplateResult, error)
func LookupRoleTemplateOutput(ctx *Context, args *LookupRoleTemplateOutputArgs, opts ...InvokeOption) LookupRoleTemplateResultOutput> Note: This function is named LookupRoleTemplate in the Go SDK.
public static class GetRoleTemplate 
{
    public static Task<GetRoleTemplateResult> InvokeAsync(GetRoleTemplateArgs args, InvokeOptions? opts = null)
    public static Output<GetRoleTemplateResult> Invoke(GetRoleTemplateInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetRoleTemplateResult> getRoleTemplate(GetRoleTemplateArgs args, InvokeOptions options)
public static Output<GetRoleTemplateResult> getRoleTemplate(GetRoleTemplateArgs args, InvokeOptions options)
fn::invoke:
  function: rancher2:index/getRoleTemplate:getRoleTemplate
  arguments:
    # arguments dictionaryThe following arguments are supported:
- Name string
- The name of the Role Template (string)
- Context string
- Role template context. clusterandprojectvalues are supported (string)
- ExternalRules List<GetRole Template External Rule> 
- (Computed) External rules used for authorization. (list)
- Name string
- The name of the Role Template (string)
- Context string
- Role template context. clusterandprojectvalues are supported (string)
- ExternalRules []GetRole Template External Rule 
- (Computed) External rules used for authorization. (list)
- name String
- The name of the Role Template (string)
- context String
- Role template context. clusterandprojectvalues are supported (string)
- externalRules List<GetRole Template External Rule> 
- (Computed) External rules used for authorization. (list)
- name string
- The name of the Role Template (string)
- context string
- Role template context. clusterandprojectvalues are supported (string)
- externalRules GetRole Template External Rule[] 
- (Computed) External rules used for authorization. (list)
- name str
- The name of the Role Template (string)
- context str
- Role template context. clusterandprojectvalues are supported (string)
- external_rules Sequence[GetRole Template External Rule] 
- (Computed) External rules used for authorization. (list)
- name String
- The name of the Role Template (string)
- context String
- Role template context. clusterandprojectvalues are supported (string)
- externalRules List<Property Map>
- (Computed) External rules used for authorization. (list)
getRoleTemplate Result
The following output properties are available:
- Administrative bool
- (Computed) Administrative role template (bool)
- Annotations Dictionary<string, string>
- (Computed) Annotations for role template object (map)
- Builtin bool
- (Computed) Builtin role template (string)
- Context string
- DefaultRole bool
- (Computed) Default role template for new created cluster or project (bool)
- Description string
- (Computed) Role template description (string)
- External bool
- (Computed) External role template (bool)
- ExternalRules List<GetRole Template External Rule> 
- (Computed) External rules used for authorization. (list)
- bool
- (Computed) Hidden role template (bool)
- Id string
- The provider-assigned unique ID for this managed resource.
- Labels Dictionary<string, string>
- (Computed) Labels for role template object (map)
- Locked bool
- (Computed) Locked role template (bool)
- Name string
- RoleTemplate List<string>Ids 
- (Computed) Inherit role template IDs (list)
- Rules
List<GetRole Template Rule> 
- (Computed) Role template policy rules (list)
- Administrative bool
- (Computed) Administrative role template (bool)
- Annotations map[string]string
- (Computed) Annotations for role template object (map)
- Builtin bool
- (Computed) Builtin role template (string)
- Context string
- DefaultRole bool
- (Computed) Default role template for new created cluster or project (bool)
- Description string
- (Computed) Role template description (string)
- External bool
- (Computed) External role template (bool)
- ExternalRules []GetRole Template External Rule 
- (Computed) External rules used for authorization. (list)
- bool
- (Computed) Hidden role template (bool)
- Id string
- The provider-assigned unique ID for this managed resource.
- Labels map[string]string
- (Computed) Labels for role template object (map)
- Locked bool
- (Computed) Locked role template (bool)
- Name string
- RoleTemplate []stringIds 
- (Computed) Inherit role template IDs (list)
- Rules
[]GetRole Template Rule 
- (Computed) Role template policy rules (list)
- administrative Boolean
- (Computed) Administrative role template (bool)
- annotations Map<String,String>
- (Computed) Annotations for role template object (map)
- builtin Boolean
- (Computed) Builtin role template (string)
- context String
- defaultRole Boolean
- (Computed) Default role template for new created cluster or project (bool)
- description String
- (Computed) Role template description (string)
- external Boolean
- (Computed) External role template (bool)
- externalRules List<GetRole Template External Rule> 
- (Computed) External rules used for authorization. (list)
- Boolean
- (Computed) Hidden role template (bool)
- id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String,String>
- (Computed) Labels for role template object (map)
- locked Boolean
- (Computed) Locked role template (bool)
- name String
- roleTemplate List<String>Ids 
- (Computed) Inherit role template IDs (list)
- rules
List<GetRole Template Rule> 
- (Computed) Role template policy rules (list)
- administrative boolean
- (Computed) Administrative role template (bool)
- annotations {[key: string]: string}
- (Computed) Annotations for role template object (map)
- builtin boolean
- (Computed) Builtin role template (string)
- context string
- defaultRole boolean
- (Computed) Default role template for new created cluster or project (bool)
- description string
- (Computed) Role template description (string)
- external boolean
- (Computed) External role template (bool)
- externalRules GetRole Template External Rule[] 
- (Computed) External rules used for authorization. (list)
- boolean
- (Computed) Hidden role template (bool)
- id string
- The provider-assigned unique ID for this managed resource.
- labels {[key: string]: string}
- (Computed) Labels for role template object (map)
- locked boolean
- (Computed) Locked role template (bool)
- name string
- roleTemplate string[]Ids 
- (Computed) Inherit role template IDs (list)
- rules
GetRole Template Rule[] 
- (Computed) Role template policy rules (list)
- administrative bool
- (Computed) Administrative role template (bool)
- annotations Mapping[str, str]
- (Computed) Annotations for role template object (map)
- builtin bool
- (Computed) Builtin role template (string)
- context str
- default_role bool
- (Computed) Default role template for new created cluster or project (bool)
- description str
- (Computed) Role template description (string)
- external bool
- (Computed) External role template (bool)
- external_rules Sequence[GetRole Template External Rule] 
- (Computed) External rules used for authorization. (list)
- bool
- (Computed) Hidden role template (bool)
- id str
- The provider-assigned unique ID for this managed resource.
- labels Mapping[str, str]
- (Computed) Labels for role template object (map)
- locked bool
- (Computed) Locked role template (bool)
- name str
- role_template_ Sequence[str]ids 
- (Computed) Inherit role template IDs (list)
- rules
Sequence[GetRole Template Rule] 
- (Computed) Role template policy rules (list)
- administrative Boolean
- (Computed) Administrative role template (bool)
- annotations Map<String>
- (Computed) Annotations for role template object (map)
- builtin Boolean
- (Computed) Builtin role template (string)
- context String
- defaultRole Boolean
- (Computed) Default role template for new created cluster or project (bool)
- description String
- (Computed) Role template description (string)
- external Boolean
- (Computed) External role template (bool)
- externalRules List<Property Map>
- (Computed) External rules used for authorization. (list)
- Boolean
- (Computed) Hidden role template (bool)
- id String
- The provider-assigned unique ID for this managed resource.
- labels Map<String>
- (Computed) Labels for role template object (map)
- locked Boolean
- (Computed) Locked role template (bool)
- name String
- roleTemplate List<String>Ids 
- (Computed) Inherit role template IDs (list)
- rules List<Property Map>
- (Computed) Role template policy rules (list)
Supporting Types
GetRoleTemplateExternalRule    
- ApiGroups List<string>
- Policy rule api groups
- NonResource List<string>Urls 
- Policy rule non resource urls
- ResourceNames List<string>
- Policy rule resource names
- Resources List<string>
- Policy rule resources
- Verbs List<string>
- Policy rule verbs
- ApiGroups []string
- Policy rule api groups
- NonResource []stringUrls 
- Policy rule non resource urls
- ResourceNames []string
- Policy rule resource names
- Resources []string
- Policy rule resources
- Verbs []string
- Policy rule verbs
- apiGroups List<String>
- Policy rule api groups
- nonResource List<String>Urls 
- Policy rule non resource urls
- resourceNames List<String>
- Policy rule resource names
- resources List<String>
- Policy rule resources
- verbs List<String>
- Policy rule verbs
- apiGroups string[]
- Policy rule api groups
- nonResource string[]Urls 
- Policy rule non resource urls
- resourceNames 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
- apiGroups List<String>
- Policy rule api groups
- nonResource List<String>Urls 
- Policy rule non resource urls
- resourceNames List<String>
- Policy rule resource names
- resources List<String>
- Policy rule resources
- verbs List<String>
- Policy rule verbs
GetRoleTemplateRule   
- ApiGroups List<string>
- Policy rule api groups
- NonResource List<string>Urls 
- Policy rule non resource urls
- ResourceNames List<string>
- Policy rule resource names
- Resources List<string>
- Policy rule resources
- Verbs List<string>
- Policy rule verbs
- ApiGroups []string
- Policy rule api groups
- NonResource []stringUrls 
- Policy rule non resource urls
- ResourceNames []string
- Policy rule resource names
- Resources []string
- Policy rule resources
- Verbs []string
- Policy rule verbs
- apiGroups List<String>
- Policy rule api groups
- nonResource List<String>Urls 
- Policy rule non resource urls
- resourceNames List<String>
- Policy rule resource names
- resources List<String>
- Policy rule resources
- verbs List<String>
- Policy rule verbs
- apiGroups string[]
- Policy rule api groups
- nonResource string[]Urls 
- Policy rule non resource urls
- resourceNames 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
- apiGroups List<String>
- Policy rule api groups
- nonResource List<String>Urls 
- Policy rule non resource urls
- resourceNames 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.