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
913 B
Go
36 lines
913 B
Go
package azurerm
|
|
|
|
import (
|
|
"fmt"
|
|
"testing"
|
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
)
|
|
|
|
func TestAccAzureRMLoadBalancerRule_importBasic(t *testing.T) {
|
|
resourceName := "azurerm_lb_rule.test"
|
|
|
|
ri := acctest.RandInt()
|
|
lbRuleName := fmt.Sprintf("LbRule-%s", acctest.RandStringFromCharSet(8, acctest.CharSetAlpha))
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
Providers: testAccProviders,
|
|
CheckDestroy: testCheckAzureRMLoadBalancerDestroy,
|
|
Steps: []resource.TestStep{
|
|
resource.TestStep{
|
|
Config: testAccAzureRMLoadBalancerRule_basic(ri, lbRuleName),
|
|
},
|
|
|
|
resource.TestStep{
|
|
ResourceName: resourceName,
|
|
ImportState: true,
|
|
ImportStateVerify: true,
|
|
// location is deprecated and was never actually used
|
|
ImportStateVerifyIgnore: []string{"location"},
|
|
},
|
|
},
|
|
})
|
|
}
|