→ Back to Home
Infrastructure as Code

Infracost CLI v2 now reads CloudFormation

The latest release of Infracost CLI, version 2, introduces native support for AWS CloudFormation, a significant expansion of its capabilities for Infrastructure as Code (IaC) cost management. Prior to this update, Infracost was primarily known for providing detailed cost estimates for Terraform configurations, empowering developers to understand and optimize their cloud spending proactively. This new version brings the same "shift-left" FinOps approach to the vast community of CloudFormation users. Developers working with CloudFormation templates can now leverage Infracost CLI v2 to gain immediate visibility into the potential costs of their infrastructure. The tool is designed to be user-friendly, requiring users to simply point the CLI at their template directory. It intelligently detects the type of IaC framework being used—whether Terraform, Terragrunt, or CloudFormation—and proceeds to analyze the resources defined within the templates. A key feature of Infracost CLI v2 is its ability to price resources against live cloud pricing data. This ensures that the cost estimates are accurate and up-to-date, reflecting the dynamic nature of cloud service pricing. Importantly, the CLI performs its parsing and analysis locally, meaning no cloud credentials or sensitive information ever leave the user's machine, addressing critical security and privacy concerns. The introduction of CloudFormation support is aimed at tackling a common pain point for organizations: unexpected cloud bills. By integrating cost analysis directly into the development workflow, Infracost helps prevent costly mistakes such as using oversized instances, incorrect storage tiers, or forgotten NAT gateways. It allows engineers to identify and rectify these issues before deployment, when the cost of correction is minimal. Furthermore, Infracost CLI v2 supports advanced features like FinOps and tagging policies. Users can inspect their infrastructure for missing tags or policy violations, which are crucial for cost allocation and governance. The tool also caches results locally, providing instant feedback for subsequent inspections. For those using AWS CDK, the process involves synthesizing the CDK code to CloudFormation templates first, and then pointing Infracost at the generated output. This update democratizes cloud cost visibility, making it accessible to a broader range of IaC practitioners and fostering a more cost-aware development culture.
#cloudformation#infracost#cost management#finops#infrastructure as code#cli
Read original source