What does this AWS Solution do?
This solution analyzes all of your Amazon WorkSpaces usage data and automatically converts the WorkSpace to the most cost-effective billing option (hourly or monthly), depending on your individual usage. You can use this solution with a single account, or with AWS Organizations across multiple accounts, to help you monitor your WorkSpace usage and optimize costs.
Benefits
Automatically convert your WorkSpaces to the most cost-effective billing option (hourly or monthly), depending on your individual usage.
Monitor your WorkSpace usage and optimize costs by using AWS CloudFormation to automatically provision and configure the necessary AWS services to convert individual WorkSpaces.
Provide a secure one-click deployment using an AWS CloudFormation template developed with the AWS Well-Architected Framework methodologies.
AWS Solution overview
The diagram below presents the architecture you can automatically deploy using the solution's implementation guide and accompanying AWS CloudFormation template.

Cost Optimizer for Amazon WorkSpaces architecture
Note: This solution includes both a hub account template (deployed first) for a central account to manage the Workspaces and provide a centralized report, and a spoke account template (deployed second) for each WorkSpace account that you want to monitor. The solution generates a report per directory and also an aggregated report with information about WorkSpaces from all the directories combined. Refer to the Implementation Guide to access both templates.
- The spoke template creates a custom resource that invokes an AWS Lambda function to register the account as a spoke account in an Amazon DynamoDB table in the hub account.
- The hub template creates an Amazon EventBridge rule that invokes an Amazon Elastic Container Service (Amazon ECS) task every 24 hours.
- The Amazon ECS task assumes an AWS Identity and Access Management (IAM) role in each spoke account to manage WorkSpaces.
- The Amazon ECS task polls AWS Directory Service to gather a list of all directories registered for Amazon WorkSpaces in a specific AWS Region.
- The task then checks the total usage for each WorkSpace that is on an hourly billing model. If a WorkSpace has met the monthly usage threshold, the solution will convert the individual WorkSpace to monthly billing.
- At the end of the month, the task checks the total usage for each WorkSpace that is on a monthly billing model. If a WorkSpace has not met the monthly usage threshold, the solution will convert the individual WorkSpace from monthly to hourly billing at the start of the next month.
- The task then checks the total usage for each WorkSpace that is on an hourly billing model. If a WorkSpace has met the monthly usage threshold, the solution will convert the individual WorkSpace to monthly billing.
- The Amazon ECS task uploads the results to an Amazon Simple Storage Service (Amazon S3) bucket.
Cost Optimizer for Amazon WorkSpaces
Version 2.5.1
Last updated: 01/2023
Author: AWS
Estimated deployment time: 5 to 15 min
Related content

Browse our library of AWS Solutions to get answers to common architectural problems.

Find AWS Partners to help you get started.

Find prescriptive architectural diagrams, sample code, and technical content for common use cases.