WorkSpaces / Client / create_workspaces

create_workspaces#

WorkSpaces.Client.create_workspaces(**kwargs)#

Creates one or more WorkSpaces.

This operation is asynchronous and returns before the WorkSpaces are created.

Note

  • The MANUAL running mode value is only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use this value. For more information, see Amazon WorkSpaces Core.

  • You don’t need to specify the PCOIP protocol for Linux bundles because WSP is the default protocol for those bundles.

  • User-decoupled WorkSpaces are only supported by Amazon WorkSpaces Core.

See also: AWS API Documentation

Request Syntax

response = client.create_workspaces(
    Workspaces=[
        {
            'DirectoryId': 'string',
            'UserName': 'string',
            'BundleId': 'string',
            'VolumeEncryptionKey': 'string',
            'UserVolumeEncryptionEnabled': True|False,
            'RootVolumeEncryptionEnabled': True|False,
            'WorkspaceProperties': {
                'RunningMode': 'AUTO_STOP'|'ALWAYS_ON'|'MANUAL',
                'RunningModeAutoStopTimeoutInMinutes': 123,
                'RootVolumeSizeGib': 123,
                'UserVolumeSizeGib': 123,
                'ComputeTypeName': 'VALUE'|'STANDARD'|'PERFORMANCE'|'POWER'|'GRAPHICS'|'POWERPRO'|'GRAPHICSPRO'|'GRAPHICS_G4DN'|'GRAPHICSPRO_G4DN',
                'Protocols': [
                    'PCOIP'|'WSP',
                ],
                'OperatingSystemName': 'AMAZON_LINUX_2'|'UBUNTU_18_04'|'UBUNTU_20_04'|'UBUNTU_22_04'|'UNKNOWN'|'WINDOWS_10'|'WINDOWS_11'|'WINDOWS_7'|'WINDOWS_SERVER_2016'|'WINDOWS_SERVER_2019'|'WINDOWS_SERVER_2022'
            },
            'Tags': [
                {
                    'Key': 'string',
                    'Value': 'string'
                },
            ],
            'WorkspaceName': 'string'
        },
    ]
)
Parameters:

Workspaces (list) –

[REQUIRED]

The WorkSpaces to create. You can specify up to 25 WorkSpaces.

  • (dict) –

    Describes the information used to create a WorkSpace.

    • DirectoryId (string) – [REQUIRED]

      The identifier of the Directory Service directory for the WorkSpace. You can use DescribeWorkspaceDirectories to list the available directories.

    • UserName (string) – [REQUIRED]

      The user name of the user for the WorkSpace. This user name must exist in the Directory Service directory for the WorkSpace.

      The reserved keyword, [UNDEFINED], is used when creating user-decoupled WorkSpaces.

    • BundleId (string) – [REQUIRED]

      The identifier of the bundle for the WorkSpace. You can use DescribeWorkspaceBundles to list the available bundles.

    • VolumeEncryptionKey (string) –

      The ARN of the symmetric KMS key used to encrypt data stored on your WorkSpace. Amazon WorkSpaces does not support asymmetric KMS keys.

    • UserVolumeEncryptionEnabled (boolean) –

      Indicates whether the data stored on the user volume is encrypted.

    • RootVolumeEncryptionEnabled (boolean) –

      Indicates whether the data stored on the root volume is encrypted.

    • WorkspaceProperties (dict) –

      The WorkSpace properties.

      • RunningMode (string) –

        The running mode. For more information, see Manage the WorkSpace Running Mode.

        Note

        The MANUAL value is only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use this value. For more information, see Amazon WorkSpaces Core.

      • RunningModeAutoStopTimeoutInMinutes (integer) –

        The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.

      • RootVolumeSizeGib (integer) –

        The size of the root volume. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

      • UserVolumeSizeGib (integer) –

        The size of the user storage. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

      • ComputeTypeName (string) –

        The compute type. For more information, see Amazon WorkSpaces Bundles.

      • Protocols (list) –

        The protocol. For more information, see Protocols for Amazon WorkSpaces.

        Note

        • Only available for WorkSpaces created with PCoIP bundles.

        • The Protocols property is case sensitive. Ensure you use PCOIP or WSP.

        • Unavailable for Windows 7 WorkSpaces and WorkSpaces using GPU-based bundles (Graphics, GraphicsPro, Graphics.g4dn, and GraphicsPro.g4dn).

        • (string) –

      • OperatingSystemName (string) –

        The name of the operating system.

    • Tags (list) –

      The tags for the WorkSpace.

      • (dict) –

        Describes a tag.

        • Key (string) – [REQUIRED]

          The key of the tag.

        • Value (string) –

          The value of the tag.

    • WorkspaceName (string) –

      The name of the user-decoupled WorkSpace.

Return type:

dict

Returns:

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceRequest': {
                'DirectoryId': 'string',
                'UserName': 'string',
                'BundleId': 'string',
                'VolumeEncryptionKey': 'string',
                'UserVolumeEncryptionEnabled': True|False,
                'RootVolumeEncryptionEnabled': True|False,
                'WorkspaceProperties': {
                    'RunningMode': 'AUTO_STOP'|'ALWAYS_ON'|'MANUAL',
                    'RunningModeAutoStopTimeoutInMinutes': 123,
                    'RootVolumeSizeGib': 123,
                    'UserVolumeSizeGib': 123,
                    'ComputeTypeName': 'VALUE'|'STANDARD'|'PERFORMANCE'|'POWER'|'GRAPHICS'|'POWERPRO'|'GRAPHICSPRO'|'GRAPHICS_G4DN'|'GRAPHICSPRO_G4DN',
                    'Protocols': [
                        'PCOIP'|'WSP',
                    ],
                    'OperatingSystemName': 'AMAZON_LINUX_2'|'UBUNTU_18_04'|'UBUNTU_20_04'|'UBUNTU_22_04'|'UNKNOWN'|'WINDOWS_10'|'WINDOWS_11'|'WINDOWS_7'|'WINDOWS_SERVER_2016'|'WINDOWS_SERVER_2019'|'WINDOWS_SERVER_2022'
                },
                'Tags': [
                    {
                        'Key': 'string',
                        'Value': 'string'
                    },
                ],
                'WorkspaceName': 'string'
            },
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ],
    'PendingRequests': [
        {
            'WorkspaceId': 'string',
            'DirectoryId': 'string',
            'UserName': 'string',
            'IpAddress': 'string',
            'State': 'PENDING'|'AVAILABLE'|'IMPAIRED'|'UNHEALTHY'|'REBOOTING'|'STARTING'|'REBUILDING'|'RESTORING'|'MAINTENANCE'|'ADMIN_MAINTENANCE'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'UPDATING'|'STOPPING'|'STOPPED'|'ERROR',
            'BundleId': 'string',
            'SubnetId': 'string',
            'ErrorMessage': 'string',
            'ErrorCode': 'string',
            'ComputerName': 'string',
            'VolumeEncryptionKey': 'string',
            'UserVolumeEncryptionEnabled': True|False,
            'RootVolumeEncryptionEnabled': True|False,
            'WorkspaceName': 'string',
            'WorkspaceProperties': {
                'RunningMode': 'AUTO_STOP'|'ALWAYS_ON'|'MANUAL',
                'RunningModeAutoStopTimeoutInMinutes': 123,
                'RootVolumeSizeGib': 123,
                'UserVolumeSizeGib': 123,
                'ComputeTypeName': 'VALUE'|'STANDARD'|'PERFORMANCE'|'POWER'|'GRAPHICS'|'POWERPRO'|'GRAPHICSPRO'|'GRAPHICS_G4DN'|'GRAPHICSPRO_G4DN',
                'Protocols': [
                    'PCOIP'|'WSP',
                ],
                'OperatingSystemName': 'AMAZON_LINUX_2'|'UBUNTU_18_04'|'UBUNTU_20_04'|'UBUNTU_22_04'|'UNKNOWN'|'WINDOWS_10'|'WINDOWS_11'|'WINDOWS_7'|'WINDOWS_SERVER_2016'|'WINDOWS_SERVER_2019'|'WINDOWS_SERVER_2022'
            },
            'ModificationStates': [
                {
                    'Resource': 'ROOT_VOLUME'|'USER_VOLUME'|'COMPUTE_TYPE',
                    'State': 'UPDATE_INITIATED'|'UPDATE_IN_PROGRESS'
                },
            ],
            'RelatedWorkspaces': [
                {
                    'WorkspaceId': 'string',
                    'Region': 'string',
                    'State': 'PENDING'|'AVAILABLE'|'IMPAIRED'|'UNHEALTHY'|'REBOOTING'|'STARTING'|'REBUILDING'|'RESTORING'|'MAINTENANCE'|'ADMIN_MAINTENANCE'|'TERMINATING'|'TERMINATED'|'SUSPENDED'|'UPDATING'|'STOPPING'|'STOPPED'|'ERROR',
                    'Type': 'PRIMARY'|'STANDBY'
                },
            ],
            'DataReplicationSettings': {
                'DataReplication': 'NO_REPLICATION'|'PRIMARY_AS_SOURCE',
                'RecoverySnapshotTime': datetime(2015, 1, 1)
            },
            'StandbyWorkspacesProperties': [
                {
                    'StandbyWorkspaceId': 'string',
                    'DataReplication': 'NO_REPLICATION'|'PRIMARY_AS_SOURCE',
                    'RecoverySnapshotTime': datetime(2015, 1, 1)
                },
            ]
        },
    ]
}

Response Structure

  • (dict) –

    • FailedRequests (list) –

      Information about the WorkSpaces that could not be created.

      • (dict) –

        Describes a WorkSpace that cannot be created.

        • WorkspaceRequest (dict) –

          Information about the WorkSpace.

          • DirectoryId (string) –

            The identifier of the Directory Service directory for the WorkSpace. You can use DescribeWorkspaceDirectories to list the available directories.

          • UserName (string) –

            The user name of the user for the WorkSpace. This user name must exist in the Directory Service directory for the WorkSpace.

            The reserved keyword, [UNDEFINED], is used when creating user-decoupled WorkSpaces.

          • BundleId (string) –

            The identifier of the bundle for the WorkSpace. You can use DescribeWorkspaceBundles to list the available bundles.

          • VolumeEncryptionKey (string) –

            The ARN of the symmetric KMS key used to encrypt data stored on your WorkSpace. Amazon WorkSpaces does not support asymmetric KMS keys.

          • UserVolumeEncryptionEnabled (boolean) –

            Indicates whether the data stored on the user volume is encrypted.

          • RootVolumeEncryptionEnabled (boolean) –

            Indicates whether the data stored on the root volume is encrypted.

          • WorkspaceProperties (dict) –

            The WorkSpace properties.

            • RunningMode (string) –

              The running mode. For more information, see Manage the WorkSpace Running Mode.

              Note

              The MANUAL value is only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use this value. For more information, see Amazon WorkSpaces Core.

            • RunningModeAutoStopTimeoutInMinutes (integer) –

              The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.

            • RootVolumeSizeGib (integer) –

              The size of the root volume. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

            • UserVolumeSizeGib (integer) –

              The size of the user storage. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

            • ComputeTypeName (string) –

              The compute type. For more information, see Amazon WorkSpaces Bundles.

            • Protocols (list) –

              The protocol. For more information, see Protocols for Amazon WorkSpaces.

              Note

              • Only available for WorkSpaces created with PCoIP bundles.

              • The Protocols property is case sensitive. Ensure you use PCOIP or WSP.

              • Unavailable for Windows 7 WorkSpaces and WorkSpaces using GPU-based bundles (Graphics, GraphicsPro, Graphics.g4dn, and GraphicsPro.g4dn).

              • (string) –

            • OperatingSystemName (string) –

              The name of the operating system.

          • Tags (list) –

            The tags for the WorkSpace.

            • (dict) –

              Describes a tag.

              • Key (string) –

                The key of the tag.

              • Value (string) –

                The value of the tag.

          • WorkspaceName (string) –

            The name of the user-decoupled WorkSpace.

        • ErrorCode (string) –

          The error code that is returned if the WorkSpace cannot be created.

        • ErrorMessage (string) –

          The text of the error message that is returned if the WorkSpace cannot be created.

    • PendingRequests (list) –

      Information about the WorkSpaces that were created.

      Because this operation is asynchronous, the identifier returned is not immediately available for use with other operations. For example, if you call DescribeWorkspaces before the WorkSpace is created, the information returned can be incomplete.

      • (dict) –

        Describes a WorkSpace.

        • WorkspaceId (string) –

          The identifier of the WorkSpace.

        • DirectoryId (string) –

          The identifier of the Directory Service directory for the WorkSpace.

        • UserName (string) –

          The user for the WorkSpace.

        • IpAddress (string) –

          The IP address of the WorkSpace.

        • State (string) –

          The operational state of the WorkSpace.

          • PENDING – The WorkSpace is in a waiting state (for example, the WorkSpace is being created).

          • AVAILABLE – The WorkSpace is running and has passed the health checks.

          • IMPAIRED – Refer to UNHEALTHY state.

          • UNHEALTHY – The WorkSpace is not responding to health checks.

          • REBOOTING – The WorkSpace is being rebooted (restarted).

          • STARTING – The WorkSpace is starting up and health checks are being run.

          • REBUILDING – The WorkSpace is being rebuilt.

          • RESTORING – The WorkSpace is being restored.

          • MAINTENANCE – The WorkSpace is undergoing scheduled maintenance by Amazon Web Services.

          • ADMIN_MAINTENANCE – The WorkSpace is undergoing maintenance by the WorkSpaces administrator.

          • TERMINATING – The WorkSpace is being deleted.

          • TERMINATED – The WorkSpace has been deleted.

          • SUSPENDED – The WorkSpace has been suspended for image creation.

          • UPDATING – The WorkSpace is undergoing an update.

          • STOPPING – The WorkSpace is being stopped.

          • STOPPED – The WorkSpace has been stopped.

          • ERROR – The WorkSpace is an error state (for example, an error occurred during startup).

          Note

          After a WorkSpace is terminated, the TERMINATED state is returned only briefly before the WorkSpace directory metadata is cleaned up, so this state is rarely returned. To confirm that a WorkSpace is terminated, check for the WorkSpace ID by using DescribeWorkSpaces. If the WorkSpace ID isn’t returned, then the WorkSpace has been successfully terminated.

        • BundleId (string) –

          The identifier of the bundle used to create the WorkSpace.

        • SubnetId (string) –

          The identifier of the subnet for the WorkSpace.

        • ErrorMessage (string) –

          The text of the error message that is returned if the WorkSpace cannot be created.

        • ErrorCode (string) –

          The error code that is returned if the WorkSpace cannot be created.

        • ComputerName (string) –

          The name of the WorkSpace, as seen by the operating system. The format of this name varies. For more information, see Launch a WorkSpace.

        • VolumeEncryptionKey (string) –

          The ARN of the symmetric KMS key used to encrypt data stored on your WorkSpace. Amazon WorkSpaces does not support asymmetric KMS keys.

        • UserVolumeEncryptionEnabled (boolean) –

          Indicates whether the data stored on the user volume is encrypted.

        • RootVolumeEncryptionEnabled (boolean) –

          Indicates whether the data stored on the root volume is encrypted.

        • WorkspaceName (string) –

          The name of the user-decoupled WorkSpace.

        • WorkspaceProperties (dict) –

          The properties of the WorkSpace.

          • RunningMode (string) –

            The running mode. For more information, see Manage the WorkSpace Running Mode.

            Note

            The MANUAL value is only supported by Amazon WorkSpaces Core. Contact your account team to be allow-listed to use this value. For more information, see Amazon WorkSpaces Core.

          • RunningModeAutoStopTimeoutInMinutes (integer) –

            The time after a user logs off when WorkSpaces are automatically stopped. Configured in 60-minute intervals.

          • RootVolumeSizeGib (integer) –

            The size of the root volume. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

          • UserVolumeSizeGib (integer) –

            The size of the user storage. For important information about how to modify the size of the root and user volumes, see Modify a WorkSpace.

          • ComputeTypeName (string) –

            The compute type. For more information, see Amazon WorkSpaces Bundles.

          • Protocols (list) –

            The protocol. For more information, see Protocols for Amazon WorkSpaces.

            Note

            • Only available for WorkSpaces created with PCoIP bundles.

            • The Protocols property is case sensitive. Ensure you use PCOIP or WSP.

            • Unavailable for Windows 7 WorkSpaces and WorkSpaces using GPU-based bundles (Graphics, GraphicsPro, Graphics.g4dn, and GraphicsPro.g4dn).

            • (string) –

          • OperatingSystemName (string) –

            The name of the operating system.

        • ModificationStates (list) –

          The modification states of the WorkSpace.

          • (dict) –

            Describes a WorkSpace modification.

            • Resource (string) –

              The resource.

            • State (string) –

              The modification state.

        • RelatedWorkspaces (list) –

          The standby WorkSpace or primary WorkSpace related to the specified WorkSpace.

          • (dict) –

            Describes the related WorkSpace. The related WorkSpace could be a standby WorkSpace or primary WorkSpace related to the specified WorkSpace.

            • WorkspaceId (string) –

              The identifier of the related WorkSpace.

            • Region (string) –

              The Region of the related WorkSpace.

            • State (string) –

              Indicates the state of the WorkSpace.

            • Type (string) –

              Indicates the type of WorkSpace.

        • DataReplicationSettings (dict) –

          Indicates the settings of the data replication.

          • DataReplication (string) –

            Indicates whether data replication is enabled, and if enabled, the type of data replication.

          • RecoverySnapshotTime (datetime) –

            The date and time at which the last successful snapshot was taken of the primary WorkSpace used for replicating data.

        • StandbyWorkspacesProperties (list) –

          The properties of the standby WorkSpace

          • (dict) –

            Describes the properties of the related standby WorkSpaces.

            • StandbyWorkspaceId (string) –

              The identifier of the standby WorkSpace

            • DataReplication (string) –

              Indicates whether data replication is enabled, and if enabled, the type of data replication.

            • RecoverySnapshotTime (datetime) –

              The date and time at which the last successful snapshot was taken of the primary WorkSpace used for replicating data.

Exceptions

  • WorkSpaces.Client.exceptions.ResourceLimitExceededException

  • WorkSpaces.Client.exceptions.InvalidParameterValuesException