-
Notifications
You must be signed in to change notification settings - Fork 4.3k
feat(route53): support failover routing policy for record sets #35909
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
base: main
Are you sure you want to change the base?
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.
(This review is outdated)
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.
Thank you for your contribution! I've added some minor comments.
| if (props.failover === Failover.PRIMARY && !props.healthCheck) { | ||
| Annotations.of(this).addWarningV2('@aws-cdk/aws-route53:primaryFailoverHealthCheck', 'PRIMARY failover record sets should include a health check for proper failover behavior'); | ||
| } | ||
| if (props.failover && props.target.aliasTarget) { | ||
| const aliasTargetConfig = props.target.aliasTarget.bind(this, props.zone); | ||
| if (aliasTargetConfig && aliasTargetConfig.evaluateTargetHealth !== true) { | ||
| Annotations.of(this).addWarningV2('@aws-cdk/aws-route53:failoverAliasEvaluateTargetHealth', 'Failover alias record sets should include EvaluateTargetHealth = true for proper failover behavior.'); | ||
| } | ||
| } |
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.
Is my understanding correct that these settings allow deployment itself, but are not recommended configurations?
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 thought that health check for primary record is essential.
packages/@aws-cdk-testing/framework-integ/test/aws-route53/test/integ.failover-record.ts
Show resolved
Hide resolved
|
Could you please execute integ test and add snapshot files? |
9900ca7 to
d0de209
Compare
✅ Updated pull request passes all PRLinter validations. Dismissing previous PRLinter review.
Issue # (if applicable)
Closes #35910
Reason for this change
The L1
CfnRecordSetsupports theFailoverproperty, allowing users to define PRIMARY and SECONDARY record sets for Route 53 failover routing policies. However, this capability was not exposed at the L2RecordSetlevel.This enhancement introduces first-class support for failover routing in the L2 construct, simplifying configuration and validation for high-availability DNS setups.
Before (L1 override):
After (L2 support):
Description of changes
failover?: 'PRIMARY' | 'SECONDARY'toRecordSetPropsandRecordSetOptions. . Enables users to define primary and secondary record sets directly in the L2 construct.failoverto the synthesized CloudFormation template viaCfnRecordSet.Failover.failoverwith other routing policies (region,weight,geoLocation,multiValueAnswer, orcidrRoutingConfig).PRIMARYfailover record set does not specify ahealthCheck.failover, automatically warn ifEvaluateTargetHealthis not set totrue, aligning with Route 53 best practices.setIdentifiergeneration:Automatically derives a deterministic identifier prefix (
FAILOVER_PRIMARY_ID_/FAILOVER_SECONDARY_ID_) for failover record sets.FailoverandHealthCheckIdfields.EvaluateTargetHealth.failoveris combined with other routing policies.This aligns with Route 53’s documented behavior:
Reference: Amazon Route 53 Developer Guide — Failover Routing
Describe any new or updated permissions being added
None — this change only affects construct synthesis and validation logic.
Description of how you validated changes
record-set.test.ts.PRIMARYandSECONDARYfailover configurations.Checklist
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license