1. Packages
  2. Prefect Provider
  3. API Docs
  4. getWorkspace
prefect 2.25.0 published on Monday, Apr 21, 2025 by prefecthq

prefect.getWorkspace

Explore with Pulumi AI

prefect 2.25.0 published on Monday, Apr 21, 2025 by prefecthq

Get information about an existing Workspace by handle.
Use this data source to obtain Workspace IDs
For more information, see manage workspaces.

This feature is available in the following product plan(s): Prefect Cloud (Free), Prefect Cloud (Pro), Prefect Cloud (Enterprise).

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as prefect from "@pulumi/prefect";

const productionEnvironment = prefect.getWorkspace({
    id: "00000000-0000-0000-0000-000000000000",
});
Copy
import pulumi
import pulumi_prefect as prefect

production_environment = prefect.get_workspace(id="00000000-0000-0000-0000-000000000000")
Copy
package main

import (
	"github.com/pulumi/pulumi-terraform-provider/sdks/go/prefect/v2/prefect"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := prefect.LookupWorkspace(ctx, &prefect.LookupWorkspaceArgs{
			Id: pulumi.StringRef("00000000-0000-0000-0000-000000000000"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Prefect = Pulumi.Prefect;

return await Deployment.RunAsync(() => 
{
    var productionEnvironment = Prefect.GetWorkspace.Invoke(new()
    {
        Id = "00000000-0000-0000-0000-000000000000",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.prefect.PrefectFunctions;
import com.pulumi.prefect.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 productionEnvironment = PrefectFunctions.getWorkspace(GetWorkspaceArgs.builder()
            .id("00000000-0000-0000-0000-000000000000")
            .build());

    }
}
Copy
variables:
  productionEnvironment:
    fn::invoke:
      function: prefect:getWorkspace
      arguments:
        id: 00000000-0000-0000-0000-000000000000
Copy

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>
Copy
def get_workspace(account_id: Optional[str] = None,
                  handle: Optional[str] = None,
                  id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetWorkspaceResult
def get_workspace_output(account_id: Optional[pulumi.Input[str]] = None,
                  handle: Optional[pulumi.Input[str]] = None,
                  id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetWorkspaceResult]
Copy
func LookupWorkspace(ctx *Context, args *LookupWorkspaceArgs, opts ...InvokeOption) (*LookupWorkspaceResult, error)
func LookupWorkspaceOutput(ctx *Context, args *LookupWorkspaceOutputArgs, opts ...InvokeOption) LookupWorkspaceResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
public static Output<GetWorkspaceResult> getWorkspace(GetWorkspaceArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: prefect:index/getWorkspace:getWorkspace
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId string
Account ID (UUID), defaults to the account set in the provider
Handle string
Unique handle for the workspace
Id string
Workspace ID (UUID)
AccountId string
Account ID (UUID), defaults to the account set in the provider
Handle string
Unique handle for the workspace
Id string
Workspace ID (UUID)
accountId String
Account ID (UUID), defaults to the account set in the provider
handle String
Unique handle for the workspace
id String
Workspace ID (UUID)
accountId string
Account ID (UUID), defaults to the account set in the provider
handle string
Unique handle for the workspace
id string
Workspace ID (UUID)
account_id str
Account ID (UUID), defaults to the account set in the provider
handle str
Unique handle for the workspace
id str
Workspace ID (UUID)
accountId String
Account ID (UUID), defaults to the account set in the provider
handle String
Unique handle for the workspace
id String
Workspace ID (UUID)

getWorkspace Result

The following output properties are available:

Created string
Timestamp of when the resource was created (RFC3339)
Description string
Description for the workspace
Handle string
Unique handle for the workspace
Id string
Workspace ID (UUID)
Name string
Name of the workspace
Updated string
Timestamp of when the resource was updated (RFC3339)
AccountId string
Account ID (UUID), defaults to the account set in the provider
Created string
Timestamp of when the resource was created (RFC3339)
Description string
Description for the workspace
Handle string
Unique handle for the workspace
Id string
Workspace ID (UUID)
Name string
Name of the workspace
Updated string
Timestamp of when the resource was updated (RFC3339)
AccountId string
Account ID (UUID), defaults to the account set in the provider
created String
Timestamp of when the resource was created (RFC3339)
description String
Description for the workspace
handle String
Unique handle for the workspace
id String
Workspace ID (UUID)
name String
Name of the workspace
updated String
Timestamp of when the resource was updated (RFC3339)
accountId String
Account ID (UUID), defaults to the account set in the provider
created string
Timestamp of when the resource was created (RFC3339)
description string
Description for the workspace
handle string
Unique handle for the workspace
id string
Workspace ID (UUID)
name string
Name of the workspace
updated string
Timestamp of when the resource was updated (RFC3339)
accountId string
Account ID (UUID), defaults to the account set in the provider
created str
Timestamp of when the resource was created (RFC3339)
description str
Description for the workspace
handle str
Unique handle for the workspace
id str
Workspace ID (UUID)
name str
Name of the workspace
updated str
Timestamp of when the resource was updated (RFC3339)
account_id str
Account ID (UUID), defaults to the account set in the provider
created String
Timestamp of when the resource was created (RFC3339)
description String
Description for the workspace
handle String
Unique handle for the workspace
id String
Workspace ID (UUID)
name String
Name of the workspace
updated String
Timestamp of when the resource was updated (RFC3339)
accountId String
Account ID (UUID), defaults to the account set in the provider

Package Details

Repository
prefect prefecthq/terraform-provider-prefect
License
Notes
This Pulumi package is based on the prefect Terraform Provider.
prefect 2.25.0 published on Monday, Apr 21, 2025 by prefecthq