diff --git a/builtin/providers/aws/import_aws_sns_topic_test.go b/builtin/providers/aws/import_aws_sns_topic_test.go new file mode 100644 index 000000000..ae8bab8cf --- /dev/null +++ b/builtin/providers/aws/import_aws_sns_topic_test.go @@ -0,0 +1,28 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/helper/resource" +) + +func TestAccAWSSNSTopic_importBasic(t *testing.T) { + resourceName := "aws_sns_topic.test_topic" + + resource.Test(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckAWSSNSTopicDestroy, + Steps: []resource.TestStep{ + resource.TestStep{ + Config: testAccAWSSNSTopicConfig, + }, + + resource.TestStep{ + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + }, + }, + }) +} diff --git a/builtin/providers/aws/resource_aws_sns_topic.go b/builtin/providers/aws/resource_aws_sns_topic.go index 62f2450c0..765874c2f 100644 --- a/builtin/providers/aws/resource_aws_sns_topic.go +++ b/builtin/providers/aws/resource_aws_sns_topic.go @@ -30,6 +30,9 @@ func resourceAwsSnsTopic() *schema.Resource { Read: resourceAwsSnsTopicRead, Update: resourceAwsSnsTopicUpdate, Delete: resourceAwsSnsTopicDelete, + Importer: &schema.ResourceImporter{ + State: schema.ImportStatePassthrough, + }, Schema: map[string]*schema.Schema{ "name": &schema.Schema{