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

DistributionAlreadyExists while creating multiple CloudFront distributions #9434

Closed
zygimantas opened this issue Jul 22, 2019 · 4 comments · Fixed by #9470
Closed

DistributionAlreadyExists while creating multiple CloudFront distributions #9434

zygimantas opened this issue Jul 22, 2019 · 4 comments · Fixed by #9470
Labels
bug Addresses a defect in current functionality. service/cloudfront Issues and PRs that pertain to the cloudfront service.
Milestone

Comments

@zygimantas
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.12.3 + provider.aws v2.16.0

Affected Resource(s)

  • aws_cloudfront_distribution

Terraform Configuration Files

Basic configurations for 2 distributions. Both distributions use the same wildcard SSL certificate, but domains are different: app1.example.com and app2.example.com

Debug Output

Panic Output

Expected Behavior

Multiple distributions are created.

Actual Behavior

Randomly, quite often, this error is displayed and terraform apply must be run again to create the second distribution:

DistributionAlreadyExists: The caller reference that you are using to create a distribution is associated with another distribution

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@github-actions github-actions bot added the needs-triage Waiting for first response or review from a maintainer. label Jul 22, 2019
@bflad bflad added bug Addresses a defect in current functionality. service/cloudfront Issues and PRs that pertain to the cloudfront service. and removed needs-triage Waiting for first response or review from a maintainer. labels Jul 23, 2019
bflad added a commit that referenced this issue Jul 23, 2019
…e.Now() to resource.UniqueId()

Reference: #9434

Output from acceptance testing:

```

```
bflad added a commit that referenced this issue Jul 24, 2019
…e.Now() to resource.UniqueId()

Reference: #9434

Output from acceptance testing:

```
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyOriginID (4.95s)
--- PASS: TestAccAWSCloudFrontDistribution_Origin_EmptyDomainName (5.08s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Headers (1567.50s)
--- PASS: TestAccAWSCloudFrontDistribution_OrderedCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (1569.28s)
--- PASS: TestAccAWSCloudFrontDistribution_disappears (1574.60s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Headers (1575.19s)
--- PASS: TestAccAWSCloudFrontDistribution_DefaultCacheBehavior_ForwardedValues_Cookies_WhitelistedNames (3398.76s)
--- PASS: TestAccAWSCloudFrontDistribution_orderedCacheBehavior (3567.88s)
--- PASS: TestAccAWSCloudFrontDistribution_OriginGroups (3562.87s)
--- PASS: TestAccAWSCloudFrontDistribution_IsIPV6EnabledConfig (3570.24s)
--- PASS: TestAccAWSCloudFrontDistribution_RetainOnDelete (3571.87s)
--- PASS: TestAccAWSCloudFrontDistribution_noOptionalItemsConfig (3575.29s)
--- PASS: TestAccAWSCloudFrontDistribution_WaitForDeployment (3571.28s)
--- PASS: TestAccAWSCloudFrontDistribution_noCustomErrorResponseConfig (3577.28s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn_ConflictsWithCloudFrontDefaultCertificate (3581.27s)
--- PASS: TestAccAWSCloudFrontDistribution_ViewerCertificate_AcmCertificateArn (3584.68s)
--- PASS: TestAccAWSCloudFrontDistribution_customOrigin (4291.01s)
--- PASS: TestAccAWSCloudFrontDistribution_HTTP11Config (4294.31s)
--- PASS: TestAccAWSCloudFrontDistribution_S3Origin (4368.65s)
--- PASS: TestAccAWSCloudFrontDistribution_multiOrigin (4371.62s)
--- PASS: TestAccAWSCloudFrontDistribution_Enabled (4464.73s)
--- PASS: TestAccAWSCloudFrontDistribution_S3OriginWithTags (4466.44s)
```
@bflad
Copy link
Member

bflad commented Jul 24, 2019

Fix submitted: #9470

@bflad bflad added this to the v2.21.0 milestone Jul 24, 2019
@bflad
Copy link
Member

bflad commented Jul 24, 2019

The fix for this has been merged and will release with version 2.21.0 of the Terraform AWS Provider, later this week. 👍

@bflad
Copy link
Member

bflad commented Jul 26, 2019

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

For further feature requests, documentation updates, or bug reports with this functionality, please create a new GitHub issue following the template for triage. Thanks!

@ghost
Copy link

ghost commented Nov 2, 2019

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!

@hashicorp hashicorp locked and limited conversation to collaborators Nov 2, 2019
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
2 participants