1. Packages
  2. AWS
  3. API Docs
  4. workspaces
  5. getWorkspace
AWS v6.76.0 published on Tuesday, Apr 8, 2025 by Pulumi

aws.workspaces.getWorkspace

Explore with Pulumi AI

Use this data source to get information about a workspace in AWS Workspaces Service.

Example Usage

Filter By Workspace ID

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

const example = aws.workspaces.getWorkspace({
    workspaceId: "ws-cj5xcxsz5",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.workspaces.get_workspace(workspace_id="ws-cj5xcxsz5")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/workspaces"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := workspaces.LookupWorkspace(ctx, &workspaces.LookupWorkspaceArgs{
			WorkspaceId: pulumi.StringRef("ws-cj5xcxsz5"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Workspaces.GetWorkspace.Invoke(new()
    {
        WorkspaceId = "ws-cj5xcxsz5",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.workspaces.WorkspacesFunctions;
import com.pulumi.aws.workspaces.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 = WorkspacesFunctions.getWorkspace(GetWorkspaceArgs.builder()
            .workspaceId("ws-cj5xcxsz5")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:workspaces:getWorkspace
      arguments:
        workspaceId: ws-cj5xcxsz5
Copy

Filter By Directory ID & User Name

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

const example = aws.workspaces.getWorkspace({
    directoryId: "d-9967252f57",
    userName: "Example",
});
Copy
import pulumi
import pulumi_aws as aws

example = aws.workspaces.get_workspace(directory_id="d-9967252f57",
    user_name="Example")
Copy
package main

import (
	"github.com/pulumi/pulumi-aws/sdk/v6/go/aws/workspaces"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := workspaces.LookupWorkspace(ctx, &workspaces.LookupWorkspaceArgs{
			DirectoryId: pulumi.StringRef("d-9967252f57"),
			UserName:    pulumi.StringRef("Example"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Aws = Pulumi.Aws;

return await Deployment.RunAsync(() => 
{
    var example = Aws.Workspaces.GetWorkspace.Invoke(new()
    {
        DirectoryId = "d-9967252f57",
        UserName = "Example",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.aws.workspaces.WorkspacesFunctions;
import com.pulumi.aws.workspaces.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 = WorkspacesFunctions.getWorkspace(GetWorkspaceArgs.builder()
            .directoryId("d-9967252f57")
            .userName("Example")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: aws:workspaces:getWorkspace
      arguments:
        directoryId: d-9967252f57
        userName: Example
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(directory_id: Optional[str] = None,
                  tags: Optional[Mapping[str, str]] = None,
                  user_name: Optional[str] = None,
                  workspace_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetWorkspaceResult
def get_workspace_output(directory_id: Optional[pulumi.Input[str]] = None,
                  tags: Optional[pulumi.Input[Mapping[str, pulumi.Input[str]]]] = None,
                  user_name: Optional[pulumi.Input[str]] = None,
                  workspace_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: aws:workspaces/getWorkspace:getWorkspace
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

DirectoryId string
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
Tags Dictionary<string, string>
Tags for the WorkSpace.
UserName string
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
WorkspaceId string
ID of the WorkSpace. You cannot combine this parameter with directory_id.
DirectoryId string
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
Tags map[string]string
Tags for the WorkSpace.
UserName string
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
WorkspaceId string
ID of the WorkSpace. You cannot combine this parameter with directory_id.
directoryId String
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
tags Map<String,String>
Tags for the WorkSpace.
userName String
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
workspaceId String
ID of the WorkSpace. You cannot combine this parameter with directory_id.
directoryId string
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
tags {[key: string]: string}
Tags for the WorkSpace.
userName string
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
workspaceId string
ID of the WorkSpace. You cannot combine this parameter with directory_id.
directory_id str
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
tags Mapping[str, str]
Tags for the WorkSpace.
user_name str
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
workspace_id str
ID of the WorkSpace. You cannot combine this parameter with directory_id.
directoryId String
ID of the directory for the WorkSpace. You have to specify user_name along with directory_id. You cannot combine this parameter with workspace_id.
tags Map<String>
Tags for the WorkSpace.
userName String
User name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace. You cannot combine this parameter with workspace_id.
workspaceId String
ID of the WorkSpace. You cannot combine this parameter with directory_id.

getWorkspace Result

The following output properties are available:

BundleId string
ComputerName string
Name of the WorkSpace, as seen by the operating system.
DirectoryId string
Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
IP address of the WorkSpace.
RootVolumeEncryptionEnabled bool
State string
Operational state of the WorkSpace.
Tags Dictionary<string, string>
UserName string
UserVolumeEncryptionEnabled bool
VolumeEncryptionKey string
WorkspaceId string
WorkspaceProperties List<GetWorkspaceWorkspaceProperty>
BundleId string
ComputerName string
Name of the WorkSpace, as seen by the operating system.
DirectoryId string
Id string
The provider-assigned unique ID for this managed resource.
IpAddress string
IP address of the WorkSpace.
RootVolumeEncryptionEnabled bool
State string
Operational state of the WorkSpace.
Tags map[string]string
UserName string
UserVolumeEncryptionEnabled bool
VolumeEncryptionKey string
WorkspaceId string
WorkspaceProperties []GetWorkspaceWorkspaceProperty
bundleId String
computerName String
Name of the WorkSpace, as seen by the operating system.
directoryId String
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
IP address of the WorkSpace.
rootVolumeEncryptionEnabled Boolean
state String
Operational state of the WorkSpace.
tags Map<String,String>
userName String
userVolumeEncryptionEnabled Boolean
volumeEncryptionKey String
workspaceId String
workspaceProperties List<GetWorkspaceWorkspaceProperty>
bundleId string
computerName string
Name of the WorkSpace, as seen by the operating system.
directoryId string
id string
The provider-assigned unique ID for this managed resource.
ipAddress string
IP address of the WorkSpace.
rootVolumeEncryptionEnabled boolean
state string
Operational state of the WorkSpace.
tags {[key: string]: string}
userName string
userVolumeEncryptionEnabled boolean
volumeEncryptionKey string
workspaceId string
workspaceProperties GetWorkspaceWorkspaceProperty[]
bundle_id str
computer_name str
Name of the WorkSpace, as seen by the operating system.
directory_id str
id str
The provider-assigned unique ID for this managed resource.
ip_address str
IP address of the WorkSpace.
root_volume_encryption_enabled bool
state str
Operational state of the WorkSpace.
tags Mapping[str, str]
user_name str
user_volume_encryption_enabled bool
volume_encryption_key str
workspace_id str
workspace_properties Sequence[GetWorkspaceWorkspaceProperty]
bundleId String
computerName String
Name of the WorkSpace, as seen by the operating system.
directoryId String
id String
The provider-assigned unique ID for this managed resource.
ipAddress String
IP address of the WorkSpace.
rootVolumeEncryptionEnabled Boolean
state String
Operational state of the WorkSpace.
tags Map<String>
userName String
userVolumeEncryptionEnabled Boolean
volumeEncryptionKey String
workspaceId String
workspaceProperties List<Property Map>

Supporting Types

GetWorkspaceWorkspaceProperty

ComputeTypeName This property is required. string
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
RootVolumeSizeGib This property is required. int
Size of the root volume.
RunningMode This property is required. string
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
RunningModeAutoStopTimeoutInMinutes This property is required. int
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
UserVolumeSizeGib This property is required. int
Size of the user storage.
ComputeTypeName This property is required. string
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
RootVolumeSizeGib This property is required. int
Size of the root volume.
RunningMode This property is required. string
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
RunningModeAutoStopTimeoutInMinutes This property is required. int
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
UserVolumeSizeGib This property is required. int
Size of the user storage.
computeTypeName This property is required. String
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
rootVolumeSizeGib This property is required. Integer
Size of the root volume.
runningMode This property is required. String
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
runningModeAutoStopTimeoutInMinutes This property is required. Integer
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
userVolumeSizeGib This property is required. Integer
Size of the user storage.
computeTypeName This property is required. string
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
rootVolumeSizeGib This property is required. number
Size of the root volume.
runningMode This property is required. string
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
runningModeAutoStopTimeoutInMinutes This property is required. number
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
userVolumeSizeGib This property is required. number
Size of the user storage.
compute_type_name This property is required. str
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
root_volume_size_gib This property is required. int
Size of the root volume.
running_mode This property is required. str
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
running_mode_auto_stop_timeout_in_minutes This property is required. int
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
user_volume_size_gib This property is required. int
Size of the user storage.
computeTypeName This property is required. String
Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
rootVolumeSizeGib This property is required. Number
Size of the root volume.
runningMode This property is required. String
Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
runningModeAutoStopTimeoutInMinutes This property is required. Number
Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
userVolumeSizeGib This property is required. Number
Size of the user storage.

Package Details

Repository
AWS Classic pulumi/pulumi-aws
License
Apache-2.0
Notes
This Pulumi package is based on the aws Terraform Provider.