mirror of
https://github.com/opentofu/opentofu.git
synced 2025-01-07 22:53:08 -06:00
bbde0537d1
implemented ResourceImporter for sub resources which extracts the lb id deprecated location on each sub resource as it was unused
36 lines
861 B
Go
36 lines
861 B
Go
package azurerm
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAzureRMLoadBalancerProbe_importBasic(t *testing.T) {
|
|
resourceName := "azurerm_lb_probe.test"
|
|
|
|
ri := acctest.RandInt()
|
|
probeName := fmt.Sprintf("probe-%d", ri)
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMLoadBalancerDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccAzureRMLoadBalancerProbe_basic(ri, probeName),
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
// location is deprecated and was never actually used
|
|
ImportStateVerifyIgnore: []string{"location"},
|
|
},
|
|
},
|
|
})
|
|
}
|