Skip to main content
INS // Insights

CodeBuild minutes off failed and idle fleets

Updated November 2026 · 7 min read

Rutagon takes CodeBuild minutes off the pipeline bill for a team whose failed builds and idle reserved fleets are still metered after the compile has stopped mattering. AWS CodeBuild build minute cost is that meter: minutes a build ran, including builds that failed, and minutes a reserved fleet stayed up while idle.

Book a technical call

AWS CodeBuild build minute cost

CodeBuild bills build time. An on-demand build accrues minutes for as long as it runs, and a failed build runs until it fails. The failure does not void the minutes. A reserved capacity fleet accrues for the capacity you are holding, including minutes when no build is running. Those are the two shapes of the same service's build-minute cost. Lambda duration is a different meter on a different service. A function that finishes a deploy hook in milliseconds is not this bill, even if the pipeline invokes it.

The service is described in the AWS CodeBuild documentation. We read the bill by account and region, then the projects and fleets that produced the minutes. Each project gets a window you choose: minutes spent in failed builds, minutes spent in successful builds, and, for a reserved fleet, minutes the fleet was reserved. The scorecard does not sum those into one number and call it waste. Failed minutes and idle fleet minutes are the cuts. Successful minutes on a project you still need are a keep, unless the project runs more often than anyone uses the artifact.

Lambda cost is the neighboring meter we refuse to mix in. If the bill you care about is Lambda duration, this is the wrong engagement, and we will say so before anyone edits a buildspec. Cloud cost optimization is the wider practice. This delivery is specifically CodeBuild minutes from failures and idle fleets. AWS cloud infrastructure is the lane. Rutagon does the readout from Alaska against the payer account and the member accounts where the projects live.

A project that fails, retries, and fails again can multiply minutes before a human looks. The retry count is part of the inventory. We do not celebrate a green dashboard that hides ten paid failures overnight. The minutes are the fact.

What we stop

Failed builds that retry a broken test are stopped at the source of the failure or at the retry. If the test is wrong, we fix the test or we stop the schedule that runs it. If the dependency download fails because a registry is blocked, we fix the download once, not by paying for another twenty failures. The engagement includes that fix when it is inside the build project you authorize. It does not include rewriting the application under test.

Idle reserved fleets are scaled to the concurrency you actually run, or they are removed when on-demand minutes would be cheaper for the pattern you have. We compute that comparison from your own minutes, not from a generic slogan. A fleet that sits at a high reserved size because a launch week required it, and that launch week is over, comes down. A fleet that is full whenever developers are working stays. The idle minutes are the gap between reserved capacity and builds that used it.

project: account, region, and name
compute: on-demand or reserved fleet
minutes_failed: build time in failed builds
minutes_succeeded: build time in successful builds
minutes_idle: reserved time with no build, or zero
action: stop the retry, shrink the fleet, or keep

Schedules that run a build nobody consumes are turned off. A nightly build whose artifact has no downstream deploy and no reader is a failed purpose even when the build succeeds. We treat its minutes as a cut only when you confirm nobody needs the artifact. Confirmation is a name. Silence keeps the schedule until the owner answers, and the scorecard shows the unanswered schedule as still billing.

We change the pipeline definition in the repository that creates the project, not only the console. A fleet size edited in the console and restored by a template on the next apply is not a saving. The template is in scope when you authorize the repository. A template we cannot touch is named, and the console change is not called finished.

What we leave alone

Successful builds that produce an artifact you deploy are not a target. We will not slow the compiler down or remove tests that catch failures you care about. A shorter failure is a win. A missing test that lets a bad artifact through is not a cost win we will take.

We will not move the workload onto Lambda and report CodeBuild minutes as saved while Lambda duration appears elsewhere, unless you separately ask for that move. The default delivery keeps CodeBuild and removes the minutes that are failures and idle capacity. A compute-type change, smaller builders for a project that never uses the larger ones, is in scope when the build still succeeds. We verify a successful build on the smaller type before we call the minutes saved. A build that only passes because we skipped the step that needed memory is not verified.

Pull-request builds that fail because contributors push broken branches are a policy choice. We can stop retries. We do not close your pull-request practice. The minutes from a single failed attempt can be acceptable. The minutes from five automatic retries are the cut.

Cache and image choices matter only when they change minutes you are paying. We do not spend the engagement on a cache for a project whose minutes are already a keep. A project whose failures are timeouts pulling dependencies is the one where a local cache or a mirror is the fix. The fix is measured by failed minutes going down on the next window.

The handover is the inventory, the projects changed, the fleet sizes now set, the schedules removed, and the following bill with CodeBuild build minutes down by the failed and idle portion we cut. On a production SaaS platform a pipeline was finished when the useless run stopped, not when a report described it. The same bar applies here.

How a failure stops repeating

We add a cap on retries you agree to, inside the project, so a red build stops instead of spending the night. The cap is a number in the project, not a hope. Alerting the owner on the first failure is included when you already have a place those alerts go. We do not invent a new paging product. If nobody is subscribed, the cap still stops the minutes, and the scorecard says the alert had no destination.

A reserved fleet's idle time is reviewed against the hours you actually build. A fleet held around the clock for a team that builds during a workday is a candidate to shrink outside that day only if the product supports a schedule you are willing to own. If it does not, the cut is a smaller reserved size, not a fictional calendar. We will not claim idle minutes disappeared because we wished the fleet slept.

Queued builds behind a stuck fleet are called out. A fleet that is idle in the metric and queued in the project is not idle. We read both before we shrink it. Shrinking a fleet that is actually blocked is how you buy a longer queue. The action then is to clear the stuck build, which is a failed-minute problem, not a shrink.

Frequently Asked Questions

Do failed builds still cost build minutes?

Yes. The minutes run until the build stops, and a failure does not erase them. Retries multiply the minutes. This engagement stops the retry loop or fixes the failure inside the project you authorize, and it does not void minutes already billed.

Is a reserved fleet billed when no build is running?

Yes. Reserved capacity is held whether or not a build is in progress. Idle minutes are the gap between what you reserved and what builds used. We shrink or remove that idle capacity when your own history supports it.

Will you cut Lambda duration in the same engagement?

No. Lambda duration is a different meter. We do not report a Lambda change as CodeBuild savings. If the bill you mean is Lambda, we will say so and this is not the scope.

Do you turn off successful builds we still deploy?

No. Successful minutes for an artifact you use are a keep. We turn off a schedule only when you confirm the artifact has no consumer. Unanswered schedules stay up and stay visible on the scorecard.

What if a template puts the fleet size back?

Then the console edit is not finished. We change the template in the repository you authorize as part of the same engagement. A template we cannot edit is named, and we do not call that fleet saved.

Book a technical call. 907-841-8407. contact@rutagon.com.