Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
command/fmt: Make implicit provider requirements explicit
Ever since Terraform v0.13 we've been recommending that module authors be explicit about which providers their modules are intended to work with, but we retained some heuristics for detecting undeclared dependencies on official providers for backward compatibility with modules intended for Terraform v0.12 and earlier. In the intervening years we've found that those heuristics have caused a lot of confusion, because Terraform tends not to be clear about what guesses it is making but then returns confusing error messages that only make sense if you are already an expert on Terraform's compatibility heuristics. These have been some of the most frequently asked questions about Terraform in community forums over the years. In an attempt to make these rules easier to understand, "terraform fmt" will now run the same heuristics and then generate explicit declarations reflecting what it detected. This makes it explicit that it's good style to declare your dependencies explicitly, and also gives new users a clearer signal about what Terraform is guessing so that they have a better chance of learning what they might need to change if Terraform's guesses were not correct.
- Loading branch information