From c0e7f5f6823580406a7d5496b16db347e12f2ef6 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 28 Mar 2019 11:11:30 -0400 Subject: [PATCH 1/3] resource/aws_cloudfront_distribution: Add wait_for_deployment argument Reference: https://github.com/terraform-providers/terraform-provider-aws/issues/8073 Since we are adding a virtual attribute with a `Default`, we must use include a schema state migration to prevent the `"" => "true"` difference on upgrade. Output from acceptance testing: ``` --- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (1.25s) --- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (1.30s) --- PASS: TestAccAWSCloudFrontDistribution_disappears (571.01s) --- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (1263.05s) --- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (1265.06s) --- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (1265.34s) --- PASS: TestAccAWSCloudFrontDistribution_customOrigin (1267.09s) --- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (1267.68s) --- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (1268.95s) --- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (1271.12s) --- PASS: TestAccAWSCloudFrontDistribution_S3Origin (1271.30s) --- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (1271.50s) --- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (1272.82s) --- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (1275.16s) --- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (1275.81s) --- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (1372.94s) --- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1782.07s) --- PASS: TestAccAWSCloudFrontDistribution_Enabled (1782.38s) ``` --- aws/import_aws_cloudfront_distribution.go | 1 + aws/resource_aws_cloudfront_distribution.go | 23 +- ...rce_aws_cloudfront_distribution_migrate.go | 34 +++ ...ws_cloudfront_distribution_migrate_test.go | 52 ++++ ...source_aws_cloudfront_distribution_test.go | 254 ++++++++++++++---- 5 files changed, 310 insertions(+), 54 deletions(-) create mode 100644 aws/resource_aws_cloudfront_distribution_migrate.go create mode 100644 aws/resource_aws_cloudfront_distribution_migrate_test.go diff --git a/aws/import_aws_cloudfront_distribution.go b/aws/import_aws_cloudfront_distribution.go index acfc836dc5c0..9558deb4e216 100644 --- a/aws/import_aws_cloudfront_distribution.go +++ b/aws/import_aws_cloudfront_distribution.go @@ -10,6 +10,7 @@ func resourceAwsCloudFrontDistributionImport(d *schema.ResourceData, meta interf // 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) + d.Set("wait_for_deployment", true) conn := meta.(*AWSClient).cloudfrontconn id := d.Id() diff --git a/aws/resource_aws_cloudfront_distribution.go b/aws/resource_aws_cloudfront_distribution.go index 999ec2bb00d9..1ae9055d84d1 100644 --- a/aws/resource_aws_cloudfront_distribution.go +++ b/aws/resource_aws_cloudfront_distribution.go @@ -22,6 +22,8 @@ func resourceAwsCloudFrontDistribution() *schema.Resource { Importer: &schema.ResourceImporter{ State: resourceAwsCloudFrontDistributionImport, }, + MigrateState: resourceAwsCloudFrontDistributionMigrateState, + SchemaVersion: 1, Schema: map[string]*schema.Schema{ "arn": { @@ -714,6 +716,11 @@ func resourceAwsCloudFrontDistribution() *schema.Resource { Optional: true, Default: false, }, + "wait_for_deployment": { + Type: schema.TypeBool, + Optional: true, + Default: true, + }, "is_ipv6_enabled": { Type: schema.TypeBool, Optional: true, @@ -765,9 +772,11 @@ func resourceAwsCloudFrontDistributionCreate(d *schema.ResourceData, meta interf d.SetId(*resp.Distribution.Id) - log.Printf("[DEBUG] Waiting until CloudFront Distribution (%s) is deployed", d.Id()) - if err := resourceAwsCloudFrontDistributionWaitUntilDeployed(d.Id(), meta); err != nil { - return fmt.Errorf("error waiting until CloudFront Distribution (%s) is deployed: %s", d.Id(), err) + if d.Get("wait_for_deployment").(bool) { + log.Printf("[DEBUG] Waiting until CloudFront Distribution (%s) is deployed", d.Id()) + if err := resourceAwsCloudFrontDistributionWaitUntilDeployed(d.Id(), meta); err != nil { + return fmt.Errorf("error waiting until CloudFront Distribution (%s) is deployed: %s", d.Id(), err) + } } return resourceAwsCloudFrontDistributionRead(d, meta) @@ -858,9 +867,11 @@ func resourceAwsCloudFrontDistributionUpdate(d *schema.ResourceData, meta interf return fmt.Errorf("error updating CloudFront Distribution (%s): %s", d.Id(), err) } - log.Printf("[DEBUG] Waiting until CloudFront Distribution (%s) is deployed", d.Id()) - if err := resourceAwsCloudFrontDistributionWaitUntilDeployed(d.Id(), meta); err != nil { - return fmt.Errorf("error waiting until CloudFront Distribution (%s) is deployed: %s", d.Id(), err) + if d.Get("wait_for_deployment").(bool) { + log.Printf("[DEBUG] Waiting until CloudFront Distribution (%s) is deployed", d.Id()) + if err := resourceAwsCloudFrontDistributionWaitUntilDeployed(d.Id(), meta); err != nil { + return fmt.Errorf("error waiting until CloudFront Distribution (%s) is deployed: %s", d.Id(), err) + } } if err := setTagsCloudFront(conn, d, d.Get("arn").(string)); err != nil { diff --git a/aws/resource_aws_cloudfront_distribution_migrate.go b/aws/resource_aws_cloudfront_distribution_migrate.go new file mode 100644 index 000000000000..4517930bc1de --- /dev/null +++ b/aws/resource_aws_cloudfront_distribution_migrate.go @@ -0,0 +1,34 @@ +package aws + +import ( + "fmt" + "log" + + "github.com/hashicorp/terraform/terraform" +) + +func resourceAwsCloudFrontDistributionMigrateState(v int, is *terraform.InstanceState, meta interface{}) (*terraform.InstanceState, error) { + switch v { + case 0: + log.Println("[INFO] Found CloudFront Distribution state v0; migrating to v1") + return migrateCloudFrontDistributionStateV0toV1(is) + default: + return is, fmt.Errorf("Unexpected schema version: %d", v) + } +} + +func migrateCloudFrontDistributionStateV0toV1(is *terraform.InstanceState) (*terraform.InstanceState, error) { + if is.Empty() || is.Attributes == nil { + log.Println("[DEBUG] Empty CloudFront Distribution state; nothing to migrate.") + return is, nil + } + + log.Printf("[DEBUG] Attributes before migration: %#v", is.Attributes) + + // Add wait_for_deployment virtual attribute with Default + is.Attributes["wait_for_deployment"] = "true" + + log.Printf("[DEBUG] Attributes after migration: %#v", is.Attributes) + + return is, nil +} diff --git a/aws/resource_aws_cloudfront_distribution_migrate_test.go b/aws/resource_aws_cloudfront_distribution_migrate_test.go new file mode 100644 index 000000000000..a0554ff7dde8 --- /dev/null +++ b/aws/resource_aws_cloudfront_distribution_migrate_test.go @@ -0,0 +1,52 @@ +package aws + +import ( + "testing" + + "github.com/hashicorp/terraform/terraform" +) + +func TestAwsCloudFrontDistributionMigrateState(t *testing.T) { + cases := map[string]struct { + StateVersion int + Attributes map[string]string + Expected map[string]string + Meta interface{} + }{ + "v0_1": { + StateVersion: 0, + Attributes: map[string]string{ + "wait_for_deployment": "", + }, + Expected: map[string]string{ + "wait_for_deployment": "true", + }, + }, + } + + for tn, tc := range cases { + is := &terraform.InstanceState{ + ID: "some_id", + Attributes: tc.Attributes, + } + + tfResource := resourceAwsCloudFrontDistribution() + + if tfResource.MigrateState == nil { + t.Fatalf("bad: %s, err: missing MigrateState function in resource", tn) + } + + is, err := tfResource.MigrateState(tc.StateVersion, is, tc.Meta) + if err != nil { + t.Fatalf("bad: %s, err: %#v", tn, err) + } + + for k, v := range tc.Expected { + if is.Attributes[k] != v { + t.Fatalf( + "bad: %s\n\n expected: %#v -> %#v\n got: %#v -> %#v\n in: %#v", + tn, k, v, k, is.Attributes[k], is.Attributes) + } + } + } +} diff --git a/aws/resource_aws_cloudfront_distribution_test.go b/aws/resource_aws_cloudfront_distribution_test.go index beb5c30f596f..1552d2e5d71a 100644 --- a/aws/resource_aws_cloudfront_distribution_test.go +++ b/aws/resource_aws_cloudfront_distribution_test.go @@ -123,10 +123,13 @@ func TestAccAWSCloudFrontDistribution_S3Origin(t *testing.T) { ), }, { - ResourceName: "aws_cloudfront_distribution.s3_distribution", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.s3_distribution", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -156,10 +159,13 @@ func TestAccAWSCloudFrontDistribution_S3OriginWithTags(t *testing.T) { ), }, { - ResourceName: "aws_cloudfront_distribution.s3_distribution", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.s3_distribution", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, { Config: postConfig, @@ -194,10 +200,13 @@ func TestAccAWSCloudFrontDistribution_customOrigin(t *testing.T) { ), }, { - ResourceName: "aws_cloudfront_distribution.custom_distribution", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.custom_distribution", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -226,10 +235,13 @@ func TestAccAWSCloudFrontDistribution_multiOrigin(t *testing.T) { ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -261,10 +273,13 @@ func TestAccAWSCloudFrontDistribution_orderedCacheBehavior(t *testing.T) { ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -362,13 +377,17 @@ func TestAccAWSCloudFrontDistribution_noOptionalItemsConfig(t *testing.T) { resource.TestCheckResourceAttr(resourceName, "tags.%", "0"), resource.TestCheckResourceAttr(resourceName, "viewer_certificate.#", "1"), resource.TestCheckResourceAttr(resourceName, "viewer_certificate.0.cloudfront_default_certificate", "true"), + resource.TestCheckResourceAttr(resourceName, "wait_for_deployment", "true"), ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -394,10 +413,13 @@ func TestAccAWSCloudFrontDistribution_HTTP11Config(t *testing.T) { ), }, { - ResourceName: "aws_cloudfront_distribution.http_1_1", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.http_1_1", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -419,10 +441,13 @@ func TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig(t *testing.T) { ), }, { - ResourceName: "aws_cloudfront_distribution.is_ipv6_enabled", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.is_ipv6_enabled", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -442,10 +467,13 @@ func TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig(t *testing.T) ), }, { - ResourceName: "aws_cloudfront_distribution.no_custom_error_responses", - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: "aws_cloudfront_distribution.no_custom_error_responses", + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -468,10 +496,13 @@ func TestAccAWSCloudFrontDistribution_Enabled(t *testing.T) { ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, { Config: testAccAWSCloudFrontDistributionConfigEnabled(true, false), @@ -535,10 +566,13 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn(t *tes ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, }, }, }) @@ -562,10 +596,60 @@ func TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_Confli ), }, { - ResourceName: resourceName, - ImportState: true, - ImportStateVerify: true, - ImportStateVerifyIgnore: []string{"retain_on_delete"}, + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, + }, + }, + }) +} + +func TestAccAWSCloudFrontDistribution_WaitForDeployment(t *testing.T) { + var distribution cloudfront.Distribution + resourceName := "aws_cloudfront_distribution.test" + + resource.ParallelTest(t, resource.TestCase{ + PreCheck: func() { testAccPreCheck(t) }, + Providers: testAccProviders, + CheckDestroy: testAccCheckCloudFrontDistributionDestroy, + Steps: []resource.TestStep{ + { + Config: testAccAWSCloudFrontDistributionConfigWaitForDeployment(false, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudFrontDistributionExists(resourceName, &distribution), + testAccCheckCloudFrontDistributionStatusInProgress(&distribution), + testAccCheckCloudFrontDistributionWaitForDeployment(&distribution), + resource.TestCheckResourceAttr(resourceName, "wait_for_deployment", "false"), + ), + }, + { + ResourceName: resourceName, + ImportState: true, + ImportStateVerify: true, + ImportStateVerifyIgnore: []string{ + "retain_on_delete", + "wait_for_deployment", + }, + }, + { + Config: testAccAWSCloudFrontDistributionConfigWaitForDeployment(true, false), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudFrontDistributionExists(resourceName, &distribution), + testAccCheckCloudFrontDistributionStatusInProgress(&distribution), + resource.TestCheckResourceAttr(resourceName, "wait_for_deployment", "false"), + ), + }, + { + Config: testAccAWSCloudFrontDistributionConfigWaitForDeployment(false, true), + Check: resource.ComposeTestCheckFunc( + testAccCheckCloudFrontDistributionExists(resourceName, &distribution), + testAccCheckCloudFrontDistributionStatusDeployed(&distribution), + resource.TestCheckResourceAttr(resourceName, "wait_for_deployment", "true"), + ), }, }, }) @@ -655,6 +739,34 @@ func testAccCheckCloudFrontDistributionExistsAPIOnly(distribution *cloudfront.Di } } +func testAccCheckCloudFrontDistributionStatusDeployed(distribution *cloudfront.Distribution) resource.TestCheckFunc { + return func(s *terraform.State) error { + if distribution == nil { + return fmt.Errorf("CloudFront Distribution empty") + } + + if aws.StringValue(distribution.Status) != "Deployed" { + return fmt.Errorf("CloudFront Distribution (%s) status not Deployed: %s", aws.StringValue(distribution.Id), aws.StringValue(distribution.Status)) + } + + return nil + } +} + +func testAccCheckCloudFrontDistributionStatusInProgress(distribution *cloudfront.Distribution) resource.TestCheckFunc { + return func(s *terraform.State) error { + if distribution == nil { + return fmt.Errorf("CloudFront Distribution empty") + } + + if aws.StringValue(distribution.Status) != "InProgress" { + return fmt.Errorf("CloudFront Distribution (%s) status not InProgress: %s", aws.StringValue(distribution.Id), aws.StringValue(distribution.Status)) + } + + return nil + } +} + func testAccCheckCloudFrontDistributionDisabled(distribution *cloudfront.Distribution) resource.TestCheckFunc { return func(s *terraform.State) error { if distribution == nil || distribution.DistributionConfig == nil { @@ -1689,3 +1801,49 @@ resource "aws_cloudfront_distribution" "test" { } `, retainOnDelete) } + +func testAccAWSCloudFrontDistributionConfigWaitForDeployment(enabled, waitForDeployment bool) string { + return fmt.Sprintf(` +resource "aws_cloudfront_distribution" "test" { + enabled = %[1]t + wait_for_deployment = %[2]t + + default_cache_behavior { + allowed_methods = ["GET", "HEAD"] + cached_methods = ["GET", "HEAD"] + target_origin_id = "test" + viewer_protocol_policy = "allow-all" + + forwarded_values { + query_string = false + + cookies { + forward = "all" + } + } + } + + origin { + domain_name = "www.example.com" + origin_id = "test" + + custom_origin_config { + http_port = 80 + https_port = 443 + origin_protocol_policy = "https-only" + origin_ssl_protocols = ["TLSv1.2"] + } + } + + restrictions { + geo_restriction { + restriction_type = "none" + } + } + + viewer_certificate { + cloudfront_default_certificate = true + } +} +`, enabled, waitForDeployment) +} From 0a0ac2206127c13bc433459399daf252746f5877 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 28 Mar 2019 12:43:12 -0400 Subject: [PATCH 2/3] docs/resource/aws_cloudfront_distribution: Add wait_for_deployment argument documentation --- website/docs/r/cloudfront_distribution.html.markdown | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/website/docs/r/cloudfront_distribution.html.markdown b/website/docs/r/cloudfront_distribution.html.markdown index 6ea2f556ae42..19186c37c297 100644 --- a/website/docs/r/cloudfront_distribution.html.markdown +++ b/website/docs/r/cloudfront_distribution.html.markdown @@ -255,6 +255,10 @@ of several sub-resources - these resources are laid out below. deleting it when destroying the resource through Terraform. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`. + * `wait_for_deployment` (Optional) - By default, the resource will wait + for creation and updates to fully deploy. Setting this to `false` + will skip waiting for deployments to complete. Default: `true`. + #### Cache Behavior Arguments * `allowed_methods` (Required) - Controls which HTTP methods CloudFront From 6bec1337eb54859895ffadcb2e6520c06fd12690 Mon Sep 17 00:00:00 2001 From: Brian Flad Date: Thu, 28 Mar 2019 19:00:11 -0400 Subject: [PATCH 3/3] resource/aws_cloudfront_distribution: Clarify state migration variable naming and improve wait_for_deployment documentation Reference: https://github.com/terraform-providers/terraform-provider-aws/pull/8116 --- ...ws_cloudfront_distribution_migrate_test.go | 22 +++++++++---------- .../r/cloudfront_distribution.html.markdown | 6 ++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/aws/resource_aws_cloudfront_distribution_migrate_test.go b/aws/resource_aws_cloudfront_distribution_migrate_test.go index a0554ff7dde8..3381c34c5ddc 100644 --- a/aws/resource_aws_cloudfront_distribution_migrate_test.go +++ b/aws/resource_aws_cloudfront_distribution_migrate_test.go @@ -7,13 +7,13 @@ import ( ) func TestAwsCloudFrontDistributionMigrateState(t *testing.T) { - cases := map[string]struct { + testCases := map[string]struct { StateVersion int Attributes map[string]string Expected map[string]string Meta interface{} }{ - "v0_1": { + "v0_to_v1": { StateVersion: 0, Attributes: map[string]string{ "wait_for_deployment": "", @@ -24,28 +24,28 @@ func TestAwsCloudFrontDistributionMigrateState(t *testing.T) { }, } - for tn, tc := range cases { - is := &terraform.InstanceState{ + for testName, testCase := range testCases { + instanceState := &terraform.InstanceState{ ID: "some_id", - Attributes: tc.Attributes, + Attributes: testCase.Attributes, } tfResource := resourceAwsCloudFrontDistribution() if tfResource.MigrateState == nil { - t.Fatalf("bad: %s, err: missing MigrateState function in resource", tn) + t.Fatalf("bad: %s, err: missing MigrateState function in resource", testName) } - is, err := tfResource.MigrateState(tc.StateVersion, is, tc.Meta) + instanceState, err := tfResource.MigrateState(testCase.StateVersion, instanceState, testCase.Meta) if err != nil { - t.Fatalf("bad: %s, err: %#v", tn, err) + t.Fatalf("bad: %s, err: %#v", testName, err) } - for k, v := range tc.Expected { - if is.Attributes[k] != v { + for key, expectedValue := range testCase.Expected { + if instanceState.Attributes[key] != expectedValue { t.Fatalf( "bad: %s\n\n expected: %#v -> %#v\n got: %#v -> %#v\n in: %#v", - tn, k, v, k, is.Attributes[k], is.Attributes) + testName, key, expectedValue, key, instanceState.Attributes[key], instanceState.Attributes) } } } diff --git a/website/docs/r/cloudfront_distribution.html.markdown b/website/docs/r/cloudfront_distribution.html.markdown index 19186c37c297..ef9ad3239621 100644 --- a/website/docs/r/cloudfront_distribution.html.markdown +++ b/website/docs/r/cloudfront_distribution.html.markdown @@ -255,9 +255,9 @@ of several sub-resources - these resources are laid out below. deleting it when destroying the resource through Terraform. If this is set, the distribution needs to be deleted manually afterwards. Default: `false`. - * `wait_for_deployment` (Optional) - By default, the resource will wait - for creation and updates to fully deploy. Setting this to `false` - will skip waiting for deployments to complete. Default: `true`. + * `wait_for_deployment` (Optional) - If enabled, the resource will wait for + the distribution status to change from `InProgress` to `Deployed`. Setting + this to`false` will skip the process. Default: `true`. #### Cache Behavior Arguments