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

Appendix B: Log Files

By default, Cost Optimization: EC2 Right Sizing launches and automatically terminates Amazon Elastic Compute Cloud (Amazon EC2) and Amazon Redshift resources after the EC2 right-sizing analysis completes. Amazon EC2 instance logs are exported to an Amazon CloudWatch Logs.

The solution creates a log group (cost-optimization-ec2-right-sizing) that contains the instance logs and the following log streams:

  • <instance-id>:cfn-init.log: Logs the output from the AWS CloudFormation instance initialization process

  • <instance-id>:messages: Logs operating system syslog output from /var/log/messages

  • <instance-id>:run-right-sizing-redshift.log: Logs the output from the Amazon EC2 Right Sizing process

  • <instance-id>:deleteandterminate.log: Logs the output from the Terminate Resources process if this AWS CloudFormation parameter is set to Yes

When troubleshooting, check the cfn-init.log log stream to verify that the 0-perform_rightsizing script ran properly:

[DEBUG] Running command 0-perform_rightsizing

Then, check the run-right-sizing-redshift-log log stream for details about the Amazon EC2 right sizing process.

You can also update the solution’s AWS CloudFormation stack and change the Terminate Resources parameter to No. This enables you to log directly into the Amazon EC2 Right Sizing Instance and execute the following command for manual troubleshooting:

python /tmp/run-rightsizing-redshift.py