Rancher 2 v6.1.1 published on Friday, May 10, 2024 by Pulumi
rancher2.getPrincipal
Explore with Pulumi AI
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/v6/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.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(name: Optional[str] = None,
type: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetPrincipalResult
def get_principal_output(name: Optional[pulumi.Input[str]] = None,
type: Optional[pulumi.Input[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)
// Output-based functions aren't available in Java yet
fn::invoke:
function: rancher2:index/getPrincipal:getPrincipal
arguments:
# arguments dictionary
The following arguments are supported:
getPrincipal Result
The following output properties are available:
Package Details
- Repository
- Rancher2 pulumi/pulumi-rancher2
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
rancher2
Terraform Provider.