-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
fix(cloudfront): requirement of domainNames prevents moving a domain name between distributions #31001
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The pull request linter has failed. See the aws-cdk-automation comment below for failure reasons. If you believe this pull request should receive an exemption, please comment and provide a justification.
A comment requesting an exemption should contain the text Exemption Request
. Additionally, if clarification is needed add Clarification Request
to a comment.
Exemption Request There are no integ tests for a distribution with certificate. |
Hi @Tietew , are there any issues preventing us from adding such an integ test? If not it would be great if you could add one as part of this PR. |
@gracelu0 Thank you for your comment. Integ test for this PR needs an issued public ACM certificate, which requires a reachable DNS zone (Route53 public hosted zone). |
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
* you should add (at least one of) the domain names of the certificate to this list. | ||
* | ||
* When you want to move a domain name between distributions, you can associate a certificate without specifying any domain names. | ||
* See [Moving an alternate domain name to a different distribution](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-move) for details. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reading the docs, I see that moving the domain name requires calling the associate-alias
CLI command. So this change just allows the user to create a target distribution but they would still need to call associate-alias
correct? I think it would be helpful to include an example of how someone would do this in CDK in the README.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes. We should call associate-alias
cli command manually.
I will add the instructions.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a new section to the README.
Thanks for your suggestion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you for contributing!
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
AWS CodeBuild CI Report
Powered by github-codebuild-logs, available on the AWS Serverless Application Repository |
Thank you for contributing! Your pull request will be updated from main and then merged automatically (do not update manually, and be sure to allow changes to be pushed to your fork). |
Comments on closed issues and PRs are hard for our team to see. |
Issue # (if applicable)
Closes #29960.
Reason for this change
When I want to move a domain name from a distribution to another distribution,
I must create a distribution with a certificate associated but no domain names.
Description of changes
Re-submit of previous #29329.
Removed the validation that
domainNames
must not be blank when a certificate is associated.Description of how you validated changes
Updated a unit test to allow absent domainNames when a certificate is associated.
See AWS Documentation for details: Using custom URLs by adding alternate domain names (CNAMEs) > Moving an alternate domain name to a different distribution
https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/CNAMEs.html#alternate-domain-names-move
Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license