Implementation considerations - WorkSpaces Cost Optimizer

Implementation considerations

Dry run mode

We recommend that you run this solution in the dry run mode for a few months, review the daily and monthly reports, and manually implement any desired changes. This provides insight into how the recommended changes may affect your WorkSpaces costs and allows you to evaluate and analyze solution’s recommendations. When you are comfortable with the recommendations provided by the solution and would like these recommendations to be automatically implemented, change the template parameter Dry Run Mode to No. The solution will then begin to automatically implement future changes based on the recommendations provided in its daily and monthly reports.

Billing model conversion

Hourly to monthly

This solution will calculate the hourly WorkSpace usage for each WorkSpace once per day, just before midnight GMT. Note that the calculation includes that day’s usage. When the Dry Run Mode parameter is set to No, the solution will automatically convert individual WorkSpaces from an hourly billing model to a monthly billing model, if the WorkSpace exceeds an hourly usage threshold for that particular WorkSpace type.

By default, the threshold is set close to the hourly and monthly billing break-even point. But, you can use the solution’s AWS CloudFormation template parameters to change the threshold for when each WorkSpace converts from hourly to monthly billing.

Because the solution cannot convert WorkSpaces before the calculation at midnight, the default configuration may result in some WorkSpaces exceeding the threshold for up to 24 hours. For example, the default threshold for a Standard instance is set to 85. If, at midnight on Monday, your usage is 84, the WorkSpace will not be converted to monthly billing. If usage exceeds 85 after midnight on Monday, the WorkSpace will not be converted until the calculation at midnight on Tuesday.

We recommend carefully monitoring your usage using dry run mode and adjusting the threshold to meet your needs. If several of your WorkSpaces consistently exceed the threshold before being converted, consider lowering the threshold. If several of your WorkSpaces are prematurely converted before exceeding the threshold, consider raising the threshold.

Once the solution converts a WorkSpace from hourly billing to monthly billing, the solution will not convert the WorkSpace back to hourly billing until the beginning of the next month, if usage was below the monthly usage threshold. However, you can manually change the billing model at any time using the AWS Management Console.

Monthly to hourly

The solution converts a WorkSpace to monthly or hourly billing model at the end of the month, depending on the WorkSpace utilization for the given month. If WorkSpace utilization exceeds the usage threshold, the billing model changes to monthly. If WorkSpace utilization was lesser than or equal to usage threshold, the model changes to hourly. To prevent WorkSpaces from being converted multiple times in a month, usage for monthly WorkSpaces is calculated at the end of the month. For customers who want to convert WorkSpaces from monthly billing to hourly billing immediately, the solution’s AWS CloudFormation template includes a parameter (Simulate End of Month) that will run these conversions at the time of deployment.

Opting out with tags

To prevent the solution from converting a WorkSpace between billing models, you can apply a resource tag to the WorkSpace using the tag key Skip_Convert and any tag value. This solution will log tagged WorkSpaces, but it will not convert the tagged WorkSpaces. Remove the tag at any time to resume automatic conversion for that WorkSpace.

Opting in Regions

This solution provides the List of AWS Regions input parameter, which specifies the AWS Regions monitored by the solution. You can provide a comma separated list of AWS Regions that you want to monitor. If this input parameter is left blank, the solution will default to monitoring WorkSpaces in all the AWS Regions for the account.

Modifying workspace properties

This solution uses the Describe_Workspaces API call to calculate the idle timeout for a Workspace. This value is a point in time and does not provide historical data for the idle time. If you change the idle timeout for a Workspace in the middle of a month, the billable hours will use the new idle timeout and apply it for the entire month. For this reason, the billable hours calculated by the solution will not match the billable hours charged by the Workspace service. This solution uses the new idle timeout value and calculate correct billable hours from the following month. You can skip the Workspace processing for the current month by adding a Skip_Convert tag to the Workspace.

Deployment in an existing VPC

This solutions creates a new VPC to run the ECS task. You can also deploy the solution in an existing VPC by providing the subnet IDs and security group ID as part of the input parameters to the CloudFormation template. To run this solution in an existing VPC, the ECS task needs to run in a public subnet, or a private subnet with a route to the internet. This route is necessary because the ECS task pulls the Docker image hosted in a public Amazon ECR repository. The security group used to run the ECS task allows you to pull this image from ECR repository.

Calculation of maintenance hours

If you run your patches or other maintenance scripts by changing the workspaces to ALWAYS_ON mode, you will need to account for the ALWAYS_ON hours and adjust the threshold values in the CloudFormation template accordingly. For example, if you change the mode from AUTO_STOP to ALWAYS_ON for 10 hours to run the maintenance scripts, you should subtract 10 hours from the set threshold value in the CloudFormation template.

Terminate unused WorkSpaces


Be aware that opting into this feature terminates unused WorkSpaces and can cause changes to your existing CloudFormation stack. Changes to existing CloudFormation resources might cause a drift between the resource state and its definition in the stack. Ensure that these changes do not impact your existing resources and applications before opting into this feature.

The solution allows you terminate unused workspaces permanently. The solution provides three options for this feature: Yes, No, and Dry Run. By default, the option is turned off. You can opt into this feature by selecting Yes for the TerminateUnusedWorkspaces input parameter. If opted in, the solution will identify all the WorkSpaces not used during the month based on the the last known user connection timestamp. The solution will only terminate the WorkSpace if:

  • The WorkSpace is available on the first day of the month

  • The Launch in Dry Run Mode input parameter is set to No

  • The billable hours for the WorkSpace is zero

  • There are no skip tags on the WorkSpaces

When you select Dry Run for the TerminateUnusedWorkspaces input parameter, the solution checks for all the conditions for a WorkSpace to be terminated and update the report, but will not execute the terminate action. We recommend runing this feature in Dry Run mode for the first few months and checking the monthly reports to review which WorkSpaces are marked for termination.

This check for terminating unused WorkSpaces will run only on the last day of the month. If the WorkSpace was terminated because it met all the above criteria, the monthly report will show Yes as the value in the WorkSpace Terminated column. In Dry Run mode, the monthly report will show Yes-Dry Run for the workspace that met all the criteria mentioned above.

Regional deployment

You must launch the WorkSpaces Cost Optimizer solution in an AWS Region that supports AWS Lambda, WorkSpaces, and AWS Fargate services. However, once deployed, this solution will monitor the WorkSpaces in any AWS Region. You must launch this solution in the same account as the WorkSpaces you want to monitor.

For the most current availability by Region, refer to AWS service offerigns by Region.