Amazon WorkSpaces Activities are available for Public Preview

Description

UiPath.AmazonWorkSpaces.Activities package offers activities for Amazon WorkSpaces. Amazon WorkSpaces is a Desktop-as-a-Service (DaaS) solution that can be used to provision Windows or Linux cloud-based virtual desktops. For more details, check Fully Managed VDI – Amazon WorkSpaces Family – Amazon Web Services and Amazon WorkSpaces FAQs | Persistent Desktop Virtualization.

This set of activities enables IT Departments to easily automate processes related to provisioning, management, and maintenance of Amazon WorkSpaces. These activities can be used to automate tasks like:

  • On-boarding - provision a WorkSpace for a new employee or a student. Examples:
    • In training organizations or in an academic environment, WorkSpaces can be provisioned for students to access the resources they need during a course/semester.
    • In companies, WorkSpaces can be provisioned for software developers. The source code they create is not stored on any developer’s device, allowing to keep intellectual property safe.
  • Off-boarding - remove a WorkSpace when an employee leaves the company or when a student finishes a course/semester.
  • Cost-optimization :
    • Remove unused WorkSpaces: remove WorkSpaces that have not been used within the past N days.
    • Stop WorkSpaces that have ConnectionState = DISCONNECTED.
  • Manage WorkSpaces :
    • Start, reboot, or stop a Workspace.
    • Modify a WorkSpace: resize the root volume or user volume, change the compute type, modify running mode, add tags, etc.
    • Migrate a WorkSpace to a new bundle type.
    • Create a report about all WorkSpaces in an AWS Directory Service directory.

Activities list

Desktop and App Virtualization > Amazon WorkSpaces

Amazon Workspaces Scope Connects to Amazon Web Services (AWS) and provides a scope for Amazon WorkSpaces activities.

Create Workspace – Creates a new WorkSpace.
Update Workspace – Updates a WorkSpace.

Get Workspace Info – Gets details about a specified WorkSpace.
For Each Workspace – Performs an activity or a series of activities on each WorkSpace matching the filter criteria.

Remove Workspace – Removes a WorkSpace. Its user will be disconnected from the WorkSpace and the WorkSpace will be permanently removed.
Start Workspace – Starts a WorkSpace.
Stop Workspace – Stops a WorkSpace.
Reboot Workspace – Reboots a WorkSpace.
Restore Workspace – Restores a WorkSpace to its last known healthy state.
Rebuild Workspace – Rebuilds a WorkSpace.
Migrate Workspace – Migrates a WorkSpace to a new bundle while retaining the data on the user volume disk.

How to install

UiPath.AmazonWorkSpaces.Activities package is available in preview on the Official feed, as a prerelease. In the Official feed, check ‘Include Prerelease’, search for “UiPath.AmazonWorkSpaces.Activities” and install it.
:exclamation:Important - We must reiterate, make sure you check the ‘Include Prerelease’ checkbox :blush:

Amazon WorkSpaces activities should be visible now in UiPath Studio, as shown below:

How to use: Provision and Manage Amazon WorkSpaces

This sample UiPath Studio project shows how to use Amazon WorkSpaces activities to automate provisioning and cost savings tasks. It contains two workflows:

  • Create_Workspace.xaml – provisions a new WorkSpace for a given directory user:
    • Prepare the tags to be associated with the WorkSpace, including a tag with key=CreationDate – to store the creation date info, because Amazon WorkSpaces API does not provide this value.
    • Provision the WorkSpace by specifying the bundle, directory, username, running mode, tags, etc.
  • Manage_Workspaces.xaml – performs IT management tasks for the WorkSpaces in a specified directory:
    • Identify and reboot unhealthy WorkSpaces.
    • Stop WorkSpaces that are available, but in disconnected state (cost optimization).
    • Identify unused WorkSpaces and based on an inactivity period, take one of these actions:
      • Send a warning email to the user.
      • Permanently remove the WorkSpace (cost optimization).

The sample project: Amazon_WorkSpaces_Sample_Forum.zip (44.5 KB)

Let us go step by step through the process of creating Manage_Workspaces.xaml workflow:

  1. :calling: Connect to AWS: add an Amazon Workspace Scope activity to connect to AWS and provide a scope for the Amazon WorkSpaces activities. Specify either Access Keys (i.e., AccessKeyId & SecretAccessKey) or an IAMRole (when the robot is running within an EC2 instance). In this workflow, I am connecting using Access Keys. For more details about creating an AWS secret key, please read this article: Create an AWS access key

  2. :palms_up_together: Retrieve all WorkSpaces in a specified directory: use For Each Workspace activity with FilterBy = ‘DirectoryId’ and provide your directory ID in FilterValue property. This activity supports filtering by DirectoryId, BundleId, and WorkspaceIds.

    For each WorkSpace matching the filter criteria, let’s check if one of the actions below should be performed:

    2.1. :face_with_head_bandage: Reboot an unhealthy WorkSpace : If the state of the WorkSpace is AWRKSState.UNHEALTHY, reboot the WorkSpace by using Reboot Workspace activity. Since this activity can take a long time, it is recommended to set the value of the WaitForCompletion property to False.

    2.2. :stopwatch: :stop_button: Stop a WorkSpace that is disconnected since more than 30 minutes : If the WorkSpace’s running mode is AutoStop and the user is disconnected since more than MinutesSinceDisconnected minutes, stop it by calling Stop Workspace activity with WaitForCompletion = False.

    2.3. :stopwatch: :email: Send a warning email to the user if s/he has not used the WorkSpace in the past 30 days : If the WorkSpace was not used in the past InactivityPeriodBeforeWarning days, the user will receive an email saying the WorkSpace will be permanently removed in 7 days, i.e. InactivityPeriodBeforeRemoving - InactivityPeriodBeforeWarning = 37 – 30 = 7. Use Send Outlook Mail Message activity to send the warning email.

    2.3.2 Send Mail

    In addition, to keep a record of the admin action performed, add a tag / tags to the WorkSpace. Use Update Workspace activity to add such tags.

    2.3.4 Tags

    2.4. :stopwatch: :x: Permanently remove a WorkSpace that has not been used in the last 37 days: If the WorkSpace was not used in the past InactivityPeriodBeforeRemoving days, it will be terminated. For this action, use Remove Workspace activity with WaitForCompletion = False.

    2.5. :stopwatch: :x: Permanently remove a WorkSpace that has never been used since its creation happening more than 37 days ago: This situation can be checked only when WorkSpace.LastKnownUserConnectionTimestamp = new DateTime() (i.e. never used) and the WorkSpace has a tag that stores the creation date (because Amazon WorkSpaces API does not provide this value). If the WorkSpace was never used and creationDate <= Today.Date.AddDays(-InactivityPeriodBeforeRemoving), it will be permanently removed.

That’s all folks :blush:! Take a look :eyes: at these activities that will help automate :robot: your Amazon WorkSpaces tasks.

Please give us feedback and suggest improvements :writing_hand:.

7 Likes