CostMap is one local Go binary that reads your AWS, Google Cloud and UpCloud accounts and shows the resources it finds with an estimated monthly cost at public list prices. It prints a tree in the terminal and serves a web page on this computer only. It only reads: it never creates, changes or deletes anything in a cloud account.
The amounts are estimates, not an invoice. CostMap does not find everything in an account and does not price everything it finds; the sections "What is scanned" and "What no estimate covers" say where the limits are.
- Read-only. List, Describe and Get calls on AWS, GET requests on Google Cloud and UpCloud. The open edition never calls Cost Explorer; nothing writes.
- Local. Scans stay on this computer. No telemetry, no account, no licence server.
- Honest numbers. What cannot be read is "not scanned", what cannot be priced is "not priced"; neither is ever a silent zero.
- Open source, Apache-2.0.
Contributing · Security · Code of conduct · Licence
This repository is the open edition of CostMap: the free plan: 1 connected account (the demo accounts do not count), with scanning, the tree, the page, findings and export, and no network request of its own besides the cloud APIs and the ECB exchange rate. CostMap Pro, the official build from MoveInfra, adds more connected accounts and an AI advisor on paid plans; see https://moveinfra.eu/costmap/.
On macOS or Linux with Homebrew:
brew install moveinfra/tap/costmap
costmap-app # macOS: the CostMap app
costmap # opens the page in your browser; Ctrl+C stops itOn macOS the formula installs the Mac app as well. To see it in Launchpad, copy it to your Applications folder:
the install message (shown again by brew info costmap) prints the command.
The Mac app is also attached to each release as CostMap-<version>-macOS.zip. It is signed ad hoc, not notarized by
Apple, so a browser download gets the "could not verify" warning; open it with System Settings, Privacy & Security,
Open Anyway. Installed with Homebrew it opens without the warning.
Or download a build: each release has archives for macOS (Intel and Apple silicon), Linux (x86-64 and Arm64) and Windows
(x86-64), and a SHA256SUMS file:
grep darwin_arm64 SHA256SUMS | shasum -a 256 -c
tar xzf costmap_*_darwin_arm64.tar.gz
./costmap versionCostMap is built from source with Go; go.mod names Go 1.27.3.
go build -trimpath -o bin/costmap ./cmd/costmap
go test ./... # offline; no test calls a cloud unless COSTMAP_LIVE=1 is setThe Makefile has the same as targets: make build (with -trimpath, so that the binary holds no path of the
computer it was built on), make test, make race (the tests with the race detector), make check (formatting,
go vet, the tests and the tests with the race detector), make demo, make screens (takes screenshots of the
page into web/devserver/screens with a headless Chrome and checks every page on the way; needs Node 22 or newer)
and make eu-prices (refreshes the built-in copy of the EU Cloud Price Index, see "On EU clouds").
bin/costmap demoThis opens the page with three made-up accounts (AWS-, UpCloud- and Google Cloud-like). No cloud account is contacted. The demo keeps its data in a temporary
directory that is removed when the command stops. The page still asks the European Central Bank for the EUR/USD
reference rate (see "Network connections"). The demo cannot connect real accounts: its "Add an account" page says so
and shows no connect form. Run costmap without demo to connect one. So that the charts over time have something
to show, the demo also stores five made-up earlier scans of each account; the page says that they are made up.
costmap export-demo [--no-ai] DIR writes the page of costmap demo with its made-up data as static files into a
new or empty directory, so that it can be put on a website and runs in the browser without CostMap behind it. The
data are the answers of the demo's own handlers to every GET request the page can make (the state, the tree, the
findings, the gaps, the policy, the exports, and the detail and history of each resource and account of the demo, in
EUR, USD and Native), so the numbers are those of costmap demo; data/index.json names the file of each resource,
whose id holds ":" and "/". The exchange rate is read once and named on the page as fixed for the demo. The open
edition stores no example answers of an AI review; --no-ai changes nothing there.
app.js and app.css are the files of the local page. The bundle's index.html adds one tag,
<meta name="costmap-mode" content="static-demo">, which puts the page into its static mode: every GET reads its
file, relative to the page; nothing is written; there is no event stream; the scans are named by their date, not by
how long ago they were; and a strip on every page says that the accounts are made up. The local page never has the
tag. The bundle needs no inline script or style and makes no request outside its own folder.
bin/costmap policy # print the read-only AWS policy CostMap needs
bin/costmap accounts add aws --profile NAME # connect an AWS profile
bin/costmap accounts add upcloud # connect UpCloud; asks for the API token
bin/costmap accounts add gcp --project PROJECT_ID # connect Google Cloud (after gcloud auth application-default login)
bin/costmap scan # read the accounts
bin/costmap tree # show the result in the terminal
bin/costmap # or open the local pageThe page has three columns. On the far left, a rail: the overview of all accounts, one badge per connected account (two letters of its name, the provider, and a bar under it: green when the last scan read everything, amber when it has gaps or resources without a price, red when it failed, grey before the first scan, moving while a scan runs), a "+" that adds an AWS, Google Cloud or UpCloud account (other providers are shown as coming soon), and Advisor and Settings at the bottom. Next to it, the navigation of the selected account: its overview, findings, what is not priced, what was not scanned, the scan, and one group per category with its resource kinds and their counts. On the right, the page itself, under a breadcrumb with the currency switch, the time of the scan, Rescan and Export.
An overview leads with one number, the estimate per month in whole units ("at least" when it is a lower bound; with accounts in different currencies, their total in EUR at the ECB rate, marked "≈"), and at most one more (the possible saving, else the billed amount); the amounts with cents and per currency, the upper bounds and the counts are folded under "How this is calculated". Under it, "from ≈ €X on EU clouds" is the cheapest provider for the compared part, with its coverage ("for 90% of the cost"), and opens the four providers and the call about the move. The head of the navigation shows the same one number. Then come the charts: a donut of the cost by category (the estimate in its centre, a legend with each amount and share; upper bounds and resources without a price are said under it, never drawn as slices), the largest resources, by zone and by kind, and the estimate of each stored scan over time. Accounts in different currencies ("Native" on the page of all accounts) get no charts together: amounts in different currencies are never added up. What the numbers cover is folded under "About these numbers". A kind opens a table of its resources (sortable, with search and filters, and the total CostMap computed for the kind).
A resource opens its page: its name and state, one number per month (for a compared AWS resource, with the green
"from ≈ €X on EU clouds" under it, which opens the four providers and the call about the move), its facts in a side
panel, and tabs (#/r/<id>?tab=prices, so a reload keeps the tab; a tab with nothing to show is
left out):
- Cost: a donut of the cost lines and attached items (at most six slices, the smallest folded into "Other"), the estimate with attached items in its centre and the amounts and shares beside it; with one part only, its amount alone, and under it the amount with attached items and the billed amount, when known. Upper bounds are hatched bars under it, on the scale of the estimate and never in it.
- Over time: the estimate of each stored scan.
- Utilisation: what was measured, with its window.
- Prices: what the resource runs on now next to what is near, with the price per month and the difference. For an EC2 instance: the same type in eu-central-1, eu-west-1, eu-north-1, eu-south-1, us-east-1, us-west-2 and its own region; one size smaller and one larger in its family; the same size in a current-generation and a Graviton (Arm) family; for an UpCloud server: the same plan in other zones and the plans of the same size in other families; for both, the nearest server size on UpCloud, Hetzner, Scaleway and OVHcloud from MoveInfra's EU Cloud Price Index (list prices of 2026-11-21, built into the binary). AWS prices come from the Price List API like every other AWS price (cached; the extra lookups are bounded per scan), UpCloud prices from its price list. A price that is not found is left out, never shown as zero. For every AWS resource that "On EU clouds" compares (instances, volumes, databases, buckets, load balancers, EKS clusters), the same table has the group "EU-owned clouds": one row per provider with its plan, size, location, price (a range for a database) and the difference, in place of the nearest server sizes. For an UpCloud server or storage device, the plain group "Other EU clouds" lists Hetzner, Scaleway and OVHcloud by the same rules (and UpCloud's own list price in the index when it differs from the scanned one); UpCloud resources and accounts get no "from ... on EU clouds" and no call about the move.
- Findings: the findings of the rules. The tab "AI review" and the Advisor page belong to the official build (see "The open edition"); here they say so with a link and send nothing. Settings shows the edition instead of a licence key.
"Generate report" opens the written report of the resource, built from the same numbers, which "Copy report" copies as text. Every page has its own address, so a reload or a bookmark keeps the place. On a phone the rail and the navigation open from the Menu button.
costmap compare and the page "On EU clouds" (#/compare, and a section of the overview of all accounts) put the
AWS and Google Cloud resources of the latest scans next to their nearest equivalents on the EU-owned clouds UpCloud, Hetzner,
Scaleway and OVHcloud, at list prices. It is an estimate, not a quote. The prices are a copy of MoveInfra's
EU Cloud Price Index of 2026-11-21 built into the binary
(internal/eucompare/index.json, CC BY 4.0, "EU Cloud Price Index by MoveInfra"; a subset, values unchanged), so
nothing is fetched for it. The rules are those of MoveInfra's cloud bill analyzer, so that both pick the same
equivalents:
- EC2 instances: the cheapest server with at least the vCPU and memory of the instance type (general-purpose, compute- or memory-optimised; shared-core only for burstable types), x86 unless the instance is Arm and the provider has Arm; a size no server reaches is split over up to 8 equal servers. Linux only.
- RDS and Aurora (PostgreSQL, MySQL, MariaDB): rough, a range. Each provider's managed PostgreSQL for 2 vCPU and 8 GB scaled by vCPU / 2 (low) and memory / 8 GB (high), twice with a standby; where a provider has no managed PostgreSQL (Hetzner), a server you run yourself, named as such. Storage at the block storage price.
- EBS volumes at the provider's block storage price per GB, whatever their type; S3 Standard at its object storage price per GB (other storage classes are named as not compared); load balancers at one managed load balancer each; EKS clusters at one control plane (Hetzner: three small servers you run).
- Google Cloud by the same rules: Compute Engine instances by their vCPU and memory, Cloud SQL like RDS, persistent disks and Cloud Storage Standard per GB, one load balancer per priced forwarding rule (the rules covered by the minimum charge of another are free and not listed), one control plane per GKE cluster.
- Not compared, and listed with the reason, never dropped: public IPv4 addresses, NAT gateways, snapshots, licensed operating systems and database engines, and services without an equivalent in the index. Data transfer is on AWS an upper bound only and is in no total. The totals say "Compared: N of M AWS resources, X% of the AWS run rate".
- An account that is already on an EU-owned cloud (UpCloud) is named as such and not in the totals; the Prices tab of its servers and storage devices still lists the other EU clouds.
costmap compare [--currency EUR|USD|native] [--format text|json|csv] prints the totals per provider, every row and
the reasons; --format json is the answer of GET /api/compare. The page and the command line offer a call about
the move: a plain link to https://moveinfra.eu/?ref=costmap#call ("Book a free call about the move", with the line "Get CostMap Pro free for one month after the
call."), which opens only when you click it; nothing is sent. make eu-prices EU_PRICES=<checkout of moveinfra/eu-cloud-prices>
refreshes the copy of the index from a local checkout.
| Command | What it does |
|---|---|
costmap, costmap ui [--port N] [--no-open] |
Serve the local page on 127.0.0.1 (port 8585 unless --port is given; --port 0 picks a free one) and open the browser. |
costmap demo [--port N] [--no-open] |
The same page with demo data. |
costmap export-demo [--no-ai] DIR |
Write the page of costmap demo with its made-up data as static files into a new or empty directory (see "The demo on the website"). |
costmap accounts list |
List the connected accounts. |
costmap accounts add aws --profile NAME [--name LABEL] |
Connect the AWS account behind a named profile. |
costmap accounts add upcloud [--name LABEL] [--token-env VAR] |
Connect an UpCloud account. |
costmap accounts add gcp --project PROJECT_ID [--credentials KEY_FILE] [--quota-project PROJECT_ID] [--name LABEL] |
Connect a Google Cloud project, with Application Default Credentials or a service-account key file (see "Connecting accounts"). |
costmap accounts set ID [--quota-project PROJECT_ID] [--cost-explorer on|off] [--billing-table TABLE] |
Change the quota project of a Google Cloud account. --cost-explorer and --billing-table set up "Billed vs estimate" of CostMap Pro; the open edition refuses them with exit code 4. |
costmap accounts remove ID |
Remove an account, its stored scans and its stored token. |
costmap scan [--account ID] [--metrics all|cost|off] [--regions a,b] [--refresh-prices] |
Read the connected accounts and store the result. |
costmap tree [--currency EUR|USD|native] [--account ID] [--depth N] [--show-free] [--no-color] |
Print the latest scans as a tree. |
costmap findings [--currency EUR|USD|native] |
Print the findings of the latest scans. |
costmap json |
Export the latest scans as one JSON document: schema_version, tree (what costmap tree shows) and scans. "Export JSON" of the page downloads the same document. |
costmap compare [--currency EUR|USD|native] [--format text|json|csv] |
The AWS resources of the latest scans next to their nearest equivalents on UpCloud, Hetzner, Scaleway and OVHcloud, at the list prices of the EU Cloud Price Index built into CostMap (see "On EU clouds"). |
costmap billed [--account ID] |
Billed vs estimate, a part of CostMap Pro. The open edition has none: it says so, reads nothing and ends with exit code 4. |
costmap csv, costmap lines |
Export one row per cost line, as CSV or as JSON (schema_version and lines). |
costmap advise [--no-redact] [--model ID] [--yes] |
The AI advisor of the official build. The open edition has none: it says so, sends nothing and ends with exit code 4. |
costmap license show, costmap license install KEY, costmap license remove |
show prints the edition and its plan. The open edition has no licence keys: install and remove end with exit code 4. |
costmap policy, costmap policy gcp, costmap policy billed |
Print the read-only AWS policy, the read-only Google Cloud role (docs/gcp-permissions.json), or the optional AWS statement for the billed amounts of CostMap Pro (docs/iam-policy-billed.json). |
costmap version |
Print the version. |
Exit codes: 0 success, 1 failure, 2 wrong usage, 3 the scan finished but parts could not be read, 4 beyond the plan (another account, the AI advisor, a licence key).
costmap tree follows the width of the terminal and prints no line wider than it. From 120 columns it has columns
for type, zone, address, state and share, which grow on a wider terminal as far as the rows need. A name is
shortened only when its row has no room for it, and an amount is never shortened. What is added to an amount
("+ up to X", "+ N not priced") stands on the row, or on a line of its own under the row when the row is full. A
row with nothing but an upper bound has "up to X" in the amount column. A line of measured usage always states
how much was measured and over what ("22.6 GB", "last 30 days"); where the two do not fit beside its name, the
quantity stays on the row and the window stands on a line under it. With --depth 4 the cost lines are not printed,
and the row of a resource with one measured line states both itself. A unit that counts things follows its
quantity ("1 instance", "2 Availability Zones"). When the output is not a terminal, nothing is shortened or wrapped.
Resources that cost nothing by design are left out, with the reference rows that point to them, unless
--show-free is given; a free resource with a finding is always shown.
The page offers two ways under "Add an account":
- Manual (the only way in a browser; in the Mac app the default unless it finds an AWS profile): you create a read-only key in the cloud's own console, following the steps on the page, and paste it. For AWS that is an IAM user with read-only access and its access key; for Google Cloud a service account with the Viewer role and its JSON key file; for UpCloud an API token. CostMap checks the key with one read-only call, then keeps the secret part in the system keychain (macOS Keychain, Windows Credential Manager, the Secret Service on Linux): never in its config file, never shown again. Removing the account removes the secret; deleting the key in the cloud stops CostMap's access at any time.
- Automatic (Mac app only): CostMap uses the AWS CLI and gcloud of this computer, as described below. In a
browser these ways are not offered and their routes answer 404, because they run local tools for the page; the
command line (
costmap accounts add aws --profile NAME,costmap accounts add gcp) keeps them for people who use a terminal.
AWS, manual. An access key of an IAM user (its id starts with AKIA; temporary ASIA keys are refused, they
expire within hours). The page suggests the AWS managed policy ReadOnlyAccess, which is simple to attach but also
allows reading the data in S3 buckets and DynamoDB tables; CostMap never does, and the CostMap policy below is the
tighter choice. With a stored key the AWS SDK gets only that key: the shared config and credentials files are not
read for such an account, and AWS_ACCESS_KEY_ID in the environment does not override it.
AWS, automatic. CostMap uses a named profile from the shared AWS configuration and nothing else. The AWS SDK reads the
credentials of that profile; CostMap does not open the credential files for keys and does not copy keys anywhere.
costmap policy prints the read-only policy to attach to the role or user behind the profile. The policy holds
the actions CostMap calls and no other; a test derives the calls from the source and fails when the two differ.
When an account is added, CostMap calls sts:GetCallerIdentity to learn the account id, and warns when the
credentials belong to the root user or when AWS_ACCESS_KEY_ID is set in the environment (it takes precedence over
the profile). Only the standard aws partition is supported.
Adding AWS from the page (Mac app, Automatic). It offers three ways. The first is a profile that already has the policy ("Use an existing read-only profile"). The second creates the access for you ("Or create read-only access in AWS"):
- Pick the profile you normally use in that account, one that may create IAM roles (an admin or power-user
login; single sign-on works). CostMap calls
sts:GetCallerIdentitywith it and, for a role,iam:GetRoleto learn the path of the role, because the role the stack trusts must be named with its full ARN. - "Create read-only access in AWS" opens the CloudFormation quick-create page in your browser, in the region of
that profile (else
us-east-1), with the stack nameCostMapReadOnly, the published CostMap template and the principal behind your profile filled in. The template (cfn/costmap/aws/costmap-readonly-v1.yaml, made fromdocs/iam-policy.json) creates one IAM role, named by CloudFormation after the stack, with the CostMap policy as its only permissions, a maximum session of one hour and the tagproject=costmap, which only that principal may assume; its outputRoleArnis the role. You tick the IAM acknowledgement and click "Create stack": CostMap creates nothing in the account itself. While you do, the page asks for the stack every few seconds (cloudformation:DescribeStacks, andDescribeStackEventsfor the progress and for the cause of a failure) with the same profile, until it is complete or has failed. - The page shows the lines it will add to the shared config file (
$AWS_CONFIG_FILE, or~/.aws/config):[profile costmap-<account id>]withrole_arn,source_profile(your profile) andregion. "Add these lines and scan" first copies the file toconfig.costmap-backup-<time>, then appends the section through a temporary file that replaces the old one, with the same file mode; no other line changes. A profile of that name with other settings is left alone and the page says so; the same section already there is used as it is. CostMap never opens~/.aws/credentials. It then signs in through the new profile (sts:GetCallerIdentity, which assumes the role, andec2:DescribeRegions), adds the account as any other (the plan's limit applies) and starts the first scan.
With a profile that signs in with single sign-on, the new profile uses it as its source: when the sign-on session
has expired, run aws sso login --profile <your profile> before a scan. A profile that asks for an MFA code
(mfa_serial) cannot be used: CostMap cannot type the code, so the page says so and stops. Use the third way then,
"Write the profile yourself": the policy and example profiles, as above, or the Manual way.
UpCloud. CostMap needs an API token and sends only GET requests. UpCloud tokens cannot be limited to read-only,
so set an expiry and an allowed IP range on the token. On the page, "Open the API tokens page" opens
https://hub.upcloud.com/account/api-tokens (Account, API tokens; in a workspace: Workspace settings, API tokens),
where the token is made; paste it, "Check access", then add. By default the token is stored in the system keychain. With
--token-env VAR nothing is stored: CostMap reads the token from that environment variable at every scan.
Google Cloud. CostMap reads one project per account and sends only GET requests; a test fails if the code names any other method, and the HTTP client refuses anything but a GET before it leaves the computer (the OAuth token exchange of the Google sign-in library is the one exception). It signs in in one of three ways:
-
A stored service-account key (Manual, on the page): a service account with the Viewer role (or the custom role below) and its JSON key file, chosen on the page. Only keys of type
service_accountare accepted; the key is kept in the system keychain, the downloaded file can be deleted afterwards. An organization policy may forbid key creation (iam.disableServiceAccountKeyCreation); then use the Application Default Credentials. -
Application Default Credentials (the default): install the gcloud CLI and run
gcloud auth application-default loginonce, or press "Sign in with Google" on the page: CostMap then runs that one command itself (found on PATH, no shell, nothing else of gcloud), a browser window opens for the sign-in, and the page checks the access again when it is done. Without gcloud the page links to its install guide. CostMap never enables an API or changes anything in a project. CostMap then acts with the roles of your Google account; "Check access" on the page, andcostmap accounts add gcp, say which account that is. Requests made with user credentials carry a quota project (thex-goog-user-projectheader), which must have the APIs below enabled and in which your account needsserviceusage.services.use(roles/serviceusage.serviceUsageConsumer): the one given with--quota-project(on the page "Billing/quota project, optional"), else the scanned project itself, so the APIs only need to be enabled where the resources are. When Google refuses the scanned project as a quota project (USER_PROJECT_DENIED: you may read it but not bill requests to it), CostMap switches to the quota project of the Application Default Credentials. An API that was never switched on in the scanned project means the project has nothing of its kind: the scan says so in a note, not as a gap. -
A service-account key file (
--credentials KEY_FILE, on the page its full path): only keys of typeservice_accountare accepted. CostMap stores the path, not the key, and reads the file at every check and scan. Requests of a service account carry no quota project.
The identity needs roles/viewer, roles/cloudsql.viewer, roles/gkebackup.viewer and roles/run.viewer on the
project, or the custom role in
docs/gcp-permissions.json (costmap policy gcp prints it), which holds the permissions CostMap uses and no other; a test
derives them from the source and fails when the two differ. Create it with gcloud (iam roles create with the file) and
grant it on the project. To tell which organization a project
belongs to (only the official build needs this), CostMap reads the project and the folders above it
(resourcemanager.projects.get, resourcemanager.folders.get). The APIs used are Compute Engine, Cloud SQL Admin,
Cloud Storage, Kubernetes Engine, Backup for GKE, Cloud Run Admin, Cloud Monitoring, Cloud Resource Manager and Cloud Billing (the public price
catalog, which needs no permission). An API that is not enabled is a "not scanned" entry that names the API and the
project to enable it in, with a link to that page of the Google Cloud console; it never fails the scan. The price
catalog needs only the Cloud Billing API, enabled in the quota project: to leave the scanned project unchanged, use a
project of your own as the quota project. It can be changed after the account was added, in Settings (Google
Cloud) or with costmap accounts set ID --quota-project PROJECT_ID (an empty value returns to the default); the next
scan reads the prices again.
By default CostMap scans the regions that are enabled for the account. --regions, or the saved region setting,
limits the scan to the named regions; resources elsewhere are then in no total. Opt-in regions that are not enabled
are not scanned and are named in a note. When a scan finds nothing in an account, the account row says "Nothing
billable found in N regions" (N is the number of regions that were scanned) and shows no basis; it is a result, not
a failure and not "not priced".
CostMap has collectors for these resource types:
- EC2 instances, EBS volumes, EBS snapshots, machine images (AMIs), public IPv4 addresses
- NAT gateways, VPC endpoints, load balancers, Route 53 hosted zones
- RDS DB instances, RDS and Aurora DB clusters, manual RDS snapshots
- DynamoDB tables, ElastiCache, S3 buckets, EFS file systems
- ECS clusters, services and standalone tasks; EKS clusters, node groups and Fargate profiles
- KMS keys, Secrets Manager secrets, CloudWatch log groups
- Lambda functions, SQS queues, SNS topics, ECR repositories, CloudFront distributions, Site-to-Site VPN connections, transit gateways and their attachments, OpenSearch domains
The types in the last line are listed but always shown as "not priced". Types in the other lines are priced when CostMap has a verified list price for the configuration; otherwise the resource is shown as "not priced" with the reason (for example Spot instances, resources on Outposts or in Local Zones, DynamoDB tables with on-demand capacity, ElastiCache serverless caches, Aurora Serverless capacity, DocumentDB and Neptune). Some rows have no charge of their own and say so, for example a machine image or an EKS node group, whose EC2 instances are priced as instances.
Services without a collector are looked up with the Resource Groups Tagging API. That API only returns resources that have or once had a tag, and only for services that support it. So for those services:
- untagged resources are not shown at all;
- what is found is listed as "not priced";
- at most 500 resources per service and region are listed; when there are more, a "not scanned" entry says how many were left out.
CostMap reads servers, storage devices, backups, custom images, IP addresses, private networks, routers, gateways, load balancers, Managed Databases, Managed Object Storage, Managed Kubernetes clusters and their node groups, and file storage. An UpCloud account in which nothing is found says "Nothing billable found".
Container registries, managed inference services and network peerings are not read. When the account's resource-usage counters show any of them, the scan reports them as "not scanned"; they are in no total. An UpCloud service that is in neither list is not reported at all.
CostMap reads Compute Engine instances (all zones; the machine type gives vCPU and memory, custom types are read from
their name), persistent disks, static external IP addresses (regional and global) and the ephemeral external
addresses of instances, disk snapshots, forwarding rules (regional and global; they stand for the load balancers),
Cloud SQL instances, Cloud Storage buckets, GKE clusters, Cloud NAT gateways (on Cloud Routers), Backup for GKE
plans (with the sizes of their kept backups) and Cloud Run services. Internal addresses are free and not listed.
A NAT gateway is priced per VM that uses it (the running VMs without an external address in its network and region,
at most 32); a Backup for GKE plan by its protected pods, with the storage of its backups as an "up to" amount
(backups of a disk share data); a Cloud Run service only for its minimum instances, which bill all the time:
requests and further instance time are usage, which CostMap does not read. With metrics,
it reads the CPU utilisation of running instances for the last 30 days (average, peak and 99.5th percentile of the
hourly peaks) and the size of each bucket per storage class (storage/total_bytes) from Cloud Monitoring.
Not read: Cloud Functions, App Engine, BigQuery, Pub/Sub, Filestore, Memorystore, Spanner, Cloud DNS, VPN and Interconnect, internet egress, Artifact Registry and the other services; they are in no total. Not priced, with the reason: Spot VMs, sole-tenant nodes, GPUs and local SSDs (noted on the instance), custom types with extended memory, shared-core N1 types, Hyperdisk and extreme persistent disks, archive snapshots, SQL Server and Enterprise Plus editions of Cloud SQL and its shared-core tiers, data processed by load balancers, Autopilot pod resources, Cloud Storage operations, retrieval and network, data processed by NAT gateways, Cloud Run services without minimum instances, and buckets whose size could not be read.
A call that is denied, throttled or fails becomes a "not scanned" entry with the reason; it is never shown as zero.
The tree and the page list these entries under "Not scanned (N)" in the account they belong to; an account whose
scan read everything has no such group.
A total above such an entry is marked "at least". The one exception is an entry marked "information only": a read
that adds no resource and no amount to the estimate failed (on UpCloud the account name, the resource counters, the
billed amounts, the transfer allowance or the server statistics; on Google Cloud the CPU utilisation and the bucket
sizes, whose buckets then say why they are not priced). Such an entry is listed, and the total above it
stays as it is. costmap scan ends with exit code 3 when the scan has any "not scanned" entry.
Every cost line says what it is based on, with its formula and its price source.
- List price. The configuration found now, at the public on-demand list price, for a full month. A month is 730 hours for AWS and Google Cloud. For UpCloud it is 672 hours for fixed server plans and their backup add-on, and 720 hours for everything else.
- Measured. Usage read from the provider for a stated window, at list price. On AWS these lines cover the data processed by NAT gateways and VPC endpoints in the last 30 days. Measured usage is not extrapolated to a longer period.
- Up to. An upper bound whose true cost may be much lower, for example EBS snapshots, or the outbound traffic of an EC2 instance in the last 30 days priced as if all of it had gone to the internet. "Up to" amounts are shown next to the total and are never added to it.
- Billed so far. UpCloud only: the amounts of the running month from UpCloud's billing summary, shown next to the estimate. The amount is stated once, in the header; it is the sum of what the summary gives per resource, resources deleted this month included. When that sum is not the total of the account, a note states the total and the difference. The token needs billing access for this. The open edition never calls AWS Cost Explorer, so AWS resources have no billed amount.
- Not priced. Shown with a reason and without an amount, never as zero, and kept out of every total.
Prices. AWS prices come from the AWS Price List Query API (pricing:GetProducts) and are cached on this
computer: a price that was found for 7 days, a "no price" answer for 1 day. costmap scan --refresh-prices ignores
the cache. UpCloud prices come from the price list of the UpCloud API at every scan. Google Cloud prices are the on-demand
list prices in USD of the public Cloud Billing catalog (services.skus.list), matched by the description of each
SKU in the region of the resource (machine families by their vCPU and memory SKUs, disks and storage per GB-month,
addresses and cluster fees per hour); a SKU that cannot be found, or several that match with different prices, leave
the resource not priced with the reason. The catalog is cached for 7 days; --refresh-prices reads it again.
Basis. The word next to an amount says what its counted lines are: "list" (list price), "usage" (measured) or "mixed" for both. Only lines that are part of the estimate count, so an "up to" line never changes the word: a resource with a list price line and an "up to" line is "list", and a row with nothing but an "up to" amount has no basis word. A resource without any counted line whose lines are free or included shows 0.00 with "free" or "included", for example a stopped EC2 instance; the resource lists, the detail and the Findings table show it the same way. An account without any counted line has no basis word.
Currency. AWS and Google Cloud amounts are in USD, UpCloud amounts in the currency of the UpCloud account. costmap tree,
costmap findings and the page show the currency of --currency (or of the currency switch of the page: EUR, USD
or Native), else the saved currency setting, which is what the switch saves. Without either they show the accounts'
own currency when all scanned accounts share one, and EUR when they do not; the terminal and the page use the same
rule.
--currency native (Native on the page) shows each account in its own currency and converts nothing. When the
accounts do not share one currency there is then no single total, because amounts in different currencies are
never added up: the header and the Total row show one total per currency side by side, for example
"$2,903.03 + €163.55", and no row has a share. When all accounts share one currency, native is that currency.
Amounts in another currency are converted with the euro reference rate of the European Central Bank, which the ECB publishes for information purposes only. An amount carries "≈" only when a conversion went into it: a line that is already in the currency shown is not marked, a sum is marked when one of its parts was converted, and a line whose currency differs from that of its account is converted and marked like any other. An amount below one cent reads "<€0.01" without the sign. The rate is cached for six hours. When the ECB cannot be reached, CostMap uses the cached rate or a dated rate built into the binary and marks it as stale.
The tree and the page say it in one line: "List prices for what runs now, plus measured usage of the last 30 days. Before discounts, credits and taxes. Not an invoice." The last note of the tree and of the page names what is left out; this is the same list:
- Data transfer. For EC2 instances, outbound traffic is shown only as an "up to" upper bound outside the total.
- Request, I/O and other usage-based charges, unless a line shows measured usage. The note of a line names what it leaves out, for example S3 requests and retrievals, load balancer capacity units, or RDS backup storage above the free allowance.
- Taxes, support plans, credits and Marketplace charges.
- Private discounts, Savings Plans, Reserved Instances and the free tier. CostMap checks for active Reserved Instances and says so in a note, but does not apply them. Savings Plans are not checked. With either, list prices overstate compute.
- Everything listed as "not priced" or "not scanned", and everything CostMap does not find (see "What is scanned").
For usage lines, for some prices (for example S3 bucket sizes) and for findings, CostMap reads CloudWatch with
GetMetricStatistics, and uses ListMetrics to find the size metrics of S3 buckets. It never calls
GetMetricData. One scan of one AWS account has a budget of 5,000 GetMetricStatistics requests; automatic retries
by the AWS SDK are not counted. What could not be measured once the budget is used up is reported as "not scanned".
AWS may charge for these requests: the list price of CloudWatch is $0.01 per 1,000 requests beyond a monthly free
allowance.
--metrics (or the saved setting) chooses how much is read:
all(default): metrics needed for prices and for utilisation findings. On UpCloud this also reads the monthly CPU and network statistics of each server.cost: only the metrics needed for prices.off: no CloudWatch request. Resources whose price depends on a metric are then not priced or carry a note.
On Google Cloud the same setting chooses what CostMap reads from Cloud Monitoring (timeSeries.list, two requests
for the CPU of all instances and one for the sizes of all buckets): all reads both, cost the bucket sizes only,
off nothing, and buckets are then not priced.
costmap findings and the Findings page list resources that look unused or oversized, each with the numbers behind
it. Examples: EC2 instances with almost no CPU and network activity for 14 days, unattached EBS volumes, EBS
snapshots older than 90 days that no machine image uses, NAT gateways without traffic for 30 days, RDS instances
without connections for 14 days, stopped UpCloud servers that are still billed; on Google Cloud, instances with a
CPU peak under 5%, instances of 4 vCPU or more whose CPU stayed at or under 40% (half the size would do), unattached
persistent disks, static IP addresses that are reserved but not used, and snapshots older than 90 days.
A rule runs on a resource only when the scan has the data the rule needs, for example measured usage for the whole
window. Below the findings, costmap findings and the Findings page list the rules under "Checked" and "Not checked":
"Not checked" names the rule, for how many resources it could not run and what the scan lacks (metrics switched off
or denied, a resource too new for the window). A rule that could not run is never reported as "nothing found".
A "possible saving" is computed from the list price lines of the scan and is worded "up to": it is an estimate at list prices, before discounts, credits and taxes. A saving that is only an upper bound says so. The saving total counts one finding per resource and leaves out savings that are only an upper bound.
The data directory is $COSTMAP_HOME when that variable is set. Otherwise it is the costmap folder in the user
configuration directory of the operating system (~/Library/Application Support on macOS, $XDG_CONFIG_HOME or
~/.config on Linux, %AppData% on Windows). Files are written with mode 0600 and directories with mode 0700.
| Path | Content |
|---|---|
config.json |
Connected accounts and settings. No secrets: an account holds the name of an AWS profile, a reference to where the UpCloud token is kept, or a Google Cloud project id with the path of a service-account key file. |
scans/<account id>/ |
The last 60 scans of each account as JSON: resource names, identifiers, configuration facts and the estimates. |
Public prices and the ECB rate are cached in the costmap folder of the user cache directory, or in
$COSTMAP_HOME/cache when COSTMAP_HOME is set. The cache holds no account data.
Secrets. An UpCloud token is kept in the system keychain under the service name costmap, or stays in the
environment variable you named. If a file called secrets.json exists in the data directory, new tokens are written
to that file instead of the keychain; it must not be readable by other users. As a second safeguard, the token of an
account is removed from every error text before it is shown or stored: a failed sign-in, the steps and the error of
a failed scan, and the "not scanned" entries of a stored scan.
Deleting. costmap accounts remove ID deletes the scans of that account and its stored token. The
Settings page deletes all stored scans. Removing the data directory removes everything except keychain
entries.
CostMap connects to:
- AWS, with the credentials of the profile: the service APIs in the scanned regions (List, Describe and Get
calls), CloudWatch
GetMetricStatistics, and the Price List Query API inus-east-1(witheu-central-1as fallback). The AWS SDK may contact further AWS endpoints to obtain the credentials of the profile. - UpCloud,
api.upcloud.com, with the API token, GET requests only. - Google Cloud, with Application Default Credentials or the service-account key: GET requests to
compute.googleapis.com,sqladmin.googleapis.com,storage.googleapis.com,container.googleapis.com,monitoring.googleapis.com,gkebackup.googleapis.com,run.googleapis.com,cloudbilling.googleapis.com(the public price catalog) andcloudresourcemanager.googleapis.com; with user credentials alsoopenidconnect.googleapis.comto show which Google account signs in. The Google sign-in library exchanges the credentials for a token atoauth2.googleapis.comand, without other credentials, may ask the metadata server of a Google Cloud VM. - Only in CostMap Pro, only for an account where you switch it on ("Billed vs estimate"): AWS Cost Explorer
(
ce.us-east-1.amazonaws.com,GetCostAndUsage, two requests per scan, which AWS bills at USD 0.01 each) with the profile of the account, and BigQuery (bigquery.googleapis.com, one read-only query of your Cloud Billing export per scan, after a dry run) with the Google credentials of the account. The UpCloud billing summary of the month before is one more GET toapi.upcloud.com. The open edition never makes these requests. - The European Central Bank,
www.ecb.europa.eu, to download the daily reference rate file. No account data is sent. - AWS, with the profile you pick to create the access from the page:
sts:GetCallerIdentity,iam:GetRoleand CloudFormationDescribeStacksandDescribeStackEvents, all reads (see "Adding AWS from the page"). The template itself is read by AWS frommoveinfra-costmap-templates.s3.eu-central-1.amazonaws.com, not by CostMap.
The source contains no other outbound request: no telemetry, no update check, no licence activation. The Prices tab has two links to moveinfra.eu (the EU Cloud Price Index); they open only when you click them. The comparison "On EU clouds" uses the copy of the index built into the binary and fetches nothing; its link "Book a free call about the move" opens moveinfra.eu only when you click it and sends nothing.
The local page listens on 127.0.0.1 only and refuses any other address. The link printed at start contains a
single-use code that signs one browser in; after that the session is held in a cookie. The link can be opened from
another program or page: CostMap answers with a short page that continues by itself and has a "Continue to CostMap"
link. Requests that another site starts are refused; a link from another site to the page itself leads to a
"Continue" page, never to the data.
The official build adds, besides more accounts and the AI advisor, "Billed vs estimate" (what each provider billed
this month and last month next to the estimate, by service; for AWS from Cost Explorer and for Google Cloud from the
Cloud Billing export in BigQuery, both switched on per account) and a report for all accounts as one HTML file. The
open edition shows them as "Available in CostMap Pro" and makes none of their requests. The optional AWS statement
they need is in docs/iam-policy-billed.json (costmap policy billed).
The open edition runs the free plan: 1 connected account (the demo accounts do not count). Adding a second one is
refused with a message that says so; accounts beyond the limit (for example from a configuration made elsewhere) keep
their data but are not scanned, and costmap scan ends with exit code 4 when no requested account is within the
limit. There is no licence key in the open edition.
Bug reports and pull requests are welcome: see CONTRIBUTING.md. Report security issues privately as described in SECURITY.md. CostMap is licensed under the Apache License 2.0.