-
Notifications
You must be signed in to change notification settings - Fork 9.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
configs: Hint for a misplaced top-level required_providers block
With provider dependencies now appearing inside a nested block, it seems likely that configuration examples showing dependencies out of context will sometimes mislead users into thinking that required_providers is toplevel. To give better feedback in that situation, we'll produce a specialized error in that case hinting the correct structure to the user.
- Loading branch information
1 parent
2be6a5f
commit 3a8c4f4
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# A top-level required_providers block is not valid, but we have a specialized | ||
# error for it to hint the user to move it into a terraform block. | ||
required_providers { # ERROR: Invalid required_providers block | ||
} | ||
|
||
# This one is valid, and what the user should rewrite the above to be like. | ||
terraform { | ||
required_providers {} | ||
} |