mirror of https://github.com/hashicorp/terraform
provider/aws: Support Import `aws_sns_topic_subscription` (#7359)
Had to change the way that the tests were working to include a random sqs-queue name due to this error: ``` `aws_sqs_queue.test_queue: Error creating SQS queue: AWS.SimpleQueueService.QueueDeletedRecently: You must wait 60 seconds after deleting a queue before you can create another with the same name. status code: 400, request id: b58e800a-ae27-556e-b6de-cfe1bbf9dc09`` ``` make testacc TEST=./builtin/providers/aws TESTARGS='-run=TestAccAWSSNSTopicSubscription_' ==> Checking that code complies with gofmt requirements... go generate $(go list ./... | grep -v /vendor/) TF_ACC=1 go test ./builtin/providers/aws -v -run=TestAccAWSSNSTopicSubscription_ -timeout 120m === RUN TestAccAWSSNSTopicSubscription_importBasic --- PASS: TestAccAWSSNSTopicSubscription_importBasic (24.44s) === RUN TestAccAWSSNSTopicSubscription_basic --- PASS: TestAccAWSSNSTopicSubscription_basic (25.26s) PASS ok github.com/hashicorp/terraform/builtin/providers/aws 49.722s ```pull/3363/head
parent
aa00d38a10
commit
e81751c4ee
@ -0,0 +1,30 @@
|
||||
package aws
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"github.com/hashicorp/terraform/helper/acctest"
|
||||
"github.com/hashicorp/terraform/helper/resource"
|
||||
)
|
||||
|
||||
func TestAccAWSSNSTopicSubscription_importBasic(t *testing.T) {
|
||||
resourceName := "aws_sns_topic.test_topic"
|
||||
ri := acctest.RandInt()
|
||||
|
||||
resource.Test(t, resource.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckAWSSNSTopicSubscriptionDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
Config: testAccAWSSNSTopicSubscriptionConfig(ri),
|
||||
},
|
||||
|
||||
resource.TestStep{
|
||||
ResourceName: resourceName,
|
||||
ImportState: true,
|
||||
ImportStateVerify: true,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
Loading…
Reference in new issue