1. Packages
  2. Packages
  3. Vantage Provider
  4. API Docs
  5. getWorkspace
Viewing docs for vantage 0.3.11
published on Friday, Jul 24, 2026 by vantage-sh
Viewing docs for vantage 0.3.11
published on Friday, Jul 24, 2026 by vantage-sh

    Looks up a workspace by its display name. Searches all workspaces returned by the Get All Workspaces endpoint and returns the first match.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as vantage from "@pulumi/vantage";
    
    const example = vantage.getWorkspace({
        name: "Production",
    });
    export const workspaceToken = example.then(example => example.token);
    
    import pulumi
    import pulumi_vantage as vantage
    
    example = vantage.get_workspace(name="Production")
    pulumi.export("workspaceToken", example.token)
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-terraform-provider/sdks/go/vantage/vantage"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		example, err := vantage.LookupWorkspace(ctx, &vantage.LookupWorkspaceArgs{
    			Name: "Production",
    		}, nil)
    		if err != nil {
    			return err
    		}
    		ctx.Export("workspaceToken", example.Token)
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Vantage = Pulumi.Vantage;
    
    return await Deployment.RunAsync(() => 
    {
        var example = Vantage.GetWorkspace.Invoke(new()
        {
            Name = "Production",
        });
    
        return new Dictionary<string, object?>
        {
            ["workspaceToken"] = example.Apply(getWorkspaceResult => getWorkspaceResult.Token),
        };
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.vantage.VantageFunctions;
    import com.pulumi.vantage.inputs.GetWorkspaceArgs;
    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 = VantageFunctions.getWorkspace(GetWorkspaceArgs.builder()
                .name("Production")
                .build());
    
            ctx.export("workspaceToken", example.token());
        }
    }
    
    variables:
      example:
        fn::invoke:
          function: vantage:getWorkspace
          arguments:
            name: Production
    outputs:
      workspaceToken: ${example.token}
    
    Example coming soon!
    

    Using getWorkspace

    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 getWorkspace(args: GetWorkspaceArgs, opts?: InvokeOptions): Promise<GetWorkspaceResult>
    function getWorkspaceOutput(args: GetWorkspaceOutputArgs, opts?: InvokeOptions): Output<GetWorkspaceResult>
    def get_workspace(name: Optional[str] = None,
                      opts: Optional[InvokeOptions] = None) -> GetWorkspaceResult
    def get_workspace_output(name: pulumi.Input[Optional[str]] = None,
                      opts: Optional[InvokeOptions] = None) -> Output[GetWorkspaceResult]
    func LookupWorkspace(ctx *Context, args *LookupWorkspaceArgs, opts ...InvokeOption) (*LookupWorkspaceResult, error)
    func LookupWorkspaceOutput(ctx *Context, args *LookupWorkspaceOutputArgs, opts ...InvokeOption) LookupWorkspaceResultOutput

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

    public static class GetWorkspace 
    {
        public static Task<GetWorkspaceResult> InvokeAsync(GetWorkspaceArgs args, InvokeOptions? opts = null)
        public static Output<GetWorkspaceResult> Invoke(GetWorkspaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
    public static Output<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: vantage:index/getWorkspace:getWorkspace
      arguments:
        # arguments dictionary
    data "vantage_get_workspace" "name" {
        # arguments
    }

    The following arguments are supported:

    Name string
    The name of the workspace to find.
    Name string
    The name of the workspace to find.
    name string
    The name of the workspace to find.
    name String
    The name of the workspace to find.
    name string
    The name of the workspace to find.
    name str
    The name of the workspace to find.
    name String
    The name of the workspace to find.

    getWorkspace Result

    The following output properties are available:

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the workspace to find.
    Token string
    The unique token of the matched workspace.
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the workspace to find.
    Token string
    The unique token of the matched workspace.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the workspace to find.
    token string
    The unique token of the matched workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the workspace to find.
    token String
    The unique token of the matched workspace.
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the workspace to find.
    token string
    The unique token of the matched workspace.
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the workspace to find.
    token str
    The unique token of the matched workspace.
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the workspace to find.
    token String
    The unique token of the matched workspace.

    Package Details

    Repository
    vantage vantage-sh/terraform-provider-vantage
    License
    Notes
    This Pulumi package is based on the vantage Terraform Provider.
    Viewing docs for vantage 0.3.11
    published on Friday, Jul 24, 2026 by vantage-sh

      Try Pulumi Cloud free.
      Your team will thank you.

      Start free trial