
India-first AWS cost extension in 24 hours | AWS First Commit😼
The AWS console shows dollars. An Indian card is charged at the bank's rate on settlement day, plus a forex markup, plus GST — and no single screen shows all three. We built a browser extension that does, and hit two AWS design problems worth writing down: Cost Explorer's per-request billing, and cross-account reads without ever holding a key.
A developer in Bengaluru opens the AWS console and sees Â
$47.30Â . That figure is correct. It is also not what leaves their bank account.Three things happen between that number and the debit, and no screen in AWS shows all three together:
- The exchange rate. If the account is with AWS Inc rather than AISPL, the card is charged in USD and the bank converts at its own rate on the settlement date — not the rate on the day the usage happened, and not the rate you get from a search engine.
- The card's foreign-currency markup. Indian cards typically add a markup on international transactions, commonly quoted somewhere in the 2–3.5% range depending on the issuer. It appears on the card statement. It never appears in the console.
- GST, at 18% for Indian customers. Whether it lands on the AWS invoice or on the card statement depends on which AWS entity the account belongs to — and most people building their first project have no idea which one they signed up with.
So Â
$47.30 is really somewhere north of ₹5,000, and you find out three weeks later on a statement, where you cannot tell which part was extra usage and which part was the rupee moving.This is not something AWS should fix. The console is a global product and it correctly shows the account's billed currency; it is not Amazon's job to know my card issuer's markup. But it leaves a real gap for a lot of builders, and the right place to close it is next to the console rather than inside it.
So we built Paisa — a Manifest V3 browser extension that adds a ₹ Bill button to every AWS console page.
The first decision: don't call the API
The obvious design is to authenticate the user, assume a role in their account, call Cost Explorer, and render the result. We built that. But it is a terrible first experience: a student who wants to know what their bill means in rupees now has to create an IAM role before they get an answer.
The console has already fetched and rendered the figure. So the content script walks the page's text nodes, matches text shaped like Â
$903.30 , and converts it. No API call, no credentials, no AWS account, no sign-up — install the extension and the next billing page you open has a rupee figure on it.Two things that sound trivial and were not:
Not every dollar amount on a billing page is spend. A free-tier account's only dollar figure is often Â
Credits remaining $100.00 . Converting that as if it were spend would tell a student they owe ₹8,800. So there is an explicit exclusion:// Money on a billing page that is not what you owe.
var NOT_SPEND = /credit|free tier|remaining|savings|discount|refund|coupon|balance/i;A tool whose entire purpose is reducing anxiety about cost cannot be the thing that causes it.
The console's DOM is not yours. It will change, and an extension that breaks a page it does not own is worse than no extension. Every operation is wrapped so that failure is silent:
function safe(fn) {
return function () {
try { return fn.apply(this, arguments); }
catch (e) { /* never break the console */ }
};
}The conversion, and why the order matters
The arithmetic is small enough to print in full, and it is the only part users actually need to trust:
inr_base = usd_spend * fx_rate
if entity == "AWS_INC":
inr_markup = inr_base * markup_pct
inr_gst = (inr_base + inr_markup) * gst_pct # GST on the marked-up amount
else:
inr_markup = 0.0
inr_gst = inr_base * gst_pct
inr_total = inr_base + inr_markup + inr_gstGST applies on top of the marked-up amount, not beside it. That ordering is the difference between a plausible number and a correct one.
The thing we care about more than the maths: entity, markup percentage and GST rate are user settings, not constants. They genuinely differ by account type and card issuer, and we are not in a position to assert any of them as fact. So every screen shows the inputs that produced the figure — the USD amount, the FX rate with its timestamp and source, the markup, the GST — and everything is labelled an estimate.
A user who can see that ₹146 of their ₹5,108 is card markup has learned something they did not know. That traceability is the product; the rupee total is just the headline.
Two AWS problems worth stealing the answers to
The extension works standalone, but the backend is what adds history, per-service breakdown, alerts and emailed summaries. It's SAM: API Gateway HTTP API → Lambda (Python 3.12) → DynamoDB, with SNS for email and EventBridge Scheduler for two crons.
Two decisions in there generalise well beyond this project.
1. Cost Explorer bills per request
This is the one I'd most like other builders to internalise. Â
ce:GetCostAndUsage is charged per API call. An extension that called it every time someone opened the panel would charge the user money to look at what they are spending.So spend is cached in DynamoDB, and the refresh path is rate-limited independently of the TTL:
SPEND_TTL = 4 * 3600 # serve cached spend for 4 hours
MIN_REFRESH = 30 * 60 # a manual refresh can't re-query Cost Explorer more often than thisA user leaning on the Refresh button cannot generate cost. There is a test asserting Cost Explorer is called exactly once across repeated reads.
This is a cost decision, not a performance one — and those tend to get designed in late, after a bill arrives, rather than up front. If you are building anything on top of Cost Explorer, decide your caching story before you write the first call.
2. Cross-account reads without ever holding a key
An extension is client-side code that anyone can unzip and read. Putting an AWS access key in one would be an immediate security failure, so there is no AWS credential anywhere in the browser — not in the extension, not in the dashboard, not on any page. The extension holds only our own session token, talks only to our API, and the Lambda assumes a read-only role inside the user's account via STS.
The part that matters is the trust policy:
AssumeRolePolicyDocument:
Statement:
- Effect: Allow
Principal:
AWS: !Sub arn:aws:iam::${PaisaAccountId}:root
Action: sts:AssumeRole
Condition:
StringEquals:
sts:ExternalId: !Ref ExternalIdThe per-user Â
ExternalId is what prevents the confused-deputy problem: without it, any customer who learns another account's role ARN could ask our service to assume it. This is AWS's documented pattern for third-party access, and it is worth implementing properly even on a hackathon timeline — it is three lines of YAML.The role grants five read-only billing actions and nothing else: no resources, no data, no writes. Users install it through a one-click CloudFormation quick-create link with the template and their connect ID pre-filled, and revoke it by deleting the stack. Turning "please create an IAM role" into one button is most of the battle for non-expert users.
A bonus, forced on us: two spend sources
Cost Explorer is opt-in, and some accounts cannot call it at all — including, as it turned out, ours. Rather than demo against a fixture, we made the spend source pluggable, with the free CloudWatch Â
AWS/Billing ****  EstimatedCharges metric as a fallback.Whichever source answered is carried through the API as Â
provider and shown to the user in a sentence, so a coarse figure never poses as a precise one.  EstimatedCharges only covers the current month, so last month's final figure still requires Cost Explorer — and the code says so rather than silently returning something wrong.What went wrong
The honest part, because the failures were more instructive than the features.
A free-plan AWS account is not necessarily a usable one. Ours never finished signup. Every deployable service answered Â
OptInRequired and Cost Explorer answered  SubscriptionRequiredException . We lost hours treating that as a credentials problem before writing a 40-line script that distinguishes missing credentials, an expired session, an unactivated account, and a ready one. It is now the first thing we run.Invalid CSS fails silently and loudly. Â
font: 700 14px/1 inherit looks fine and is invalid — the shorthand has no  inherit family form — so the browser dropped the whole declaration and our panel rendered in Arial on a console that uses Amazon Ember. Reading the code would never have caught it. Asserting on  getComputedStyle did.A stale test fixture is worse than no test. Our browser suite was passing against an out-of-date copy of the extension. Rebuilding it from source on every run immediately exposed a real bug: the content script only matched Â
/billing*Â , so figures on other console paths and inside sub-frames never got converted.Match the host application's conventions. The panel started as a dark drawer on a console that is light by default. Adopting the console's own design tokens and following its theme live changed how finished it felt far more than any feature did.
Where it stands
The extension works today and needs nothing but a browser. The backend is written, unit-tested against mocked AWS (101 tests, 98% line coverage) and its SAM template validates — but it is not deployed, for the account-activation reason above. I would rather say that plainly than imply a running system.
The repo is public and the packaged zip is in it:  github.com/UJESH2K/AWS-Paisa-extension . Load it unpacked, open your billing page, and you'll see your own figure in rupees in about two minutes. Everything it computes is an estimate — your bank's rate on the settlement date and your AWS entity decide the real number.
If you build anything against Cost Explorer, take the caching lesson with you. It's the cheapest bug to avoid and the most embarrassing one to ship.

Paisa is an independent tool and is not affiliated with or endorsed by Amazon Web Services. Exchange rates come from public sources (ECB data via frankfurter.dev, falling back to open.er-api.com); these are mid-market rates and your bank's rate will differ. Nothing here is tax advice — GST and forex treatment vary by AWS entity and card issuer, which is why they are user settings in the tool rather than assumptions in the code.
Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article