WorkSpaces / Client / terminate_workspaces

terminate_workspaces#

WorkSpaces.Client.terminate_workspaces(**kwargs)#

Terminates the specified WorkSpaces.

Warning

Terminating a WorkSpace is a permanent action and cannot be undone. The user’s data is destroyed. If you need to archive any user data, contact Amazon Web Services Support before terminating the WorkSpace.

You can terminate a WorkSpace that is in any state except SUSPENDED.

This operation is asynchronous and returns before the WorkSpaces have been completely terminated. 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.

Note

Simple AD and AD Connector are made available to you free of charge to use with WorkSpaces. If there are no WorkSpaces being used with your Simple AD or AD Connector directory for 30 consecutive days, this directory will be automatically deregistered for use with Amazon WorkSpaces, and you will be charged for this directory as per the Directory Service pricing terms.

To delete empty directories, see Delete the Directory for Your WorkSpaces. If you delete your Simple AD or AD Connector directory, you can always create a new one when you want to start using WorkSpaces again.

See also: AWS API Documentation

Request Syntax

response = client.terminate_workspaces(
    TerminateWorkspaceRequests=[
        {
            'WorkspaceId': 'string'
        },
    ]
)
Parameters:

TerminateWorkspaceRequests (list) –

[REQUIRED]

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

  • (dict) –

    Describes the information used to terminate a WorkSpace.

    • WorkspaceId (string) – [REQUIRED]

      The identifier of the WorkSpace.

Return type:

dict

Returns:

Response Syntax

{
    'FailedRequests': [
        {
            'WorkspaceId': 'string',
            'ErrorCode': 'string',
            'ErrorMessage': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • FailedRequests (list) –

      Information about the WorkSpaces that could not be terminated.

      • (dict) –

        Describes a WorkSpace that could not be rebooted. ( RebootWorkspaces), rebuilt ( RebuildWorkspaces), restored ( RestoreWorkspace), terminated ( TerminateWorkspaces), started ( StartWorkspaces), or stopped ( StopWorkspaces).

        • WorkspaceId (string) –

          The identifier of the WorkSpace.

        • ErrorCode (string) –

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

        • ErrorMessage (string) –

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