1. Packages
  2. Rancher2
  3. API Docs
  4. getPrincipal
Rancher 2 v7.1.0 published on Friday, Sep 27, 2024 by Pulumi

rancher2.getPrincipal

Explore with Pulumi AI

rancher2 logo
Rancher 2 v7.1.0 published on Friday, Sep 27, 2024 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/v7/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:

    Name string
    The full name of the principal (string)
    Type string
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)
    Name string
    The full name of the principal (string)
    Type string
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)
    name String
    The full name of the principal (string)
    type String
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)
    name string
    The full name of the principal (string)
    type string
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)
    name str
    The full name of the principal (string)
    type str
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)
    name String
    The full name of the principal (string)
    type String
    The type of the identity (string). Defaults to user. Only user and group values are supported (string)

    getPrincipal Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Type string
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    Type string
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    type String
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    type string
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    type str
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    type String

    Package Details

    Repository
    Rancher2 pulumi/pulumi-rancher2
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the rancher2 Terraform Provider.
    rancher2 logo
    Rancher 2 v7.1.0 published on Friday, Sep 27, 2024 by Pulumi