Merge pull request #7574 from hashicorp/import-arm-rg
provider/azurerm: Support Import of `azurerm_resource_group`
This commit is contained in:
commit
4798b13937
|
@ -0,0 +1,33 @@
|
|||
package azurerm
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAzureRMResourceGroup_importBasic(t *testing.T) {
|
||||
resourceName := "azurerm_resource_group.test"
|
||||
|
||||
ri := acctest.RandInt()
|
||||
config := fmt.Sprintf(testAccAzureRMResourceGroup_basic, ri)
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testCheckAzureRMResourceGroupDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: config,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -17,6 +17,9 @@ func resourceArmResourceGroup() *schema.Resource {
|
|||
Update: resourceArmResourceGroupUpdate,
|
||||
Exists: resourceArmResourceGroupExists,
|
||||
Delete: resourceArmResourceGroupDelete,
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"name": &schema.Schema{
|
||||
|
|
Loading…
Reference in New Issue