Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release 2.1.0 (commit #7794) introduces serious and problematic performance degradation for CloudFront Distribution updates #8073

Closed
m-dunbar opened this issue Mar 26, 2019 · 8 comments · Fixed by #8116
Assignees
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Milestone

Comments

@m-dunbar
Copy link

Provisioner release 2.1.0 (#7794 appears to be the relevant commit related to CloudFront distributions) introduces a significant workflow problem with timing for CloudFront Distribution updates.

Prior to this change, updating an origin path, for example, took seconds to complete. Now, however, the TF apply sits and waits until propagation throughout the CloudFront edge network completes. This in turn destroys automated workflows.

Prior to 2.1.0, a CloudFront Distribution update (for example, an origin path change), the portion of a TF apply related to making and registering the change in distribution configuration took, on average, 2 seconds to complete. Beginning with release 2.1.0, the same CloudFront distribution update time increases to an average of 20 plus minutes, with peak times of over an hour and 20 plus minutes.

It would be nice if a significant change like this included a boolean attribute added (comparable to the 'retain_on_destroy' boolean, but for updates) to allow users to choose whether or not to wait for distribution propagation, or to move on as soon as the change is reflected, as was the behavior prior to release 2.1.0 (#7794).

@m-dunbar m-dunbar changed the title #7794 introduces serious and problematic performance degradation for cloudfront distribution updates Release 2.1.0 (commit #7794) introduces serious and problematic performance degradation for cloudfront distribution updates Mar 26, 2019
@m-dunbar m-dunbar changed the title Release 2.1.0 (commit #7794) introduces serious and problematic performance degradation for cloudfront distribution updates Release 2.1.0 (commit #7794) introduces serious and problematic performance degradation for CloudFront Distribution updates Mar 26, 2019
@bflad bflad added enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service. labels Mar 26, 2019
@Nowaker
Copy link

Nowaker commented Mar 27, 2019

There seems to be a technical reason why this was changed: 286f294

That said, the disruption caused by 30min+ wait times is massive. For long-waiting resources like this, a boolean switch or a virtual entity like aws_acm_certification_validation should be introduced instead.

@bflad bflad added this to the v2.5.0 milestone Mar 27, 2019
@bflad bflad self-assigned this Mar 28, 2019
@bflad
Copy link
Contributor

bflad commented Mar 28, 2019

I will have a pull request posted for this later today.

bflad added a commit that referenced this issue Mar 28, 2019
Reference: #8073

Since we are adding a virtual attribute with a `Default`, we must use include a schema state migration to prevent the "" => "true" default difference on upgrade.

Output from acceptance testing:

```

```
bflad added a commit that referenced this issue Mar 28, 2019
Reference: #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)
```
@bflad
Copy link
Contributor

bflad commented Mar 28, 2019

Pull request submitted: #8116

@Nowaker
Copy link

Nowaker commented Mar 28, 2019

Awesome work, thanks a million @bflad.

@m-dunbar
Copy link
Author

m-dunbar commented Mar 28, 2019 via email

@bflad
Copy link
Contributor

bflad commented Apr 1, 2019

A new wait_for_deployment argument (defaulting to true, set to false to skip waiting) for the aws_cloudfront_distribution resource has been merged and will release with version 2.5.0 of the Terraform AWS Provider later this week. 👍

@bflad
Copy link
Contributor

bflad commented Apr 5, 2019

This has been released in version 2.5.0 of the Terraform AWS provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

@ghost
Copy link

ghost commented Mar 30, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.

If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 30, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement Requests to existing resources that expand the functionality or scope. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Projects
None yet
3 participants