AWS v6.73.0 published on Wednesday, Mar 19, 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",
});
import pulumi
import pulumi_aws as aws
example = aws.workspaces.get_workspace(workspace_id="ws-cj5xcxsz5")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:workspaces:getWorkspace
      arguments:
        workspaceId: ws-cj5xcxsz5
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",
});
import pulumi
import pulumi_aws as aws
example = aws.workspaces.get_workspace(directory_id="d-9967252f57",
    user_name="Example")
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
	})
}
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",
    });
});
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());
    }
}
variables:
  example:
    fn::invoke:
      function: aws:workspaces:getWorkspace
      arguments:
        directoryId: d-9967252f57
        userName: Example
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(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]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: aws:workspaces/getWorkspace:getWorkspace
  arguments:
    # arguments dictionaryThe following arguments are supported:
- DirectoryId string
- ID of the directory for the WorkSpace. You have to specify user_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- 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_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- 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_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- 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_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- {[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_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- 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_namealong withdirectory_id. You cannot combine this parameter withworkspace_id.
- 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.
- RootVolume boolEncryption Enabled 
- State string
- Operational state of the WorkSpace.
- Dictionary<string, string>
- UserName string
- UserVolume boolEncryption Enabled 
- VolumeEncryption stringKey 
- WorkspaceId string
- WorkspaceProperties List<GetWorkspace Workspace Property> 
- 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.
- RootVolume boolEncryption Enabled 
- State string
- Operational state of the WorkSpace.
- map[string]string
- UserName string
- UserVolume boolEncryption Enabled 
- VolumeEncryption stringKey 
- WorkspaceId string
- WorkspaceProperties []GetWorkspace Workspace Property 
- 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.
- rootVolume BooleanEncryption Enabled 
- state String
- Operational state of the WorkSpace.
- Map<String,String>
- userName String
- userVolume BooleanEncryption Enabled 
- volumeEncryption StringKey 
- workspaceId String
- workspaceProperties List<GetWorkspace Workspace Property> 
- 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.
- rootVolume booleanEncryption Enabled 
- state string
- Operational state of the WorkSpace.
- {[key: string]: string}
- userName string
- userVolume booleanEncryption Enabled 
- volumeEncryption stringKey 
- workspaceId string
- workspaceProperties GetWorkspace Workspace Property[] 
- 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_ boolencryption_ enabled 
- state str
- Operational state of the WorkSpace.
- Mapping[str, str]
- user_name str
- user_volume_ boolencryption_ enabled 
- volume_encryption_ strkey 
- workspace_id str
- workspace_properties Sequence[GetWorkspace Workspace Property] 
- 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.
- rootVolume BooleanEncryption Enabled 
- state String
- Operational state of the WorkSpace.
- Map<String>
- userName String
- userVolume BooleanEncryption Enabled 
- volumeEncryption StringKey 
- workspaceId String
- workspaceProperties List<Property Map>
Supporting Types
GetWorkspaceWorkspaceProperty   
- ComputeType stringName 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- RootVolume intSize Gib 
- Size of the root volume.
- RunningMode string
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- RunningMode intAuto Stop Timeout In Minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- UserVolume intSize Gib 
- Size of the user storage.
- ComputeType stringName 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- RootVolume intSize Gib 
- Size of the root volume.
- RunningMode string
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- RunningMode intAuto Stop Timeout In Minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- UserVolume intSize Gib 
- Size of the user storage.
- computeType StringName 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- rootVolume IntegerSize Gib 
- Size of the root volume.
- runningMode String
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- runningMode IntegerAuto Stop Timeout In Minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- userVolume IntegerSize Gib 
- Size of the user storage.
- computeType stringName 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- rootVolume numberSize Gib 
- Size of the root volume.
- runningMode string
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- runningMode numberAuto Stop Timeout In Minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- userVolume numberSize Gib 
- Size of the user storage.
- compute_type_ strname 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- root_volume_ intsize_ gib 
- Size of the root volume.
- running_mode str
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- running_mode_ intauto_ stop_ timeout_ in_ minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- user_volume_ intsize_ gib 
- Size of the user storage.
- computeType StringName 
- Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE,STANDARD,PERFORMANCE,POWER,GRAPHICS,POWERPROandGRAPHICSPRO.
- rootVolume NumberSize Gib 
- Size of the root volume.
- runningMode String
- Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOPandALWAYS_ON.
- runningMode NumberAuto Stop Timeout In Minutes 
- Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
- userVolume NumberSize Gib 
- 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 awsTerraform Provider.