Merge pull request #7287 from hashicorp/import-aws-snstopic

provider/aws: Support Import for `aws_sns_topic`
pull/7294/head
James Nugent 10 years ago committed by GitHub
commit b13ef7c748

@ -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,
},
},
})
}

@ -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{

Loading…
Cancel
Save