2016-06-23 03:56:59 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
2016-10-19 16:22:27 +02:00
|
|
|
"fmt"
|
2016-06-23 03:56:59 +02:00
|
|
|
"testing"
|
|
|
|
|
2016-10-19 16:22:27 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
2016-06-23 03:56:59 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
|
|
|
func TestAccAWSUser_importBasic(t *testing.T) {
|
|
|
|
resourceName := "aws_iam_user.user"
|
|
|
|
|
2016-10-19 16:22:27 +02:00
|
|
|
n := fmt.Sprintf("test-user-%d", acctest.RandInt())
|
|
|
|
|
2016-06-23 03:56:59 +02:00
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckAWSUserDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
resource.TestStep{
|
2016-10-19 16:22:27 +02:00
|
|
|
Config: testAccAWSUserConfig(n, "/"),
|
2016-06-23 03:56:59 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
resource.TestStep{
|
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
2016-07-26 16:56:50 +02:00
|
|
|
ImportStateVerifyIgnore: []string{
|
|
|
|
"force_destroy"},
|
2016-06-23 03:56:59 +02:00
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|