Skip to content

Conversation

@Tietew
Copy link
Contributor

@Tietew Tietew commented Jun 18, 2025

Issue # (if applicable)

Closes #34673.

Reason for this change

Route53 supports SVCB and HTTPS resource records and CDK also supports via route53.RecordType.SVCB and route53.RecordType.HTTPS.
https://aws.amazon.com/about-aws/whats-new/2024/10/amazon-route-53-https-sshfp-svcb-tlsa-dns-support/

HTTPS record can be an alias to CloudFront.
https://aws.amazon.com/about-aws/whats-new/2025/07/amazon-cloudfront-https-dns-records/

It's useful to make a resource class for HTTPS record like ARecord etc to ensure generating correct record values.

Currently, most common usage is to create an HTTPS ServiceMode record with ALPN parameter.

// Before
new route53.RecordSet(this, 'HttpsRecord', {
  zone,
  recordType: route53.RecordType.HTTPS,
  target: route53.RecordTarget.fromValues('1 . alpn="h3,h2"')],
});

// After
new route53.HttpsRecord(this, 'HttpsRecord', {
  zone,
  values: [route53.HttpsRecordValue.service({ alpn: [route53.Alpn.H3, route53.Alpn.H2] })],
});

SVCB and HTTPS have same representation format.
Therefore I added both record classes to share implementation.

Description of changes

Added SvcbRecord and HttpsRecord resource classes and corresponding types.
HttpsRecord also supports CloudFront alias target.

Usage

declare const zone: route53.IHostedZone;
declare const distribution: cloudfront.IDistribution;

// AliasMode (priority = 0)
new route53.HttpsRecord(this, 'HTTPS-AliasMode', {
  zone,
  values: [route53.HttpsRecordValue.alias('service.example.com')],
});

// ServiceMode (priority >= 1)
new route53.HttpsRecord(this, 'HTTPS-ServiceMode', {
  zone,
  values: [route53.HttpsRecordValue.service({ // All props are optional
    // SvcPriority - defaults to 1
    priority: 1,
    // TargetName - defaults to '.'
    targetName: '.',
    // SvcParam
    mandatory: [...],
    alpn: [...],
    port: ...,
    ipv4hint: [...],
    ipv6hint: [...],
  }),
});

// CloudFront alias target
new route53.HttpsRecord(this, 'HTTPS-CloudFrontAlias', {
  zone,
  target: route53.RecordTarget.fromAlias(new route53_targets.CloudFrontTarget(distribution)),
});

To define SVCB record, just replace Https to Svcb.
For details of each parameter, see RFC 9460.

Describe any new or updated permissions being added

N/A

Description of how you validated changes

Unit tests and integ test.

I've confirmed Route53 rejects undefined SvcParam keys such as key65444=ex2.

$ aws route53 change-resource-record-sets --hosted-zone-id XXXXXXXX --change-batch '{"Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"example.com","Type":"SVCB","ResourceRecords":[{"Value":"1 . key65444=ex2"}],"TTL":1800}}]}'

An error occurred (InvalidChangeBatch) when calling the ChangeResourceRecordSets operation: [SVCB does not support undefined parameters.]

$ aws route53 change-resource-record-sets --hosted-zone-id XXXXXXXX --change-batch '{"Changes":[{"Action":"CREATE","ResourceRecordSet":{"Name":"example.com","Type":"HTTPS","ResourceRecords":[{"Value":"1 . key65444=ex2"}],"TTL":1800}}]}'

An error occurred (InvalidChangeBatch) when calling the ChangeResourceRecordSets operation: [HTTPS does not support undefined parameters.]

Checklist


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license

@aws-cdk-automation aws-cdk-automation requested a review from a team June 18, 2025 03:49
@github-actions github-actions bot added distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2 labels Jun 18, 2025
@aws-cdk-automation aws-cdk-automation added the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Jun 18, 2025
@mwebber
Copy link

mwebber commented Aug 1, 2025

@Tietew it looks like this PR is pending for some reason. Are you able to re-run the checks (I guess if you rebase on main that will trigger it).

@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

@kumsmrit kumsmrit self-assigned this Sep 9, 2025
kumsmrit
kumsmrit previously approved these changes Sep 16, 2025
Copy link

@kumsmrit kumsmrit left a 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

@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2025

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

@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2025

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated.

You should update or rebase your pull request manually. If you do, this pull request will automatically be requeued once the queue conditions match again.
If you think this was a flaky issue, you can requeue the pull request, without updating it, by posting a @mergifyio requeue comment.

@aws-cdk-automation aws-cdk-automation removed the pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member. label Sep 16, 2025
@mergify
Copy link
Contributor

mergify bot commented Sep 16, 2025

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

@mergify mergify bot dismissed kumsmrit’s stale review September 18, 2025 15:29

Pull request has been modified.

@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2025

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

@mergify
Copy link
Contributor

mergify bot commented Sep 19, 2025

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

@mergify mergify bot merged commit 8be219a into aws:main Sep 19, 2025
19 checks passed
@github-actions
Copy link
Contributor

Comments on closed issues and PRs are hard for our team to see.
If you need help, please open a new issue that references this one.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 19, 2025
@Tietew Tietew deleted the route53-https-record branch September 19, 2025 10:04
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

distinguished-contributor [Pilot] contributed 50+ PRs to the CDK effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. p2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

route53: Add Support for HTTPSRecord

4 participants