c3x

package module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 27, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

README

C3X

Cloud cost estimation with built-in optimization recommendations, budget guardrails, what-if analysis, and fully offline mode — no API key required.

Docs Docker pulls Community Slack channel

Get started

# macOS / Linux
brew install c3xdev/tap/c3x

# Docker
docker pull c3xdev/c3x

# Or download from GitHub Releases
# https://github.com/c3xdev/c3x/releases
c3x estimate --path /path/to/terraform

See our quick start guide for more details.

What makes C3X different

Cost optimization recommendations

C3X doesn't just show costs — it suggests how to save money.

c3x recommend --path .
# Or inline with estimate:
c3x estimate --path . --recommend
3 recommendation(s) found:

  1. Upgrade to newer instance generation (m5.xlarge -> m7i.xlarge)
     Resource: aws_instance.web (aws_instance)
     The m7i family has better price-performance than m5.

  2. Switch EBS volume from gp2 to gp3
     Resource: aws_ebs_volume.data (aws_ebs_volume)
     gp3 volumes are up to 20% cheaper with better baseline performance.

  3. Consider VPC endpoints to reduce NAT Gateway costs
     Resource: aws_nat_gateway.main (aws_nat_gateway)
     NAT Gateway charges $0.045/GB. VPC endpoints can eliminate these charges.

Budget guardrails in CI/CD

Enforce cost limits in your pipeline — no paid subscription required.

# Fail the pipeline if monthly cost exceeds $1,000
c3x estimate --path . --budget 1000

# Fail if cost increases more than 20%
c3x diff --path . --compare-to baseline.json --budget-increase 20

What-if cost scenarios

Explore cost impact of changes without modifying Terraform code.

# What if we use a bigger instance?
c3x estimate --path . --what-if 'aws_instance.web.instance_type=m6i.8xlarge'

# What if we enable multi-AZ?
c3x estimate --path . --what-if 'aws_db_instance.main.multi_az=true'

Fully offline mode

Download pricing data once, estimate forever. No network calls, no telemetry, no API key.

# Download pricing data (~50MB)
c3x pricing sync --providers aws,azure

# Estimate without any network calls
c3x estimate --path . --offline

Self-hosted pricing API

C3X includes an independent pricing API that scrapes directly from AWS, Azure, and GCP public pricing APIs. Run it yourself for complete independence.

export C3X_SELF_HOSTED=true
export C3X_PRICING_API_ENDPOINT=http://localhost:4000
c3x estimate --path .

Core features

Cost estimates in your terminal

c3x estimate --path /code
C3X estimate command

Cost diffs before you deploy

c3x diff --path /code --compare-to baseline.json
C3X diff command

PR comments in CI/CD

Post cost estimates automatically in pull requests. Works with GitHub Actions, GitLab CI, Bitbucket Pipelines, Azure Pipelines, Atlantis, and Spacelift.

C3X in GitHub Actions

Supported clouds and resources

C3X supports over 1,100 Terraform resources across AWS, Azure, and Google Cloud.

C3X can also estimate usage-based resources such as AWS S3, Lambda, and data transfer.

Roadmap

  • Compare to real cloud bills — Validate estimates against AWS Cost Explorer / Azure Cost Management
  • More IaC support — Pulumi, AWS CDK, Azure Bicep
  • Historical cost tracking — Cost trends across commits and PRs
  • IDE extensions — VS Code, JetBrains inline cost estimates

Community

Join our community Slack channel to learn more about cost estimation, ask questions, and connect with other users and contributors.

Contributing

We welcome contributions big and small. Please start by opening a thread in GitHub Discussions before submitting a PR. See our contribution guide for details.

License

Apache License 2.0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetReferenceUsageFileContents

func GetReferenceUsageFileContents() *[]byte

Types

This section is empty.

Directories

Path Synopsis
cmd
c3x command
jsonschema command
resourcecheck command
resourcegen command
internal
hclstack/codegen
Contains routines for generating terraform code
Contains routines for generating terraform code
hclstack/collections
Package collections provides generic collection utility functions.
Package collections provides generic collection utility functions.
hclstack/errtrace
Package errtrace provides error wrapping with stack trace capture.
Package errtrace provides error wrapping with stack trace capture.
hclstack/fileutil
Package fileutil provides file system utility functions.
Package fileutil provides file system utility functions.
hclstack/terraform
Package tfr contains functions and routines for interacting with terraform registries using the Module Registry Protocol documented in the official terraform docs: https://www.terraform.io/docs/internals/module-registry-protocol.html
Package tfr contains functions and routines for interacting with terraform registries using the Module Registry Protocol documented in the official terraform docs: https://www.terraform.io/docs/internals/module-registry-protocol.html
hclstack/verutil
Package verutil provides version information for the hclstack module.
Package verutil provides version information for the hclstack module.
localpricing
Package localpricing provides a local SQLite-based pricing database for offline cost estimation.
Package localpricing provides a local SQLite-based pricing database for offline cost estimation.
modsource
getter is a package for downloading files or directories from a variety of protocols.
getter is a package for downloading files or directories from a variety of protocols.
recommend
Package recommend provides cost optimization recommendations based on estimated resources.
Package recommend provides cost optimization recommendations based on estimated resources.
ui
vcs
whatif
Package whatif provides resource attribute override functionality for cost scenario analysis.
Package whatif provides resource attribute override functionality for cost scenario analysis.
tools
describezones command
release command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL