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

feat(route53-patterns): use Certificate as the default certificate (under feature flag) #23575

Merged
merged 5 commits into from
Jan 18, 2023
Merged

feat(route53-patterns): use Certificate as the default certificate (under feature flag) #23575

merged 5 commits into from
Jan 18, 2023

Conversation

corymhall
Copy link
Contributor

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.


All Submissions:

Adding new Construct Runtime Dependencies:

  • This PR adds new construct runtime dependencies following the process described here

New Features

  • Have you added the new feature to an integration test?
    • Did you use 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

…(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.
@gitpod-io
Copy link

gitpod-io bot commented Jan 5, 2023

@github-actions github-actions bot added the p2 label Jan 5, 2023
@aws-cdk-automation aws-cdk-automation requested a review from a team January 5, 2023 15:13
@mergify mergify bot added the contribution/core This is a PR that came from AWS. label Jan 5, 2023
Copy link
Contributor

@kaizencc kaizencc left a 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.

Comment on lines +117 to +119
if (Token.isUnresolved(stack.region)) {
throw new Error(`When ${ROUTE53_PATTERNS_USE_CERTIFICATE} is enabled, a region must be defined on the Stack`);
}
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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.

Copy link
Contributor Author

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

  1. Assume that they are in us-east-1 and if they are not the error is thrown by CloudFormation
  2. 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.

@corymhall
Copy link
Contributor Author

but I'm not sure how this affects the deprecation of DnsValidatedCertificate.

I mean we could deprecate DnsValidatedCertificate without this, but then users don't have any upgrade path away from a deprecated API so I figured I would do this first.

@corymhall
Copy link
Contributor Author

@kaizencc ready for another review

@kaizencc kaizencc added the pr/do-not-merge This PR should not be merged at this time. label Jan 18, 2023
@kaizencc
Copy link
Contributor

kaizencc commented Jan 18, 2023

DNM because I want to call attention to this comment, but its non blocking.

@corymhall corymhall removed the pr/do-not-merge This PR should not be merged at this time. label Jan 18, 2023
@mergify
Copy link
Contributor

mergify bot commented Jan 18, 2023

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).

@TheRealAmazonKendra
Copy link
Contributor

@Mergifyio update

@mergify
Copy link
Contributor

mergify bot commented Jan 18, 2023

update

❌ Base branch update has failed

refusing to allow a GitHub App to create or update workflow .github/workflows/github-merit-badger.yml without workflows permission
err-code: C688E

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: AutoBuildv2Project1C6BFA3F-wQm2hXv2jqQv
  • Commit ID: 99fdc54
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@mergify
Copy link
Contributor

mergify bot commented Jan 18, 2023

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).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution/core This is a PR that came from AWS. p2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants