Support implicit dependency based on top level resource_group_name attribute
#639
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.
The dependency injection logic now also add supports for replacing the top level
resource_group_name's value by a reference to the resource'snameattribute if that resource's name has the same value, and that resource is a resource group.This is almost only relevant to
azurermprovider asazapiprovider has no such top level attribute.Note that we support for
resource_group_namebased on the fact that this is a well known attribute inazurermto represent the residing resource group's name of the current resource. That's also the reason why we only support it at the top level, since there can be resources who has nested block, that also expose aresource_group_nameand asubscription_id(e.g.azurerm_data_share_dataset_blob_storage), in which case the actual resource group can be different than the resource group in the current exported resource list (i.e. they have the same name, but from the different subscriptions).Example
Before
Now
Fix #131