forked from hashicorp/terraform-config-inspect
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
OPS-8302 Merge upstream to support TF 1.x syntax (#11)
* deps: Migrate from github.com/hashicorp/hcl2 to github.com/hashicorp/hcl/v2 (hashicorp#34) Reference: https://github.com/hashicorp/hcl2#experimental-hcl2 * contributing: terraform-config-inspect is feature complete (hashicorp#35) * terraform.required_providers provider source (hashicorp#37) * tfconfig: add parser for new (optional) required_providers syntax This is a breaking change: module.ProviderRequirements is now a map[string]ProviderRequirement instead of map[string][]string, and the json output has changed accordingly. The following syntaxes are now supported: terraform { required_providers { // new syntax "cloud" = { source = "hashicorp/cloud" version = "1.0.0" } // original syntax is also supported "cloud" = "1.0.0" } } * Fix Markdown rendering * Cleanup Readme formatting * Standardize directory for test data Use standard name for fixtures dir per Go conventions https://golang.org/cmd/go/#hdr-Test_packages * Migrate to Circle * fix: disambiguate variable defaults with "empty" values from undefined (hashicorp#24) - Variable struct and json representation now have an explicit `required` field to disambiguate between a variable with a default value which may either be `null` or the variable type's zero value * Merge source across required_providers blocks If multiple terraform.required_providers blocks are in the config, we already merge the version constraints for each provider. We should also merge the source attribute, and warn if there are duplicates. Consider the following configuration: terraform { required_providers { foo = { version = "1.0.0" } } } terraform { required_providers { foo = { source = "abc/foo" } } } Before this commit, this would result in a provider requirement for "foo" with version constraint "1.0.0", but no "source". This commit merges the source attribute from the second block into this requirement. * Multiple provider source attributes is an error Previously we were diagnosing multiple provider different provider source attribute values as a warning, but this is really a configuration error. This commit updates the diagnostic to be an error, and adds a forced failure in the legacy parser when a `required_providers` block is encountered to ensure that the error propagates. * Allow parsing module from any filesystem (hashicorp#49) * Allow parsing from any filesystem * avoid caching parsed files * Expose lower-level hcl.File load function (hashicorp#53) * Support the sensitive attribute on outputs (hashicorp#55) (hashicorp#56) Add a "sensitive" attribute to outputs. If sensitive is not specified or is false it will not be present in the Output object as per omitempty behavior. * tfconfig: decode provider aliases (hashicorp#54) * allow parsing of required_providers containing ref The syntax for configuration_aliases contains bare references to match their use in other parts of the configuration. These however cannot be decoded directly without an EvalContext, as they represent variables. Refactor decodeRequiredProvidersBlock to use the lower level ExprMap function. * Expose configuration_aliases from required_providers (hashicorp#60) * README: The latest releases of this library support the Terraform v0.15 language * README: This library is compatible with the Terraform 1.0 language * README: Updated note about compatibility We now have 1.0 compatibility promises, so we can be more specific in what this library can do. * Parse the sensitive key for input variables * Remove Sensitive property for legacy modules * Update CircleCI config to fix build failures * Give up on 1.11.13, replace with 1.17.3 * update circle config and docker mirror * Fixup after merge Co-authored-by: Brian Flad <bflad417@gmail.com> Co-authored-by: Kristin Laemmert <mildwonkey@users.noreply.github.com> Co-authored-by: Radek Simko <radek.simko@gmail.com> Co-authored-by: Michele <mdeggies@gmail.com> Co-authored-by: Jonathan Stewmon <jstewmon@gmail.com> Co-authored-by: Alisdair McDiarmid <alisdair@users.noreply.github.com> Co-authored-by: Andy Caruso <63117216+andy-caruso@users.noreply.github.com> Co-authored-by: James Bardin <j.bardin@gmail.com> Co-authored-by: Martin Atkins <mart@degeneration.co.uk> Co-authored-by: Kyle Carberry <kyle@carberry.com>
- Loading branch information
1 parent
a8bb737
commit 7dbd629
Showing
55 changed files
with
374 additions
and
1,376 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 |
---|---|---|
@@ -1,13 +1,16 @@ | ||
module github.com/HeadspaceMeditation/terraform-config-inspect | ||
|
||
require ( | ||
github.com/agext/levenshtein v1.2.2 // indirect | ||
github.com/go-test/deep v1.0.3 | ||
github.com/google/go-cmp v0.3.0 // indirect | ||
github.com/hashicorp/hcl v0.0.0-20170504190234-a4b07c25de5f | ||
github.com/hashicorp/hcl/v2 v2.7.0 | ||
github.com/hashicorp/hcl2 v0.0.0-20190821123243-0c888d1241f6 | ||
github.com/hashicorp/terraform-config-inspect v0.0.0-20201102131242-0c45ba392e51 | ||
github.com/hashicorp/hcl/v2 v2.0.0 | ||
github.com/kylelemons/godebug v1.1.0 // indirect | ||
github.com/mitchellh/go-wordwrap v1.0.0 // indirect | ||
github.com/spf13/pflag v1.0.3 | ||
github.com/zclconf/go-cty v1.2.0 | ||
github.com/stretchr/testify v1.3.0 // indirect | ||
github.com/zclconf/go-cty v1.1.0 | ||
) | ||
|
||
go 1.13 |
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
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
Oops, something went wrong.