1. Packages
  2. AWS Classic
  3. API Docs
  4. workspaces
  5. getWorkspace

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

aws.workspaces.getWorkspace

Explore with Pulumi AI

aws logo

Try AWS Native preview for resources not in the classic version.

AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi

    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)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: aws:workspaces/getWorkspace:getWorkspace
      arguments:
        # arguments dictionary

    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<Pulumi.Aws.Workspaces.Outputs.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 string
    Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
    RootVolumeSizeGib int
    Size of the root volume.
    RunningMode string
    Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
    RunningModeAutoStopTimeoutInMinutes int
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    UserVolumeSizeGib int
    Size of the user storage.
    ComputeTypeName string
    Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
    RootVolumeSizeGib int
    Size of the root volume.
    RunningMode string
    Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
    RunningModeAutoStopTimeoutInMinutes int
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    UserVolumeSizeGib int
    Size of the user storage.
    computeTypeName String
    Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
    rootVolumeSizeGib Integer
    Size of the root volume.
    runningMode String
    Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
    runningModeAutoStopTimeoutInMinutes Integer
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    userVolumeSizeGib Integer
    Size of the user storage.
    computeTypeName string
    Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
    rootVolumeSizeGib number
    Size of the root volume.
    runningMode string
    Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
    runningModeAutoStopTimeoutInMinutes number
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    userVolumeSizeGib number
    Size of the user storage.
    compute_type_name 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 int
    Size of the root volume.
    running_mode 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 int
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    user_volume_size_gib int
    Size of the user storage.
    computeTypeName String
    Compute type. For more information, see Amazon WorkSpaces Bundles. Valid values are VALUE, STANDARD, PERFORMANCE, POWER, GRAPHICS, POWERPRO and GRAPHICSPRO.
    rootVolumeSizeGib Number
    Size of the root volume.
    runningMode String
    Running mode. For more information, see Manage the WorkSpace Running Mode. Valid values are AUTO_STOP and ALWAYS_ON.
    runningModeAutoStopTimeoutInMinutes Number
    Time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.
    userVolumeSizeGib 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.
    aws logo

    Try AWS Native preview for resources not in the classic version.

    AWS Classic v6.42.0 published on Wednesday, Jun 26, 2024 by Pulumi