cd /news/artificial-intelligence/using-crewai-and-amazon-bedrock-to-c… · home topics artificial-intelligence article
[ARTICLE · art-124844] src=promptcube3.com ↗ pub= topic=artificial-intelligence verified=true sentiment=· neutral

Using CrewAI and Amazon Bedrock to cut my AWS bill by 40% worked, but it's not a magic

A developer reports cutting an AWS bill by 40% using CrewAI and Amazon Bedrock, finding $125/month in savings on a $300 bill by killing 2023 snapshots and migrating gp2 to gp3 volumes. The multi-agent setup with Scanner, Optimizer, and Report Writer roles took about 4 hours to build and runs in roughly 60 seconds, but the author cautions it is not a magic solution, citing IAM permission issues, token overflow, and the cost of running agents.

by read3 min views1 publishedSep 9, 2026
Using CrewAI and Amazon Bedrock to cut my AWS bill by 40% worked, but it's not a magic
Image: Promptcube3 (auto-discovered)

Why Trusted Advisor and Compute Optimizer aren't enough #

I'm skeptical of "all-in-one" dashboards because they usually miss the granular stuff. AWS Trusted Advisor's free tier only hits 7 checks, often ignoring gp2 to gp3 migration opportunities or specific orphaned snapshots. Compute Optimizer is too narrow, focusing on EC2 and Lambda while ignoring the "silent killers" like unattached Elastic IPs that burn $3.60/month each. I needed a system that didn't just show me a graph of spending but gave me a specific list of resource IDs to terminate.

The multi-agent architecture #

I initially tried a single-prompt approach, but it was a disaster. The LLM started hallucinating resource IDs because it was trying to handle the API data and the analysis simultaneously. Splitting the logic into three distinct roles solved the hallucination problem.

  • The Scanner: Uses boto3 to pull raw facts on EC2, EBS, EIPs, and S3. It does zero reasoning; it just fetches data.
  • The Optimizer: Takes the raw list and flags the waste. It looks for volumes without attachments and compares current instance types against potential Reserved Instance savings.
  • The Report Writer: Converts the technical findings into a markdown list sorted by dollar impact and risk level.

Implementation details and the custom tool #

The core of this is a custom tool that wraps boto3. Without a strictly defined tool, the agents try to "guess" what's in your account.

from crewai import Agent, Task, Crew, Process
from crewai.tools import BaseTool
import boto3

class AWSScannerTool(BaseTool):
    name: str = "aws_resource_scanner"
    description: str = "Scans AWS account for idle resources and cost leaks."

    def _run(self, query: str):
        ec2 = boto3.client('ec2')
        volumes = ec2.describe_volumes(Filters=[{'Name': 'status', 'Values': ['available']}])
        return volumes['Volumes']

from crewai import LLM
bedrock_llm = LLM(model="bedrock/amazon.nova-pro-v1:0")

Where this broke and the "gotchas" #

It isn't all smooth sailing. Here is what actually happened during the build:

  • IAM Permission Hell: If you don't attach the correct IAM role to the EC2 instance running the crew, the Scanner agent will fail withClientError: An error occurred (UnauthorizedOperation) . You need a policy that allowsdescribe calls across all relevant services.
  • Token Overflow: If you have hundreds of resources, the raw JSON from boto3 will blow out your context window. I had to implement a filtering layer in theAWSScannerTool to only send "available" or "idle" resources to the Optimizer, rather than the entire inventory.
  • Cost of Running: While it saves money, running these agents isn't free. Depending on the volume of resources scanned, the Bedrock tokens can add up if you cron this hourly. Weekly is the sweet spot.

Performance breakdown #

  • Setup time: About 4 hours to get the boto3 tools stable.
  • Execution time: Roughly 60 seconds to scan and report.
  • Actual Savings: $125/month found in a $300 bill (mostly by killing snapshots from 2023 and moving gp2 to gp3).

Next AlphaGenome Atlas is mapping 3 billion base pairs to predict DNA →

these real-world AI monetization case studies, with plenty of directly applicable cases.

All Replies (4) #

Doubtful. I’ve seen too many "automated" tools hallucinate costs. Does this actually integrate with CloudHealth or just a custom script?

I want to try this tonight. Did you use the Claude 3.5 Sonnet model or something cheaper for the agent logic?

I'm curious if you factored in the data transfer costs. I'm seeing a weird spike with Terraform...

── more in #artificial-intelligence 4 stories · sorted by recency
── more on @crewai 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
Live at https://your-agent.zahid.host
Get free account → Pricing
from €0/mo · no card required
LIVE [news/using-crewai-and-ama…] indexed:0 read:3min 2026-09-09 ·