Amazon WorkSpaces is a fully managed, secure Desktop-as-a-Service (DaaS) solution which runs on AWS. With Amazon WorkSpaces, you can easily provision virtual, cloud-based Microsoft Windows desktops for your users, providing them access to the documents, applications, and resources they need, anywhere, anytime, from any supported device. Amazon WorkSpaces offers the flexibility to pay hourly or monthly without any up-front commitment.

To help customers with unpredictable WorkSpace usage patterns monitor their Amazon WorkSpaces usage and optimize costs, AWS offers the Amazon WorkSpaces Cost Optimizer, a solution that analyzes all of your WorkSpace usage data and automatically converts the WorkSpace to the most cost-effective billing option (hourly or monthly) depending on the user's individual usage. This solution is easy to deploy and uses AWS CloudFormation to automatically provision and configure the necessary AWS services.

The following section assumes basic knowledge of architecting on the AWS Cloud, virtual desktops and Amazon WorkSpaces.

AWS offers a solution that automatically converts WorkSpaces to the most cost-effective billing option (hourly or monthly) depending on a user's individual usage . The diagram below presents the Amazon WorkSpaces Cost Optimizer architecture you can automatically deploy using the solution’s implementation guide and accompanying AWS CloudFormation template.

  1. This solution deploys an Amazon CloudWatch event that invokes an AWS Lambda function every 24 hours.
  2. The Lambda function polls AWS Directory Service to gather a list of all directories registered for Amazon WorkSpaces in a specific AWS Region.
  3. Another Lambda function checks each WorkSpace for total usage for the month and converts the WorkSpace to the most efficient billing model depending on usage.
  4. Amazon Simple Storage Service (Amazon S3) stores a log file with the conversions.
Deploy Solution
Implementation Guide

What you'll accomplish:

Deploy the Amazon WorkSpace Cost Optimizer using AWS CloudFormation. The CloudFormation template will automatically launch and configure the components necessary to monitor your Amazon WorkSpaces usage and convert the WorkSpaces to the most cost-effective billing model.

Automatically convert your WorkSpaces billing model with Amazon CloudWatch and AWS Lambda. Amazon S3 stores a log of the conversions.

What you'll need before starting:

An AWS account: You will need an AWS account to begin provisioning resources. Sign up for AWS.

Skill level: This solution is intended for IT infrastructure and networking professionals who have practical experience with Amazon WorkSpaces and architecting on the AWS Cloud.

Q: Can I prevent Amazon WorkSpaces Cost Optimizer from automatically converting a WorkSpace?

Yes. By default, the solution automatically analyzes and converts all WorkSpaces in an AWS Region. However, you can apply a resource tag to individual WorkSpaces to exclude them from automatic conversions.

Q: When does the solution convert a user to a different billing model?

Hourly WorkSpace usage is calculated once per day, just before midnight GMT. If the WorkSpace exceeds the hourly usage threshold, the solution will convert the WorkSpace from hourly to monthly billing. If usage exceeds the threshold after the nightly calculation, the WorkSpace will not be converted until usage is calculated the following night.

If a WorkSpace starts in monthly billing or the solution converts a WorkSpace from hourly to monthly billing, the solution will not convert the WorkSpace to hourly billing until the beginning of the next month, if monthly usage was below the threshold. However, you can manually change the billing model at any time using the Amazon WorkSpaces console. For customers who want to change the threshold for when each Workspace converts from hourly to monthly billing, the solution’s AWS CloudFormation template includes parameters that will execute these conversions.  

If you manually change the billing model for an individual WorkSpace, apply a resource tag to the WorkSpace to prevent the solution from automatically converting the WorkSpace back.

Q: Can I deploy the WorkSpaces Cost Optimizer solution in any AWS Region?

You must launch the Amazon WorkSpaces Cost Optimizer solution in an AWS Region that supports both the AWS Lambda and Amazon WorkSpaces services. However, once deployed, the Lambda function will monitor the Workspaces in any AWS Region.

Need more resources to get started with AWS? Visit the Getting Started Resource Center to find tutorials, projects and videos to get started with AWS.

Tell us what you think