2016-07-12 23:18:37 +02:00
|
|
|
package aws
|
|
|
|
|
|
|
|
import (
|
2016-10-04 00:11:46 +02:00
|
|
|
"fmt"
|
2016-07-12 23:18:37 +02:00
|
|
|
"testing"
|
|
|
|
|
2016-10-04 00:11:46 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/acctest"
|
2016-07-12 23:18:37 +02:00
|
|
|
"github.com/hashicorp/terraform/helper/resource"
|
|
|
|
)
|
|
|
|
|
2016-07-21 13:41:01 +02:00
|
|
|
func TestAccAWSCloudFrontDistribution_importBasic(t *testing.T) {
|
2016-10-04 00:11:46 +02:00
|
|
|
ri := acctest.RandInt()
|
|
|
|
testConfig := fmt.Sprintf(testAccAWSCloudFrontDistributionS3Config, ri, originBucket, logBucket, testAccAWSCloudFrontDistributionRetainConfig())
|
|
|
|
|
2016-07-12 23:18:37 +02:00
|
|
|
resourceName := "aws_cloudfront_distribution.s3_distribution"
|
|
|
|
|
|
|
|
resource.Test(t, resource.TestCase{
|
|
|
|
PreCheck: func() { testAccPreCheck(t) },
|
|
|
|
Providers: testAccProviders,
|
|
|
|
CheckDestroy: testAccCheckCloudFrontDistributionDestroy,
|
|
|
|
Steps: []resource.TestStep{
|
|
|
|
resource.TestStep{
|
2016-10-04 00:11:46 +02:00
|
|
|
Config: testConfig,
|
2016-07-12 23:18:37 +02:00
|
|
|
},
|
|
|
|
resource.TestStep{
|
|
|
|
ResourceName: resourceName,
|
|
|
|
ImportState: true,
|
|
|
|
ImportStateVerify: true,
|
|
|
|
// Ignore retain_on_delete since it doesn't come from the AWS
|
|
|
|
// API.
|
|
|
|
ImportStateVerifyIgnore: []string{"retain_on_delete"},
|
|
|
|
},
|
|
|
|
},
|
|
|
|
})
|
|
|
|
}
|