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

provider/aws: Support Import for `aws_sns_topic`
This commit is contained in:
James Nugent 2016-06-23 10:51:42 +03:00 committed by GitHub
commit b13ef7c748
2 changed files with 31 additions and 0 deletions

View File

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

View File

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