Cost Optimization: EC2 Right Sizing
Cost Optimization: EC2 Right Sizing

Architecture Overview

Deploying this solution with the default parameters builds the following environment in the AWS Cloud.

        EC2 Right Sizing Architecture

Figure 1: EC2 Right Sizing solution architecture on AWS

This solution uses AWS CloudFormation to deploy AWS resources and Python code to provide a right-sizing analysis for all Amazon EC2 instances in a customer account. The AWS CloudFormation template launches a two-node Amazon Redshift cluster, using dc1.large node types. The solution also deploys an Amazon EC2 instance in an Amazon Virtual Private Cloud (Amazon VPC) network. The instance hosts a sequence of Python scripts that collect utilization data from Amazon CloudWatch and then run a custom query in a temporary Amazon Redshift cluster to produce the right-sizing analysis. Both the raw CloudWatch data and the analysis (CSV format) are stored in an Amazon S3 bucket. Users have the option to automatically terminate the Amazon EC2 instance and Amazon Redshift cluster after the analysis is delivered to reduce ongoing cost. After downloading the analysis from Amazon S3, users can then manually delete the AWS CloudFormation stack.

As mentioned in the Cost section, this solution is designed for temporary deployment in a customer’s account. Customers can deploy this solution every two weeks for continuous monitoring, or whenever they want to analyze their Amazon EC2 sizing.