diff --git a/internal/backend/testing.go b/internal/backend/testing.go index af9f355114..843adad64a 100644 --- a/internal/backend/testing.go +++ b/internal/backend/testing.go @@ -13,7 +13,7 @@ import ( "github.com/hashicorp/hcl/v2/hcldec" "github.com/hashicorp/terraform/internal/addrs" - "github.com/hashicorp/terraform/internal/configs" + "github.com/hashicorp/terraform/internal/configs/configtesting" "github.com/hashicorp/terraform/internal/configs/hcl2shim" "github.com/hashicorp/terraform/internal/states" "github.com/hashicorp/terraform/internal/states/statemgr" @@ -68,7 +68,7 @@ func TestBackendConfig(t *testing.T, b Backend, c hcl.Body) Backend { // this function will panic. func TestWrapConfig(raw map[string]interface{}) hcl.Body { obj := hcl2shim.HCL2ValueFromConfigValue(raw) - return configs.SynthBody("", obj.AsValueMap()) + return configtesting.SynthBody("", obj.AsValueMap()) } // TestBackend will test the functionality of a Backend. The backend is diff --git a/internal/configs/synth_body.go b/internal/configs/configtesting/synth_body.go similarity index 99% rename from internal/configs/synth_body.go rename to internal/configs/configtesting/synth_body.go index 479251b2df..39e61a1553 100644 --- a/internal/configs/synth_body.go +++ b/internal/configs/configtesting/synth_body.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -package configs +package configtesting import ( "fmt" diff --git a/internal/configs/synth_body_test.go b/internal/configs/configtesting/synth_body_test.go similarity index 98% rename from internal/configs/synth_body_test.go rename to internal/configs/configtesting/synth_body_test.go index cbf842d2fd..5c708bb42d 100644 --- a/internal/configs/synth_body_test.go +++ b/internal/configs/configtesting/synth_body_test.go @@ -1,7 +1,7 @@ // Copyright (c) HashiCorp, Inc. // SPDX-License-Identifier: BUSL-1.1 -package configs +package configtesting import ( "testing" diff --git a/internal/configs/util.go b/internal/configs/util.go index 019f57598e..5315ac1a0f 100644 --- a/internal/configs/util.go +++ b/internal/configs/util.go @@ -6,6 +6,9 @@ package configs import ( "github.com/hashicorp/hcl/v2" "github.com/hashicorp/hcl/v2/hclsyntax" + "github.com/zclconf/go-cty/cty" + + "github.com/hashicorp/terraform/internal/configs/configtesting" ) // exprIsNativeQuotedString determines whether the given expression looks like @@ -64,3 +67,13 @@ func schemaWithDynamic(schema *hcl.BodySchema) *hcl.BodySchema { return ret } + +// SynthBody is a forwarding alias for the old location of +// [configtesting.SynthBody]. +// +// Using the new name is preferable because it might avoid you needing to +// import this entire configs package, if you didn't have some other +// use for it anyway. +func SynthBody(filename string, values map[string]cty.Value) hcl.Body { + return configtesting.SynthBody(filename, values) +}