provider/aws: Preserve default retain_on_delete in cloudfront import (#13209)
Fixes: #10969
This commit is contained in:
parent
5a37434bf1
commit
e4e9d1e073
|
@ -7,6 +7,10 @@ import (
|
|||
)
|
||||
|
||||
func resourceAwsCloudFrontDistributionImport(d *schema.ResourceData, meta interface{}) ([]*schema.ResourceData, error) {
|
||||
// This is a non API attribute
|
||||
// We are merely setting this to the same value as the Default setting in the schema
|
||||
d.Set("retain_on_delete", false)
|
||||
|
||||
conn := meta.(*AWSClient).cloudfrontconn
|
||||
id := d.Id()
|
||||
resp, err := conn.GetDistributionConfig(&cloudfront.GetDistributionConfigInput{
|
||||
|
|
|
@ -19,16 +19,13 @@ func TestAccAWSCloudFrontDistribution_importBasic(t *testing.T) {
|
|||
Providers: testAccProviders,
|
||||
CheckDestroy: testAccCheckCloudFrontDistributionDestroy,
|
||||
Steps: []resource.TestStep{
|
||||
resource.TestStep{
|
||||
{
|
||||
Config: testConfig,
|
||||
},
|
||||
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"},
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue