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

resource/aws_cloudfront_distribution: Retry deletion on DistributionNotDisabled #3034

Merged
merged 1 commit into from
Jan 18, 2018

Conversation

bflad
Copy link
Contributor

@bflad bflad commented Jan 17, 2018

Found via daily acceptance testing, it seems there can be eventual consistency issues from when a distribution is "deployed" as disabled and immediately calling delete.

        * aws_cloudfront_distribution.http_1_1: DistributionNotDisabled: The distribution you are trying to delete has not been disabled.
            status code: 409, request id: ae92147f-fb4a-11e7-b955-271f11c82e40

# in the debug logs
2018/01/17 05:53:02 [DEBUG] [aws-sdk-go] <?xml version="1.0"?>
...<Status>Deployed</Status>...<Enabled>false</Enabled>...
2018/01/17 05:53:02 [DEBUG] [aws-sdk-go] DEBUG: Request cloudfront/DeleteDistribution2017_03_25 Details:
---[ REQUEST POST-SIGN ]-----------------------------
DELETE /2017-03-25/distribution/E1QFJI9NG7I81I HTTP/1.1
...
2018/01/17 05:53:03 [DEBUG] [aws-sdk-go] DEBUG: Response cloudfront/DeleteDistribution2017_03_25 Details:
---[ RESPONSE ]--------------------------------------
HTTP/1.1 409 Conflict
2018/01/17 05:53:03 [DEBUG] [aws-sdk-go] <?xml version="1.0"?>
<ErrorResponse xmlns="http://cloudfront.amazonaws.com/doc/2017-03-25/"><Error><Type>Sender</Type><Code>DistributionNotDisabled</Code><Message>The distribution you are trying to delete has not been disabled.</Message></Error><RequestId>ae92147f-fb4a-11e7-b955-271f11c82e40</RequestId></ErrorResponse>

TC testing passes:

=== RUN   TestAccAWSCloudFrontDistribution_multiOrigin
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (1001.54s)
=== RUN   TestAccAWSCloudFrontDistribution_noOptionalItemsConfig
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (1002.84s)
=== RUN   TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (1003.06s)
=== RUN   TestAccAWSCloudFrontDistribution_S3OriginWithTags
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (1004.29s)
=== RUN   TestAccAWSCloudFrontDistribution_HTTP11Config
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (1004.76s)
=== RUN   TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (1006.25s)
=== RUN   TestAccAWSCloudFrontDistribution_importBasic
--- PASS: TestAccAWSCloudFrontDistribution_importBasic (1009.38s)
=== RUN   TestAccAWSCloudFrontDistribution_S3Origin
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (1009.76s)
=== RUN   TestAccAWSCloudFrontDistribution_customOrigin
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (1010.75s)

@bflad bflad added bug Addresses a defect in current functionality. service/cloudfront Issues and PRs that pertain to the cloudfront service. labels Jan 17, 2018
@bflad bflad requested a review from radeksimko January 17, 2018 19:55
Copy link
Member

@radeksimko radeksimko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 :shipit:

@radeksimko radeksimko added this to the v1.7.1 milestone Jan 18, 2018
@bflad bflad merged commit 0c87e9a into master Jan 18, 2018
@bflad bflad deleted the b-aws_cloudfront_distribution-delete-retries branch January 18, 2018 13:28
bflad added a commit that referenced this pull request Jan 18, 2018
@bflad
Copy link
Contributor Author

bflad commented Jan 22, 2018

This has been released in terraform-provider-aws version 1.7.1. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

drewsonne pushed a commit to drewsonne/terraform-provider-aws that referenced this pull request Mar 3, 2018
@ghost
Copy link

ghost commented Apr 8, 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 Apr 8, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Addresses a defect in current functionality. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants