Get region from provider in case of import (or in case of not-set-in-resource) (#1447)

This commit is contained in:
Nathan McKinley 2018-05-08 11:23:35 -07:00 committed by GitHub
parent 9cb159f992
commit b3ceef76ee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 1 deletions

View File

@ -295,7 +295,10 @@ func getRegionalManager(d *schema.ResourceData, meta interface{}) (*computeBeta.
return nil, err
}
region := d.Get("region").(string)
region, err := getRegion(d, config)
if err != nil {
return nil, err
}
manager := &computeBeta.InstanceGroupManager{}
switch computeApiVersion {

View File

@ -113,6 +113,12 @@ func TestAccRegionInstanceGroupManager_update(t *testing.T) {
&manager),
),
},
resource.TestStep{
ResourceName: "google_compute_region_instance_group_manager.igm-update",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"update_strategy"},
},
},
})
}