mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
8ca1fcec51
This is an alternative to the full config loader in the "configs" package that is good for "early" use-cases like "terraform init", where we want to find out what our dependencies are without getting tripped up on any other errors that might be present.
21 lines
1.1 KiB
Go
21 lines
1.1 KiB
Go
// Package earlyconfig is a specialized alternative to the top-level "configs"
|
|
// package that does only shallow processing of configuration and is therefore
|
|
// able to be much more liberal than the full config loader in what it accepts.
|
|
//
|
|
// In particular, it can accept both current and legacy HCL syntax, and it
|
|
// ignores top-level blocks that it doesn't recognize. These two characteristics
|
|
// make this package ideal for dependency-checking use-cases so that we are
|
|
// more likely to be able to return an error message about an explicit
|
|
// incompatibility than to return a less-actionable message about a construct
|
|
// not being supported.
|
|
//
|
|
// However, its liberal approach also means it should be used sparingly. It
|
|
// exists primarily for "terraform init", so that it is able to detect
|
|
// incompatibilities more robustly when installing dependencies. For most
|
|
// other use-cases, use the "configs" and "configs/configload" packages.
|
|
//
|
|
// Package earlyconfig is a wrapper around the terraform-config-inspect
|
|
// codebase, adding to it just some helper functionality for Terraform's own
|
|
// use-cases.
|
|
package earlyconfig
|