Skip to content

Commit

Permalink
Consider resource provider when locating expected state.
Browse files Browse the repository at this point in the history
When trying to find the resource state when verifying imports, take the
resource's provider into consideration.

This is a backport of #522.
  • Loading branch information
paddycarver committed Sep 4, 2020
1 parent 1dcf900 commit ce82e5b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/resource/testing_new_import_state.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ func testStepNewImportState(t *testing.T, c TestCase, wd *tftest.WorkingDir, ste
// Find the existing resource
var oldR *terraform.ResourceState
for _, r2 := range old {
if r2.Primary != nil && r2.Primary.ID == r.Primary.ID && r2.Type == r.Type {
if r2.Primary != nil && r2.Primary.ID == r.Primary.ID && r2.Type == r.Type && r2.Provider == r.Provider {
oldR = r2
break
}
Expand Down

0 comments on commit ce82e5b

Please sign in to comment.