Format all files recursively and fail if anything needs formatting?
BeginnerProductionRapid-Fire Commands
Answer
terraform fmt -check -recursive -diff
Exit code 3 means files need formatting. Drop -check to rewrite them in place.
More on Rapid-Fire Commands
List every resource address under one module?BeginnerShow the attributes of one resource in state?BeginnerPlan with a specific var file and write the plan?BeginnerValidate configuration and get machine-readable output?BeginnerApply a saved plan and inspect it as JSON first?BeginnerForce the replacement of a single resource?Beginner