mirror of https://github.com/hashicorp/terraform
Merge pull request #7578 from hashicorp/import-arm-publicip
provider/azurerm: Support Import for `azurerm_public_ip`pull/7582/head
commit
6cc2a52810
@ -0,0 +1,34 @@
|
|||||||
|
package azurerm
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/hashicorp/terraform/helper/acctest"
|
||||||
|
"github.com/hashicorp/terraform/helper/resource"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestAccAzureRMPublicIpStatic_importBasic(t *testing.T) {
|
||||||
|
resourceName := "azurerm_public_ip.test"
|
||||||
|
|
||||||
|
ri := acctest.RandInt()
|
||||||
|
config := fmt.Sprintf(testAccAzureRMVPublicIpStatic_basic, ri, ri)
|
||||||
|
|
||||||
|
resource.Test(t, resource.TestCase{
|
||||||
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
|
Providers: testAccProviders,
|
||||||
|
CheckDestroy: testCheckAzureRMPublicIpDestroy,
|
||||||
|
Steps: []resource.TestStep{
|
||||||
|
resource.TestStep{
|
||||||
|
Config: config,
|
||||||
|
},
|
||||||
|
|
||||||
|
resource.TestStep{
|
||||||
|
ResourceName: resourceName,
|
||||||
|
ImportState: true,
|
||||||
|
ImportStateVerify: true,
|
||||||
|
ImportStateVerifyIgnore: []string{"resource_group_name"},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
Loading…
Reference in new issue