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

Construct AliasConfigurationCert is created with a literal unique name by the CloudfrontWebDistribution Construct #4759

Closed
winjer opened this issue Oct 30, 2019 · 4 comments · Fixed by #4760
Assignees
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. in-progress This issue is being actively worked on.

Comments

@winjer
Copy link

winjer commented Oct 30, 2019

If you create more than one CloudfrontWebDistribution that has a certificate associated with it in a single stack then you get the error:

Error: There is already a Construct with name 'AliasConfigurationCert' in Stack

This looks like it is because of this line:

    certificatemanager.Certificate.fromCertificateArn(scope, 'AliasConfigurationCert', acmCertRef),

in web_distribution.ts.

Reproduction Steps

Create two CloudFrontWebDistributions in one stack.

Error Log

Error: There is already a Construct with name 'AliasConfigurationCert' in Stack

Environment

  • CLI Version :1.14.0 (build 261a1bf)
  • Framework Version: 1.15.0
  • OS : Linux
  • Language : Typescript

Other


This is 🐛 Bug Report

@winjer winjer added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Oct 30, 2019
@winjer
Copy link
Author

winjer commented Oct 30, 2019

It looks like this can be avoided by using viewerCertificate instead of aliasConfiguration and that this is indeed preferable, so this is probably a documentation bug instead?

@nmussy
Copy link
Contributor

nmussy commented Oct 30, 2019

Hey @winjer,

It's a mistake on my part when I added backwards compatibility from the deprecated aliasConfiguration. I'm making a PR to fix it for the next release.

Sorry to have to force you to switch to viewerCertificate in the meantime.

@winjer
Copy link
Author

winjer commented Oct 30, 2019

I'm happy to use viewerCertificate - it looks like that's a better choice anyway to be honest!

@nmussy
Copy link
Contributor

nmussy commented Oct 30, 2019

Thanks for being understanding. The aws-cloudfront package is still marked as experimental, but it wasn't my intention to break aliasConfiguration 😄

@SomayaB SomayaB added in-progress This issue is being actively worked on. @aws-cdk/aws-cloudfront Related to Amazon CloudFront labels Oct 30, 2019
@SomayaB SomayaB removed the needs-triage This issue or PR still needs to be triaged. label Oct 30, 2019
@mergify mergify bot closed this as completed in #4760 Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudfront Related to Amazon CloudFront bug This issue is a bug. in-progress This issue is being actively worked on.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants