67 lines
1.8 KiB
Go
67 lines
1.8 KiB
Go
![]() |
package aws
|
||
|
|
||
|
import (
|
||
|
"testing"
|
||
|
|
||
|
"github.com/hashicorp/terraform/helper/acctest"
|
||
|
"github.com/hashicorp/terraform/helper/resource"
|
||
|
)
|
||
|
|
||
|
func TestAccAWSS3BucketNotification_importBasic(t *testing.T) {
|
||
|
resourceName := "aws_s3_bucket_notification.notification"
|
||
|
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
resource.TestStep{
|
||
|
Config: testAccAWSS3BucketConfigWithTopicNotification(acctest.RandInt()),
|
||
|
},
|
||
|
|
||
|
resource.TestStep{
|
||
|
ResourceName: resourceName,
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
ImportStateVerifyIgnore: []string{"bucket"},
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
resource.TestStep{
|
||
|
Config: testAccAWSS3BucketConfigWithQueueNotification(acctest.RandInt()),
|
||
|
},
|
||
|
|
||
|
resource.TestStep{
|
||
|
ResourceName: resourceName,
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
ImportStateVerifyIgnore: []string{"bucket"},
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
|
||
|
resource.Test(t, resource.TestCase{
|
||
|
PreCheck: func() { testAccPreCheck(t) },
|
||
|
Providers: testAccProviders,
|
||
|
CheckDestroy: testAccCheckAWSS3BucketNotificationDestroy,
|
||
|
Steps: []resource.TestStep{
|
||
|
resource.TestStep{
|
||
|
Config: testAccAWSS3BucketConfigWithLambdaNotification(acctest.RandInt()),
|
||
|
},
|
||
|
|
||
|
resource.TestStep{
|
||
|
ResourceName: resourceName,
|
||
|
ImportState: true,
|
||
|
ImportStateVerify: true,
|
||
|
ImportStateVerifyIgnore: []string{"bucket"},
|
||
|
},
|
||
|
},
|
||
|
})
|
||
|
}
|