helper/resource: Prevent Inconsistent dependency lock file
errors when using ExternalProviders
outside the hashicorp
namespace
#1057
+860
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Reference: https://discuss.hashicorp.com/t/acceptance-testing-sdk-framework-upgrade-issue/44166
Reference: https://www.terraform.io/plugin/framework/migrating/testing
By default, Terraform CLI will use the
registry.terraform.io
hostname andhashicorp
namespace for provider addresses if there is not aterraform
configuration block with an explicit configuration. Previously, the testing framework would automatically generate a temporary configuration with theterraform
configuration block for runningterraform init
, but it did not include this extra configuration along with a givenTestStep
Config
. When working withhashicorp
namespace providers, this isn't an issue because of the Terraform CLI defaults.External provider developers could manually workaround this issue by including the
terraform
configuration block as part of theirTestStep
Config
, however this is certainly confusing and error prone.This issue is especially pertinent now as the sdk/v2 to framework migration guide shows acceptance testing which uses
ExternalProviders
extensively for proving successful migrations without plan differences.Previously before code adjustments: