mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
Merge pull request #7287 from hashicorp/import-aws-snstopic
provider/aws: Support Import for `aws_sns_topic`
This commit is contained in:
commit
b13ef7c748
28
builtin/providers/aws/import_aws_sns_topic_test.go
Normal file
28
builtin/providers/aws/import_aws_sns_topic_test.go
Normal 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,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
@ -30,6 +30,9 @@ func resourceAwsSnsTopic() *schema.Resource {
|
|||||||
Read: resourceAwsSnsTopicRead,
|
Read: resourceAwsSnsTopicRead,
|
||||||
Update: resourceAwsSnsTopicUpdate,
|
Update: resourceAwsSnsTopicUpdate,
|
||||||
Delete: resourceAwsSnsTopicDelete,
|
Delete: resourceAwsSnsTopicDelete,
|
||||||
|
Importer: &schema.ResourceImporter{
|
||||||
|
State: schema.ImportStatePassthrough,
|
||||||
|
},
|
||||||
|
|
||||||
Schema: map[string]*schema.Schema{
|
Schema: map[string]*schema.Schema{
|
||||||
"name": &schema.Schema{
|
"name": &schema.Schema{
|
||||||
|
Loading…
Reference in New Issue
Block a user