provider/aws: Allow import of KMS key (#7599)
This commit is contained in:
parent
40e05ecc33
commit
8fa75ea383
|
@ -0,0 +1,29 @@
|
|||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSKMSKey_importBasic(t *testing.T) {
|
||||
resourceName := "aws_kms_key.foo"
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckAWSKmsKeyDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSKmsKey,
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
ImportStateVerifyIgnore: []string{"deletion_window_in_days"},
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
|
@ -19,6 +19,10 @@ func resourceAwsKmsKey() *schema.Resource {
|
|||
Update: resourceAwsKmsKeyUpdate,
|
||||
Delete: resourceAwsKmsKeyDelete,
|
||||
|
||||
Importer: &schema.ResourceImporter{
|
||||
State: schema.ImportStatePassthrough,
|
||||
},
|
||||
|
||||
Schema: map[string]*schema.Schema{
|
||||
"arn": &schema.Schema{
|
||||
Type: schema.TypeString,
|
||||
|
|
Loading…
Reference in New Issue