Viewing docs for Rancher 2 v12.0.0
published on Tuesday, Apr 21, 2026 by Pulumi
published on Tuesday, Apr 21, 2026 by Pulumi
Viewing docs for Rancher 2 v12.0.0
published on Tuesday, Apr 21, 2026 by Pulumi
published on Tuesday, Apr 21, 2026 by Pulumi
Use this data source to retrieve information about a Rancher v2 Principal resource.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as rancher2 from "@pulumi/rancher2";
const foo = rancher2.getPrincipal({
name: "user@example.com",
});
import pulumi
import pulumi_rancher2 as rancher2
foo = rancher2.get_principal(name="user@example.com")
package main
import (
"github.com/pulumi/pulumi-rancher2/sdk/v12/go/rancher2"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := rancher2.GetPrincipal(ctx, &rancher2.GetPrincipalArgs{
Name: "user@example.com",
}, 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.Index.GetPrincipal.Invoke(new()
{
Name = "user@example.com",
});
});
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.GetPrincipalArgs;
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.getPrincipal(GetPrincipalArgs.builder()
.name("user@example.com")
.build());
}
}
variables:
foo:
fn::invoke:
function: rancher2:getPrincipal
arguments:
name: user@example.com
Using getPrincipal
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 getPrincipal(args: GetPrincipalArgs, opts?: InvokeOptions): Promise<GetPrincipalResult>
function getPrincipalOutput(args: GetPrincipalOutputArgs, opts?: InvokeOptions): Output<GetPrincipalResult>def get_principal(exact_match: Optional[bool] = None,
name: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPrincipalResult
def get_principal_output(exact_match: pulumi.Input[Optional[bool]] = None,
name: pulumi.Input[Optional[str]] = None,
type: pulumi.Input[Optional[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetPrincipalResult]func GetPrincipal(ctx *Context, args *GetPrincipalArgs, opts ...InvokeOption) (*GetPrincipalResult, error)
func GetPrincipalOutput(ctx *Context, args *GetPrincipalOutputArgs, opts ...InvokeOption) GetPrincipalResultOutput> Note: This function is named GetPrincipal in the Go SDK.
public static class GetPrincipal
{
public static Task<GetPrincipalResult> InvokeAsync(GetPrincipalArgs args, InvokeOptions? opts = null)
public static Output<GetPrincipalResult> Invoke(GetPrincipalInvokeArgs args, InvokeOptions? opts = null)
}public static CompletableFuture<GetPrincipalResult> getPrincipal(GetPrincipalArgs args, InvokeOptions options)
public static Output<GetPrincipalResult> getPrincipal(GetPrincipalArgs args, InvokeOptions options)
fn::invoke:
function: rancher2:index/getPrincipal:getPrincipal
arguments:
# arguments dictionaryThe following arguments are supported:
- Name string
- The full name of the principal (string)
- Exact
Match bool - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - Type string
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
- Name string
- The full name of the principal (string)
- Exact
Match bool - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - Type string
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
- name String
- The full name of the principal (string)
- exact
Match Boolean - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - type String
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
- name string
- The full name of the principal (string)
- exact
Match boolean - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - type string
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
- name str
- The full name of the principal (string)
- exact_
match bool - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - type str
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
- name String
- The full name of the principal (string)
- exact
Match Boolean - If set to
true, only the exactly matched result is returned. Defaults tofalse, which means a partially matched result can be returned (for example:foo2also matches forfoosearch input) (bool) - type String
- The type of the identity (string). Defaults to
user. Onlyuserandgroupvalues are supported (string)
getPrincipal Result
The following output properties are available:
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Exact
Match bool - Type string
- Id string
- The provider-assigned unique ID for this managed resource.
- Name string
- Exact
Match bool - Type string
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- exact
Match Boolean - type String
- id string
- The provider-assigned unique ID for this managed resource.
- name string
- exact
Match boolean - type string
- id str
- The provider-assigned unique ID for this managed resource.
- name str
- exact_
match bool - type str
- id String
- The provider-assigned unique ID for this managed resource.
- name String
- exact
Match Boolean - type String
Package Details
- Repository
- Rancher2 pulumi/pulumi-rancher2
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rancher2Terraform Provider.
Viewing docs for Rancher 2 v12.0.0
published on Tuesday, Apr 21, 2026 by Pulumi
published on Tuesday, Apr 21, 2026 by Pulumi
