Skip to main content

cloudfit-provider-aws

PyPI version Tests License: Apache 2.0

AWS EC2 provider plugin for cloudfit-core.

Reads AWS's public EC2 price list and normalizes every Linux instance type into MachineType objects that cloudfit-core understands, with on-demand and 1-year reserved prices, each family's perf_factor, and each GPU's model and memory. No AWS account or credentials needed.


Installation

pip install cloudfit-provider-aws

Requires Python 3.10 or newer (CI tests 3.10 through 3.14) and cloudfit-core>=0.9.1. The only dependency is cloudfit-core: no AWS SDK.


Quick start

from cloudfit import WorkloadProfile, rank
from cloudfit_provider_aws import AWSProvider

candidates = AWSProvider().fetch_instances(region="us-east-1")

profile = WorkloadProfile(vcpu=32, ram_gb=128, archetype="cpu", optimize_for="balanced")
for result in rank(profile, candidates)[:5]:
    m = result.instance
    print(f"{m.id:<20} score={result.score:.3f}  ${m.price_hr:.4f}/hr  {result.reason}")

Output from a live run (2026-10-23):

m6i.8xlarge          score=1.000  $1.5360/hr  Led by performance fit.
m6id.8xlarge         score=0.999  $1.8984/hr  Led by performance fit.
m6in.8xlarge         score=0.999  $2.2277/hr  Led by performance fit.
m6idn.8xlarge        score=0.998  $2.5459/hr  Led by performance fit.
m7g.8xlarge          score=0.990  $1.3056/hr  Led by performance fit; m7g.8xlarge cores ~10% faster than baseline.

The same script is examples/recommend.py.


Where the data comes from

AWS publishes each region's full EC2 offer as a public price list file. Every row is one price term and also carries the instance's attributes, so one file gives both the catalog and its prices. The files are large (about 300 MB for us-east-1), so the provider streams them row by row; a region takes roughly 15 to 20 seconds and is cached on the provider instance. Fetch on a schedule, never on a request path.

Each MachineType carries:

Field Source
vcpu, ram_gb vCPU and memory attributes
price_hr on-demand Linux price, shared tenancy
cud_1yr_price_hr 1-year standard No Upfront reserved price (cloudfit-core's 1-year commitment mode); unset when AWS offers none
local_ssd_tb instance store SSDs (HDD and EBS-only count as 0)
gpu_count, gpu_vram_gb, gpu_type GPU attributes; model and per-GPU memory from a per-family table (below)
status active, or deprecated for previous-generation types
perf_factor cloudfit-core's AWS_PERF_FACTORS, via perf_factor_for

GPUs. The price list has no GPU model column, and its GPU memory column is the total across GPUs for some families and per GPU for others. So known families (p2 through p6-b200, g2 through g6e) take their model and per-GPU memory from a table: a p4d is 8 × A100 40 GB, not 8 GPUs with 320 GB each. A GPU family newer than the table keeps its GPU count, splits the column's memory across the GPUs, and has no model, so cloudfit-core scores it on memory fit instead of throughput.

Previous generations are deprecated, which lowers their availability score; AWS keeps them running, so none is ever tombstoned.


Not included

Why
Spot prices They vary by availability zone and by hour, and are not in the public price list. Planned for a later release.
Savings Plans, 3-year and partial or all upfront reservations cloudfit-core has one 1-year commitment price per instance; 1-year No Upfront is the closest match.
Windows, RHEL, SUSE, and other paid operating systems Linux only, like the GCP provider.
Inferentia, Trainium, Gaudi, FPGA, video transcode, and Mac instances cloudfit does not model these accelerators (the price list reports some of them as GPUs).
Fractional-GPU instances (g6f, gr6f) MachineType has a whole-number GPU count.
Local Zones, Wavelength, GovCloud Not in AWS_REGIONS; pass a region code directly to try one.

Snapshots

examples/generate_snapshot.py writes a JSON snapshot in the same format as cloudfit-provider-gcp's, for the five SNAPSHOT_REGIONS (us-east-1, us-east-2, us-west-2, eu-west-1, ap-southeast-1) by default. It takes about a minute and writes about 6,000 instance types; it fails without writing anything if any region comes back empty.

python examples/generate_snapshot.py --output aws_snapshot.json

Rows are sorted by region and instance type, so a refresh diff shows only real changes.

The refresh-snapshot workflow rebuilds the snapshot bundled by cloudfit-api and cloudfit-ui every Monday at 07:00 UTC and opens a pull request in each, where CI runs on it. It needs no AWS credentials, only a SNAPSHOT_TOKEN secret that can open pull requests in those two repos (see the comments in the workflow file).

fetch_instances_all_regions() covers all 34 regions in AWS_REGIONS (about 30 downloads), or the list you pass.


Repository structure

cloudfit-provider-aws/
├── README.md
├── CHANGELOG.md             # release notes; GitHub Releases are built from it
├── CITATION.cff
├── pyproject.toml
├── Makefile                 # version bump, tag, test, lint, build
├── LICENSE
├── .gitignore
├── .github/
│   ├── dependabot.yml       # monthly GitHub Actions updates
│   ├── ISSUE_TEMPLATE/      # AWS coverage requests and scope feedback
│   └── workflows/
│       ├── ci.yml           # lint, mypy --strict, tests; PyPI publish and release on tags
│       └── refresh-snapshot.yml   # weekly snapshot PRs to cloudfit-api and cloudfit-ui
│
├── cloudfit_provider_aws/
│   ├── __init__.py          # exports AWSProvider, parse_price_list, regions
│   ├── provider.py          # AWSProvider: implements the Provider base class
│   ├── pricelist.py         # streams and filters the public price list CSV
│   ├── normalizer.py        # price list attributes → MachineType, GPU table
│   ├── regions.py           # AWS_REGIONS and SNAPSHOT_REGIONS
│   └── py.typed             # ships type hints (PEP 561)
│
├── examples/
│   ├── recommend.py         # live fetch → rank
│   └── generate_snapshot.py # build a snapshot for the five snapshot regions
│
└── tests/
    ├── test_pricelist.py    # parsing and filtering, against recorded rows
    ├── test_normalizer.py   # field mapping, GPUs, storage, exclusions
    ├── test_provider.py     # caching, region failures, ranking with cloudfit-core
    └── fixtures/
        └── us-east-1-sample.csv   # recorded slice of the us-east-1 price list

License

Apache 2.0. See LICENSE.

Metadata

Release files for cloudfit-provider-aws 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cloudfit-provider-aws 0.1.1
File Size Uploaded Provenance
cloudfit_provider_aws-0.1.1.tar.gz 32.5 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for cloudfit-provider-aws 0.1.1
File Interpreter ABI Platform
cloudfit_provider_aws-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 48.2 kB

Release files / cloudfit_provider_aws-0.1.1.tar.gz

Download URL cloudfit_provider_aws-0.1.1.tar.gz
Size 32.5 kB
Tags Source
SHA-256 checksum
How to use checksums
dbcdec596ddf11f96a1b05049b3e49837c0af22d5e645bb74f761d463b3ec8af
BLAKE2b-256 checksum
How to use checksums
d9f56289df77835b30d9454b8f3e8db8effaf96b7bca87aa2cd19ccfda40af1d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Release files / cloudfit_provider_aws-0.1.1-py3-none-any.whl

Download URL cloudfit_provider_aws-0.1.1-py3-none-any.whl
Size 15.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
49964c3c45810950c968dc54772cce37d8a11c4412653388d59c50648063ec85
BLAKE2b-256 checksum
How to use checksums
327007f95e4a419d0aae593796d9171d000af39b796291e97fc6e434d6b8748c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

Security for cloudfit-provider-aws 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for cloudfit_provider_aws-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page