Your Guide to AWS Cost Optimization: Saving Money in the Cloud

Shrihari Haridas

--

In today’s blog, I am focusing more on cloud optimization in AWS. In the cloud world, one of the biggest challenges is cost management. If resources are not managed properly, costs can increase rapidly, directly impacting your budget. In this blog, I will provide an overall introduction, and in upcoming blogs, we will focus on individual cost optimization strategies and services. For today, we will take an overview of two services: AWS Cost Explorer and S3 Storage Lens. Feel free to share your suggestions in the comments!

Introduction to AWS Cloud Cost Optimization

AWS Cloud Cost Optimization is all about managing your cloud expenses wisely to avoid overspending. Think of it like budgeting for your household — you track your expenses, find where you’re overspending, and adjust to save money.

In the cloud, costs can quickly spiral out of control if you don’t manage resources efficiently. For example, leaving unused servers running or using more storage than needed can rack up your bills. AWS provides tools and best practices to help you identify unnecessary expenses, right-size your resources, and pay only for what you actually use.

By optimizing costs, you can save money while still getting the performance and reliability you need. It’s a smart way to make the most of your cloud investment without breaking the bank.

  1. Go to the AWS Console, search for the AWS Cloud Optimizer service, and click to open it.

2. You can read more about this service later. For now, click on Get Started. Since we are setting it up for the first time, proceed by clicking Get Started.

3. You will then see two options:

  1. All member accounts in this organization
  2. Only this account

I am choosing the second option because this is a personal account. If you are setting this up for an organization, you can select the first option.

All Member Accounts in This Organization

This option is designed for users managing AWS Organizations. It enables you to apply cost optimization settings and analyze usage across all accounts under your organization.

Use Case:

  • When you have multiple AWS accounts under a single AWS Organization.
  • You want centralized cost monitoring and optimization for all member accounts.
  • Ideal for businesses or enterprises where multiple teams or departments use different AWS accounts.

Benefits:

  • Centralized cost management across the entire organization.
  • Easier to identify areas where costs can be reduced at a global level.

Only This Account

This option applies cost optimization settings to the current account only, without including any member accounts.

Use Case:

  • When you are managing a single AWS account (e.g., for personal projects or small-scale usage).
  • You do not have AWS Organizations set up, or you only care about this specific account.

Benefits:

  • Simpler setup for individual accounts.
  • Focused cost management tailored to this single account’s needs.

4. For this setup, I am using Only This Account. Depending on your use case, you can choose the appropriate option.

5. On the next page, you will see the dashboard. Since we just created it, give it some time to capture the data. Once the data is collected, the dashboard will provide metrics and guidelines on where you can reduce costs.

As of now, I cannot see any data. You may need to wait at least 12 hours for the data to appear. In the first picture below, you can see there is no data, while in the second picture, data is visible.

6. The AWS Cloud Optimizer Dashboard provides a comprehensive view of cost optimization opportunities across various services. Here’s an overview of the key options available in the dashboard:

1. Rightsizing Recommendations

This section helps you identify resources that are either underutilized or over-provisioned.

What it does:

  • Suggests resizing or reconfiguring instances and services to better match workloads.
  • Helps reduce costs by ensuring you only pay for what you need.
  • Applicable to: EC2 instances, RDS DBs, and other scalable resources.
  • Example: If an EC2 instance is only using 10% of its capacity, it might recommend switching to a smaller instance type.

2. EC2 Instances

Provides insights into the usage of Amazon EC2 instances.

What it does:

  • Identifies underutilized instances.
  • Suggests switching to Reserved Instances (RIs) or Savings Plans for consistent workloads.

Benefits:

  • Reduces costs by optimizing instance types and purchase plans.

3. EC2 Auto Scaling Groups

Focuses on cost optimization for EC2 instances in Auto Scaling Groups.

What it does:

  • Analyzes scaling activity and suggests optimal configurations.
  • Helps reduce costs by ensuring the number of instances adjusts dynamically based on actual workload demands.
  • Example: Recommending reducing the minimum or maximum instance count based on usage patterns.

4. EBS Volumes

Provides insights into your Amazon Elastic Block Store (EBS) volumes.

What it does:

  • Identifies idle or underutilized EBS volumes that can be deleted or resized.
  • Suggests moving from General Purpose SSD to Cold HDD for infrequently accessed data.

Benefits:

  • Avoids paying for storage you don’t use or don’t need at high performance levels.

5. Lambda Functions

Focuses on optimizing AWS Lambda usage.

What it does:

  • Identifies functions with low invocation rates or excessive memory allocation.
  • Recommends reducing memory size or re-evaluating idle functions.
  • Example: A function with 512 MB memory but only consuming 128 MB may suggest downsizing to save costs.

6. RDS Databases

Analyzes Amazon RDS database instances for cost optimization.

What it does:

  • Identifies idle or underutilized databases.
  • Recommends scaling down instance sizes or turning on storage auto-scaling.
  • Suggests switching to Reserved Instances for long-term usage.

Benefits:

  • Saves costs by ensuring resources are appropriately scaled.

7. Fargate

Monitors AWS Fargate tasks and container services.

What it does:

  • Identifies underutilized container resources.
  • Suggests optimizing resource configurations to reduce compute and memory costs.
  • Example: Adjusting task definitions to right-size the resource allocation for containers.

8. Idle Resources

Highlights unused or idle resources that contribute to unnecessary costs.

What it does:

  • Identifies instances, volumes, or services that are running but not being actively used.
  • Suggests stopping or terminating idle resources.

Example: A running EC2 instance with no network or CPU activity is flagged as idle.

Benefits:

  • Helps you clean up unused resources, reducing unnecessary spending.

By regularly reviewing and acting on the recommendations provided in these sections, you can significantly reduce your AWS costs and maintain efficient cloud resource usage.

7. This is all about AWS Cost Optimizer. Obviously, this is just an overview of the service. We will discuss it in more detail in upcoming blogs, where we’ll explore specific features and use cases.

Now, let’s move on to S3 Storage Lens.

Introduction to S3 Storage Lens

S3 Storage Lens is a tool from AWS that helps you understand and manage your Amazon S3 storage usage and costs. Think of it as a dashboard that gives you a clear picture of how your storage is being used.

Here’s how it works in simple terms:

  • Tracks Your Storage: It shows you how much data you’re storing in S3 and how it’s being used across different buckets or accounts.
  • Gives Insights: It highlights things like unused files, buckets with low activity, or storage that could be optimized.
  • Helps Save Money: By analyzing the data, you can decide where to delete unused files, move data to cheaper storage classes, or consolidate buckets.
  • Customizable: You can set it up to focus on specific accounts, regions, or buckets based on your needs.

Why Use S3 Storage Lens?

  • Cost Management: Spot areas where you’re overspending and optimize storage costs.
  • Better Organization: Understand how your data is distributed and make it more organized.
  • Actionable Recommendations: Get tips on how to optimize your storage, like moving infrequently accessed files to S3 Glacier.
  • Multi-Account View: If you’re managing multiple AWS accounts, you can see all your storage usage in one place.

How It Helps:

  • Imagine you have a bucket filled with logs that you don’t need anymore — S3 Storage Lens can show you this and suggest cleanup.
  • If you’re storing a lot of rarely accessed data in expensive storage classes, it might suggest moving it to a cheaper option.

In short, S3 Storage Lens is like a storage management expert that helps you save money and keep your S3 data organized.

8. In the AWS Console, search for S3 in the search bar and open the S3 service.

9. On the left-hand side menu, scroll down to the bottom, and you will see the Storage Lens option. Click on Dashboard to access it.

10. There is a default dashboard available, but if you open it and cannot see any data, it means the dashboard hasn’t been fully configured yet or no data is available for analysis.

11. To view the dashboard, you need to log in with an IAM user. The dashboard cannot be accessed using the root user account.

Overview of the S3 Storage Lens Dashboard

The S3 Storage Lens Dashboard provides a centralized view of your S3 storage usage and activity. It displays detailed metrics and insights that help you optimize storage and manage costs effectively. Here’s a breakdown of the key sections of the dashboard:

1. Summary

What It Shows:

  • Total storage size (in GB or TB).
  • Number of objects stored.
  • Average object size.

Purpose:

  • Gives a quick snapshot of your storage usage.

2. Cost Efficiency Metrics

What It Shows:

  • Data stored in different storage classes (e.g., Standard, Glacier).
  • Opportunities for cost savings (e.g., moving infrequently accessed data to cheaper classes).

Purpose:

  • Highlights areas where storage costs can be reduced.

3. Data Protection

What It Shows:

  • Number of unencrypted objects.
  • Buckets without versioning or replication enabled.

Purpose:

  • Ensures data security and compliance with best practices.

4. Access Patterns

What It Shows:

  • Frequency of data access.
  • Read/write request trends.

Purpose:

  • Helps you understand how your data is being used and identify inactive buckets.

5. Activity Metrics

What It Shows:

  • Total requests (e.g., GET, PUT, DELETE).
  • Bandwidth usage.
  • Error rates for requests.

Purpose:

  • Monitors bucket activity and identifies performance issues.

6. Multi-Account Insights (if enabled)

What It Shows:

  • Cross-account data for storage and activity metrics.

Purpose:

  • Ideal for organizations managing multiple AWS accounts.

7. Recommendations (if configured)

What It Shows:

  • Suggestions for reducing costs and improving storage efficiency.

Purpose:

  • Provides actionable steps for optimization.

The dashboard is highly visual, featuring charts, graphs, and summaries to make it easier to understand and analyze your S3 storage usage at a glance. It helps you identify areas for improvement and take action to optimize costs and manage data more effectively.

12. This is all about S3 Storage Lens. In upcoming blogs, we will dive deeper into its features and capabilities, so stay tuned for more insights.

Let me know your thoughts on cost optimization and feel free to share any questions or suggestions you have!

--

--

No responses yet