In this blog post, we'll dive into Steampipe, an open-source CLI tool that simplifies discovering AWS resources for cost optimization. The goal is to have the most cost-effective infrastructure without sacrificing performance. Steampipe allows you to quickly find resources you can target for cost savings, leveraging the familiarity and flexibility of SQL.
Steampipe: Empowering Cloud Infrastructure Management with SQL
Steampipe is an innovative tool that allows you to query your AWS resources using SQL, making identifying and managing your cloud infrastructure more straightforward. Using Steampipe, you can quickly find unutilized or underutilized resources, such as EC2 instances, EBS volumes, and RDS databases, which are prime targets for cost optimization.
Uncovering Cost-Saving Opportunities with Steampipe
Finding resources to target cost savings using Steampipe is straightforward. Here are some examples of SQL queries that can help you identify potential cost-saving opportunities, along with an example of how much money each action might save per year:
1.Find Unused EC2 Instances:
SELECT instance_id, instance_state, instance_type
FROM aws_ec2_instance
WHERE instance_state = 'stopped';
Example savings: Terminating a stopped t3.medium instance could save around $360 per year, depending on the region and other factors.
2.Locate Unattached EBS Volumes:
SELECT volume_id, size, state
FROM aws_ebs_volume
WHERE state = 'available';
Example savings: Deleting a 100 GB unattached gp2 EBS volume might save about $120 per year, depending on the region and other factors.
3.Identify Idle RDS Instances:
SELECT db_instance_identifier, engine, db_instance_status
FROM aws_rds_db_instance
WHERE db_instance_status = 'stopped';
Example savings: Stopping a db.t3.medium RDS instance for a full year could save approximately $1,080 per year, depending on the region and other factors.
4.Discover Underutilized EC2 Instances:
SELECT instance_id, instance_type, cpu_credit_usage
FROM aws_ec2_instance_metric_cpu_credit_usage
WHERE cpu_credit_usage < [YOUR_THRESHOLD];
Example savings: Downgrading an underutilized m5.large instance to a t3.small instance might save you around $648 per year, depending on the region and other factors.
Taking Action for Cost Optimization
Once you've identified unutilized and underutilized resources using Steampipe, it's time to take action. Depending on your specific needs, you might consider the following:
Terminating or stopping unused EC2 instances and RDS databases
Deleting unattached EBS volumes
Resizing underutilized EC2 instances and RDS databases to match resource needs better
By taking these actions, you can save significant costs while maintaining a robust and efficient cloud infrastructure.
Conclusion
Steampipe is a powerful tool that simplifies identifying cost-saving opportunities within your AWS infrastructure. By leveraging the power of SQL, Steampipe enables you to quickly find unutilized and underutilized resources and take action to optimize costs. Start using Steampipe today and unlock the potential for substantial cost savings in your AWS environment.