- AWS's new GetUsageLinesEstimatedCost API, released on 20 November, prices "up to 500 usage lines in one request" at no charge, so a pipeline can put a cost on an infrastructure change before it merges.
- Show the engineer your rate after discounts but before commitments. A Savings Plan you already use in full does not cover new capacity, so the commitment-adjusted rate makes new spend look already paid for.
- A mistyped usage type does not fail the call. It lands in the errors list and drops out of the total, so a pipeline that posts the number must fail when that list is not empty.
- Post the monthly difference on the pull request and never the per-unit rates, which are commercially sensitive and readable by everyone with access to the repository.
A cloud FinOps report tells you what last month cost. By the time it reaches the platform team, the change that moved the number has been in production for five weeks, the engineer who made it is on something else, and the conversation is about undoing a decision rather than making one.
On 20 November AWS shipped an API that can price a change while it is still a pull request. It is small and it is free, and it fits in the place where infrastructure decisions are actually made, which no billing report does.
Our position: price only the pull requests that change infrastructure, show the engineer your discounted rate without your commitments, and post the difference, not the rates. In October we wrote about which cost number a FinOps report should use. This is the number that comes before the report.
Why does cloud FinOps only ever see last month?
Because every tool it has reads the bill, and the bill is history. Cost Explorer, budgets, anomaly detection and the optimisation recommendations all start from usage that has already happened. They are good at telling you what went wrong. None of them is in the room when someone changes an instance size in a Terraform file.
So the review happens in the wrong order. An engineer doubles a cluster in a pull request that two colleagues approve on correctness. Nobody asks what it costs, because nobody can answer in the time a review takes. A month later the report flags the increase, and the person asking about it is now arguing with a running system.
The fix is not a better report. It is a number in front of the reviewer.
What does the new AWS pricing calculator API actually price?
Usage lines. The announcement describes GetUsageLinesEstimatedCost as "a new API that returns the estimated cost of a planned workload in a single API call", where "You send up to 500 usage lines in one request and get the cost back right away, without saving an estimate to your account." It is "generally available at no additional charge" everywhere except GovCloud and China.
Each line, per the CLI reference, is a service code, a usage type, an operation, an amount in that usage type's pricing unit, and a short key of up to ten letters or digits that you choose. An EC2 instance is AmazonEC2, a BoxUsage usage type and RunInstances, with hours as the amount. You get back a cost per line, a total, and a list of errors.
The older route was a saved bill estimate in the console. The Pricing Calculator guide says those are "only available to management or standalone account users", with five free a month and $2 each after that. Nobody was going to wire that into CI. A stateless call that a pipeline can make on every infrastructure change is a different tool.
Which rate should an engineer see in the pull request?
AWS gives you three, and the choice matters more than anything else in this post. The API takes BEFORE_DISCOUNTS, AFTER_DISCOUNTS or AFTER_DISCOUNTS_AND_COMMITMENTS, which the announcement describes as "public On-Demand rates, your rates after discounts, or your rates after discounts plus Savings Plans and Reserved Instances."
We would use the middle one. Public rates overstate what you pay if you have a private pricing agreement, and engineers learn to discount a number that is always too high. The commitment-adjusted rate is worse, because it answers the wrong question. A Savings Plan you already use in full does not cover the new capacity in the pull request. Those extra instances run at your discounted on-demand rate until someone buys more commitment, so pricing them at the committed rate makes new spend look as if it were already paid for.
Two constraints may make the choice for you. "You can only use a rate type that your Pricing Calculator rate preferences allow", and the guide says "Management accounts can configure the effective rate type that is available for use by their member accounts." If your accounts sit under a reseller's billing transfer, the CLI reference limits you to BEFORE_DISCOUNTS. That is the same arrangement that can make Cost Explorer show a partner's rate rather than your invoice, which we covered in whether the dashboard matches the invoice.
Where do the usage types come from?
From your own bill, and this is the part that keeps the estimate honest. Usage type strings carry a Region prefix and an exact unit, and guessing them is how an estimate comes back short. Cost Explorer will list the ones you already pay for: get-dimension-values accepts USAGE_TYPE and OPERATION as dimensions, with a search string to narrow them.
Then read the response carefully. The total is defined as "The sum of the estimated costs of all usage lines that were priced." A line with a mistyped usage type does not fail the call. It lands in errors, drops out of the total, and the pull request shows a cheaper change than the one being made. We would rather the job went red than posted that number.
What can it not price?
Anything whose amount you have to guess. Instance hours and volume sizes come straight out of the plan. Data transfer, NAT processing, log ingestion and request counts depend on traffic the plan cannot see, and the API will price whatever amount you invent for them as precisely as it prices the instance. The CLI reference says as much: "It doesn't include taxes, and your actual charges depend on your usage."
Every calculator has this trap. We made the argument for Datadog in which numbers its pricing calculator misses, and it holds here. Price what the change declares, label it as such, and leave the traffic-driven lines to the monthly report, where they belong.
Who should be allowed to call it from CI?
A role that can do one thing. The service authorisation reference lists GetUsageLinesEstimatedCost under the bcm-pricing-calculator prefix, so the pipeline's role needs that action and nothing else from billing. Give it to a role assumed through OIDC, the way we set out the production pipeline in what the first month of DevOps consulting should deliver, and keep it separate from the deploy role.
Then think about who reads the comment. Your discounted rate is commercially sensitive, and a pull request comment is visible to every contractor and partner with access to the repository. Post the monthly difference and the new total, and keep per-unit rates out of it. The difference is the only number the reviewer needs anyway.
Does the FinOps Agent change any of this?
It changes the after-the-fact half, and it brings its own access question. On the same day AWS put Data Hub into preview: "13 months of hourly, resource-level cost and usage data in the published CUR 2.0 schema, including resource identifiers and cost allocation tags", available to the AWS FinOps Agent so it "can identify the individual resources behind a cost change." The agent's sample policy is almost entirely read actions. Useful, and still a report about the past.
The access point is in the Data Hub documentation. An organisation-wide agent reads through a service-linked role, and an SCP that denies Data Hub actions "does not stop an organization-wide agent from reading a dataset, because service control policies do not apply to a service-linked role." If your guardrails are written as SCPs, decide on purpose who may switch this on in the management account. The wider question of what an agent may reach is in what your partner's AI agent can touch.
What can you run on Monday?
Two commands and a policy, in about an hour. Update the AWS CLI first, because the pricing command is new. Then list the EC2 usage types you already pay for:
aws ce get-dimension-values \
--region us-east-1 \
--time-period Start=2026-10-01,End=2026-11-01 \
--dimension USAGE_TYPE --search-string BoxUsage \
--query 'DimensionValues[].Value' --output text
Take a real change, say two instances moving up one size for a full month of 730 hours each, and write it as two files. Copy the usage types from your own output; the ones below only show the shape. before.json:
[{"key": "api", "serviceCode": "AmazonEC2", "operation": "RunInstances",
"usageType": "APS3-BoxUsage:m7g.large", "amount": 1460}]
after.json is the same line with m7g.xlarge. Price both:
for f in before after; do
aws bcm-pricing-calculator get-usage-lines-estimated-cost \
--rate-type AFTER_DISCOUNTS \
--usage file://$f.json \
--query '{total: totalCost, errors: length(errors)}' \
--output json
done
If either result shows errors above zero, fix the usage type before you trust the total. The gap between the two totals is the number for the pull request. Last, the whole policy for the CI role:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": "bcm-pricing-calculator:GetUsageLinesEstimatedCost",
"Resource": "*"
}]
}
When is pricing every pull request a waste of time?
Most of the time, if you really price every one. Application changes rarely move the bill, and a cost comment on each of them teaches people to scroll past it. Run the job only on paths that hold infrastructure code.
Below roughly twenty thousand dollars a month, the threshold we used in the first post, mapping a plan to usage lines costs more attention than it saves. Read the bill monthly and leave CI alone. And if most of your growth is traffic rather than capacity, this API will price the part of the change that was never the problem. We sell this kind of work, so weigh our enthusiasm accordingly.
The short version
Pick the rate type before you write any code: after discounts, without commitments, unless billing transfer leaves you only public rates. Give a CI role the single pricing action through OIDC, run it on infrastructure paths only, and fail the job when the errors list is not empty.
Post the monthly difference on the pull request, never the rates. Keep the monthly report for what the plan cannot see. And before anyone switches on the FinOps Agent across the organisation, write down who approved it, because your SCPs will not stop it reading.
We are a DevSecOps company in Kochi, working with fintech, crypto and AI teams across India, the UAE, the US and the UK. Infrastructure we build and run has secured over $3B in transaction volume at 99.9% uptime, for clients including BILLDESK and Coinshift and for teams backed by Y Combinator and Sequoia.
The work is built to survive an audit rather than to describe one: SOC 2 Type II, ISO 27001, PCI DSS and SLSA 3. Our VAPT team holds OSWE certification, has spoken at Defcon, BlackHat and OWASP, and has found critical CVEs in open source software.
We rank ourselves first in our guide to choosing a DevOps company for a fintech — and we say so on that page, in the second paragraph, rather than presenting it as a neutral list. Read the criteria there and hold us to them.
Find out what your next change will cost
The free audit reads one production AWS account and its infrastructure repository: which rate type your accounts are allowed to estimate at, which usage types make up most of the bill, and which recent pull requests moved it without anyone pricing them. You get the list whether or not you work with us.
Book the free audit Cloud FinOps on AWS: Which Cost Number Should You Report?