Class Workspace


  • public class Workspace
    extends com.pulumi.resources.CustomResource
    Provides a workspace in [AWS Workspaces](https://docs.aws.amazon.com/workspaces/latest/adminguide/amazon-workspaces.html) Service > **NOTE:** AWS WorkSpaces service requires [`workspaces_DefaultRole`](https://docs.aws.amazon.com/workspaces/latest/adminguide/workspaces-access-control.html#create-default-role) IAM role to operate normally. ## Example Usage ```java 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.GetBundleArgs; import com.pulumi.aws.workspaces.Workspace; import com.pulumi.aws.workspaces.WorkspaceArgs; import com.pulumi.aws.workspaces.inputs.WorkspaceWorkspacePropertiesArgs; 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 valueWindows10 = WorkspacesFunctions.getBundle(GetBundleArgs.builder() .bundleId("wsb-bh8rsxt14") .build()); var example = new Workspace("example", WorkspaceArgs.builder() .directoryId(aws_workspaces_directory.example().id()) .bundleId(valueWindows10.applyValue(getBundleResult -> getBundleResult.id())) .userName("john.doe") .rootVolumeEncryptionEnabled(true) .userVolumeEncryptionEnabled(true) .volumeEncryptionKey("alias/aws/workspaces") .workspaceProperties(WorkspaceWorkspacePropertiesArgs.builder() .computeTypeName("VALUE") .userVolumeSizeGib(10) .rootVolumeSizeGib(80) .runningMode("AUTO_STOP") .runningModeAutoStopTimeoutInMinutes(60) .build()) .tags(Map.of("Department", "IT")) .build()); } } ``` ## Import Using `pulumi import`, import Workspaces using their ID. For example: ```sh $ pulumi import aws:workspaces/workspace:Workspace example ws-9z9zmbkhv ```
    • Nested Class Summary

      • Nested classes/interfaces inherited from class com.pulumi.resources.CustomResource

        com.pulumi.resources.CustomResource.CustomResourceInternal
      • Nested classes/interfaces inherited from class com.pulumi.resources.Resource

        com.pulumi.resources.Resource.LazyField<T extends java.lang.Object>, com.pulumi.resources.Resource.LazyFields, com.pulumi.resources.Resource.ResourceInternal
    • Field Summary

      • Fields inherited from class com.pulumi.resources.Resource

        childResources, remote
    • Constructor Summary

      Constructors 
      Constructor Description
      Workspace​(java.lang.String name)  
      Workspace​(java.lang.String name, WorkspaceArgs args)  
      Workspace​(java.lang.String name, WorkspaceArgs args, com.pulumi.resources.CustomResourceOptions options)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      com.pulumi.core.Output<java.lang.String> bundleId()  
      com.pulumi.core.Output<java.lang.String> computerName()  
      com.pulumi.core.Output<java.lang.String> directoryId()  
      static Workspace get​(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, WorkspaceState state, com.pulumi.resources.CustomResourceOptions options)
      Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
      com.pulumi.core.Output<java.lang.String> ipAddress()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> rootVolumeEncryptionEnabled()  
      com.pulumi.core.Output<java.lang.String> state()  
      com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()  
      com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()  
      com.pulumi.core.Output<java.lang.String> userName()  
      com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> userVolumeEncryptionEnabled()  
      com.pulumi.core.Output<java.util.Optional<java.lang.String>> volumeEncryptionKey()  
      com.pulumi.core.Output<WorkspaceWorkspaceProperties> workspaceProperties()  
      • Methods inherited from class com.pulumi.resources.CustomResource

        getId, id, idFuture
      • Methods inherited from class com.pulumi.resources.Resource

        getChildResources, getResourceName, getResourceType, getUrn, pulumiChildResources, pulumiResourceName, pulumiResourceType, urn
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Workspace

        public Workspace​(java.lang.String name)
        Parameters:
        name - The _unique_ name of the resulting resource.
      • Workspace

        public Workspace​(java.lang.String name,
                         WorkspaceArgs args)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
      • Workspace

        public Workspace​(java.lang.String name,
                         WorkspaceArgs args,
                         @Nullable
                         com.pulumi.resources.CustomResourceOptions options)
        Parameters:
        name - The _unique_ name of the resulting resource.
        args - The arguments to use to populate this resource's properties.
        options - A bag of options that control this resource's behavior.
    • Method Detail

      • bundleId

        public com.pulumi.core.Output<java.lang.String> bundleId()
        Returns:
        The ID of the bundle for the WorkSpace.
      • computerName

        public com.pulumi.core.Output<java.lang.String> computerName()
        Returns:
        The name of the WorkSpace, as seen by the operating system.
      • directoryId

        public com.pulumi.core.Output<java.lang.String> directoryId()
        Returns:
        The ID of the directory for the WorkSpace.
      • ipAddress

        public com.pulumi.core.Output<java.lang.String> ipAddress()
        Returns:
        The IP address of the WorkSpace.
      • rootVolumeEncryptionEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> rootVolumeEncryptionEnabled()
        Returns:
        Indicates whether the data stored on the root volume is encrypted.
      • state

        public com.pulumi.core.Output<java.lang.String> state()
        Returns:
        The operational state of the WorkSpace.
      • tags

        public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,​java.lang.String>>> tags()
        Returns:
        The tags for the WorkSpace. If configured with a provider `default_tags` configuration block present, tags with matching keys will overwrite those defined at the provider-level.
      • tagsAll

        public com.pulumi.core.Output<java.util.Map<java.lang.String,​java.lang.String>> tagsAll()
        Returns:
        A map of tags assigned to the resource, including those inherited from the provider `default_tags` configuration block.
      • userName

        public com.pulumi.core.Output<java.lang.String> userName()
        Returns:
        The user name of the user for the WorkSpace. This user name must exist in the directory for the WorkSpace.
      • userVolumeEncryptionEnabled

        public com.pulumi.core.Output<java.util.Optional<java.lang.Boolean>> userVolumeEncryptionEnabled()
        Returns:
        Indicates whether the data stored on the user volume is encrypted.
      • volumeEncryptionKey

        public com.pulumi.core.Output<java.util.Optional<java.lang.String>> volumeEncryptionKey()
        Returns:
        The symmetric AWS KMS customer master key (CMK) used to encrypt data stored on your WorkSpace. Amazon WorkSpaces does not support asymmetric CMKs.
      • workspaceProperties

        public com.pulumi.core.Output<WorkspaceWorkspaceProperties> workspaceProperties()
        Returns:
        The WorkSpace properties.
      • get

        public static Workspace get​(java.lang.String name,
                                    com.pulumi.core.Output<java.lang.String> id,
                                    @Nullable
                                    WorkspaceState state,
                                    @Nullable
                                    com.pulumi.resources.CustomResourceOptions options)
        Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.
        Parameters:
        name - The _unique_ name of the resulting resource.
        id - The _unique_ provider ID of the resource to lookup.
        state -
        options - Optional settings to control the behavior of the CustomResource.