1. Packages
  2. Spectrocloud Provider
  3. API Docs
  4. getUser
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

spectrocloud.getUser

Explore with Pulumi AI

spectrocloud logo
spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as spectrocloud from "@pulumi/spectrocloud";
    
    const example = spectrocloud.getUser({
        id: "user-12345",
    });
    export const userInfo = {
        id: example.then(example => example.id),
        email: example.then(example => example.email),
    };
    
    import pulumi
    import pulumi_spectrocloud as spectrocloud
    
    example = spectrocloud.get_user(id="user-12345")
    pulumi.export("userInfo", {
        "id": example.id,
        "email": example.email,
    })
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/spectrocloud/spectrocloud"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := spectrocloud.LookupUser(ctx, &spectrocloud.LookupUserArgs{
    			Id: pulumi.StringRef("user-12345"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("userInfo", pulumi.StringMap{
    			"id":    example.Id,
    			"email": example.Email,
    		})
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Spectrocloud = Pulumi.Spectrocloud;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Spectrocloud.GetUser.Invoke(new()
        {
            Id = "user-12345",
        });
    
        return new Dictionary<string, object?>
        {
            ["userInfo"] = 
            {
                { "id", example.Apply(getUserResult => getUserResult.Id) },
                { "email", example.Apply(getUserResult => getUserResult.Email) },
            },
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.spectrocloud.SpectrocloudFunctions;
    import com.pulumi.spectrocloud.inputs.GetUserArgs;
    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 example = SpectrocloudFunctions.getUser(GetUserArgs.builder()
                .id("user-12345")
                .build());
    
            ctx.export("userInfo", %!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference));
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: spectrocloud:getUser
          arguments:
            id: user-12345
    outputs:
      # Output user details for reference
      userInfo:
        id: ${example.id}
        email: ${example.email}
    

    Using getUser

    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 getUser(args: GetUserArgs, opts?: InvokeOptions): Promise<GetUserResult>
    function getUserOutput(args: GetUserOutputArgs, opts?: InvokeOptions): Output<GetUserResult>
    def get_user(email: Optional[str] = None,
                 id: Optional[str] = None,
                 opts: Optional[InvokeOptions] = None) -> GetUserResult
    def get_user_output(email: Optional[pulumi.Input[str]] = None,
                 id: Optional[pulumi.Input[str]] = None,
                 opts: Optional[InvokeOptions] = None) -> Output[GetUserResult]
    func LookupUser(ctx *Context, args *LookupUserArgs, opts ...InvokeOption) (*LookupUserResult, error)
    func LookupUserOutput(ctx *Context, args *LookupUserOutputArgs, opts ...InvokeOption) LookupUserResultOutput

    > Note: This function is named LookupUser in the Go SDK.

    public static class GetUser 
    {
        public static Task<GetUserResult> InvokeAsync(GetUserArgs args, InvokeOptions? opts = null)
        public static Output<GetUserResult> Invoke(GetUserInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
    public static Output<GetUserResult> getUser(GetUserArgs args, InvokeOptions options)
    
    fn::invoke:
      function: spectrocloud:index/getUser:getUser
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Email string
    The email address of the user. If provided, id cannot be used.
    Id string
    The unique ID of the user. If provided, email cannot be used.
    Email string
    The email address of the user. If provided, id cannot be used.
    Id string
    The unique ID of the user. If provided, email cannot be used.
    email String
    The email address of the user. If provided, id cannot be used.
    id String
    The unique ID of the user. If provided, email cannot be used.
    email string
    The email address of the user. If provided, id cannot be used.
    id string
    The unique ID of the user. If provided, email cannot be used.
    email str
    The email address of the user. If provided, id cannot be used.
    id str
    The unique ID of the user. If provided, email cannot be used.
    email String
    The email address of the user. If provided, id cannot be used.
    id String
    The unique ID of the user. If provided, email cannot be used.

    getUser Result

    The following output properties are available:

    Id string
    The unique ID of the user. If provided, email cannot be used.
    Email string
    The email address of the user. If provided, id cannot be used.
    Id string
    The unique ID of the user. If provided, email cannot be used.
    Email string
    The email address of the user. If provided, id cannot be used.
    id String
    The unique ID of the user. If provided, email cannot be used.
    email String
    The email address of the user. If provided, id cannot be used.
    id string
    The unique ID of the user. If provided, email cannot be used.
    email string
    The email address of the user. If provided, id cannot be used.
    id str
    The unique ID of the user. If provided, email cannot be used.
    email str
    The email address of the user. If provided, id cannot be used.
    id String
    The unique ID of the user. If provided, email cannot be used.
    email String
    The email address of the user. If provided, id cannot be used.

    Package Details

    Repository
    spectrocloud spectrocloud/terraform-provider-spectrocloud
    License
    Notes
    This Pulumi package is based on the spectrocloud Terraform Provider.
    spectrocloud logo
    spectrocloud 0.23.5 published on Sunday, Apr 20, 2025 by spectrocloud