github.com/nathanielks/terraform@v0.6.1-0.20170509030759-13e1a62319dc/builtin/providers/aws/import_aws_iam_server_certificate_test.go (about)

     1  package aws
     2  
     3  import (
     4  	"fmt"
     5  	"testing"
     6  
     7  	"github.com/hashicorp/terraform/helper/acctest"
     8  	"github.com/hashicorp/terraform/helper/resource"
     9  )
    10  
    11  func TestAccAWSIAMServerCertificate_importBasic(t *testing.T) {
    12  	resourceName := "aws_iam_server_certificate.test_cert"
    13  	rInt := acctest.RandInt()
    14  	resourceId := fmt.Sprintf("terraform-test-cert-%d", rInt)
    15  
    16  	resource.Test(t, resource.TestCase{
    17  		PreCheck:     func() { testAccPreCheck(t) },
    18  		Providers:    testAccProviders,
    19  		CheckDestroy: testAccCheckIAMServerCertificateDestroy,
    20  		Steps: []resource.TestStep{
    21  			{
    22  				Config: testAccIAMServerCertConfig(rInt),
    23  			},
    24  			{
    25  				ResourceName:      resourceName,
    26  				ImportState:       true,
    27  				ImportStateVerify: true,
    28  				ImportStateId:     resourceId,
    29  				ImportStateVerifyIgnore: []string{
    30  					"private_key"},
    31  			},
    32  		},
    33  	})
    34  }