-
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
feat(route53-patterns): use Certificate
as the default certificate (under feature flag)
#23575
Conversation
…(under feature flag) The `HttpsRedirect` construct creates a certificate using the `DnsValidatedCertificate` if a certificate is not provided by the user. As part of [deprecating]() the `DnsValidatedCertificate` we need to replace all instances of `DnsValidatedCertificate` with `Certificate`. I have placed this behind a feature flag since I think it should be opt-in behavior for existing users, _but_ it is not a breaking change because of the way CloudFormation works. If the flag is enabled on an existing `HttpsRedirect` CloudFormation will: 1. Create a new certificate using `Certificate` 2. Update CloudFront to use the newly created `Certificate` 3. Delete the old certificate created with the `DnsValidatedCertificate` I have tested this scenario using the two newly created integration tests.
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.
Some questions, and some comments. I agree that hiding this under feature flag is best, because people don't like seeing their resources magically change, but I'm not sure how this affects the deprecation of DnsValidatedCertificate
.
if (Token.isUnresolved(stack.region)) { | ||
throw new Error(`When ${ROUTE53_PATTERNS_USE_CERTIFICATE} is enabled, a region must be defined on the Stack`); | ||
} |
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.
whoah, what is this? In the PR description, you said that there's no breaking change, but what about scenarios where you're using DnsValidatedCertificate
without a region? Wouldn't we throw an error when we move it to Certificate
?
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.
Why is that a breaking change? We are not breaking any existing user since we'll only move to Certificate
when you enable the feature flag.
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.
fair. not a breaking change, but I was sounding the alarm that users might move from DnsValidatedCertificate
to Certificate
without a defined region and would hit this error. I wonder what the story is for these people, or if that is a valid use case to begin with. Either way, its not breaking, so I'm not blocking.
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.
Yeah those users would have to provide a region, which I don't think is too much to ask when you are going cross region stuff. The alternative is that we make an assumption
- Assume that they are in
us-east-1
and if they are not the error is thrown by CloudFormation - Assume that they are not in
us-east-1
and always create a support stack. We can always switch this later if this is the direction users want us to go.
I mean we could deprecate |
@kaizencc ready for another review |
DNM because I want to call attention to this comment, but its non blocking. |
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). |
@Mergifyio update |
❌ Base branch update has failedrefusing to allow a GitHub App to create or update workflow |
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). |
The
HttpsRedirect
construct creates a certificate using theDnsValidatedCertificate
if a certificate is not provided by the user. As part of deprecating theDnsValidatedCertificate
we need to replace all instances ofDnsValidatedCertificate
withCertificate
.I have placed this behind a feature flag since I think it should be opt-in behavior for existing users, but it is not a breaking change because of the way CloudFormation works. If the flag is enabled on an existing
HttpsRedirect
CloudFormation will:Certificate
Certificate
DnsValidatedCertificate
I have tested this scenario using the two newly created integration tests.
All Submissions:
Adding new Construct Runtime Dependencies:
New Features
yarn integ
to deploy the infrastructure and generate the snapshot (i.e.yarn integ
without--dry-run
)?By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license