cfn-format
« Back to VersTracker
Description:
Command-line tool for formatting AWS CloudFormation templates
Type: Formula  |  Latest Version: 1.24.1@0  |  Tracked Since: Dec 17, 2025
Links: Homepage  |  @AWSCloudForm  |  formulae.brew.sh
Category: Devops
Tags: aws cloudformation devops formatting infrastructure-as-code
Install: brew install cfn-format
About:
cfn-format is a command-line utility that formats AWS CloudFormation templates into a clean, consistent, and readable structure. It parses templates and rewrites them with standardized indentation and ordering of keys, making them easier to maintain and review. The tool is part of the Rain suite, which provides a powerful set of commands for managing CloudFormation infrastructure.
Key Features:
  • Standardizes indentation and whitespace for readability
  • Sorts keys and attributes for consistent diffs
  • Supports both JSON and YAML input formats
  • Integrates into CI/CD pipelines for enforcing style guides
Use Cases:
  • Enforcing a consistent style guide across CloudFormation templates in a team
  • Automating template cleanup as a pre-commit hook
  • Preparing templates for version control by ensuring clean, predictable diffs
Alternatives:
  • cfn-lint – cfn-lint focuses on validating templates for errors and best practices, while cfn-format focuses on stylistic formatting.
  • yamlfmt – yamlfmt is a general-purpose YAML formatter that can be configured for CloudFormation, whereas cfn-format is CloudFormation-aware.
Version History
Detected Version Rev Change Commit
Oct 10, 2025 3:00am 0 VERSION_BUMP 4590f903
Sep 13, 2025 7:15am 0 VERSION_BUMP 64190d2d
Jan 11, 2025 10:33am 0 VERSION_BUMP f6ea1f8e
Jan 11, 2025 4:02am 0 VERSION_BUMP 57d8c7f5
Dec 18, 2024 10:50am 0 VERSION_BUMP 0c718caa
Dec 18, 2024 4:08am 0 VERSION_BUMP f01c31f6
Dec 17, 2024 10:06am 0 VERSION_BUMP 6e2498da
Dec 17, 2024 3:28am 0 VERSION_BUMP 31f5449b
Dec 16, 2024 5:33pm 0 VERSION_BUMP 1af721f1
Oct 30, 2024 8:21am 0 VERSION_BUMP 8b68b297
Oct 30, 2024 1:38am 0 VERSION_BUMP 0b0943bb
Oct 23, 2024 1:23am 0 VERSION_BUMP cac58862