Skip to content

feat(route53): add SVCB and HTTPS resource record classes #34744

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

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/

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.

Usage

declare const zone: route53.IHostedZone;

// 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: [...],
  }),
});

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
@aws-cdk-automation
Copy link
Collaborator

AWS CodeBuild CI Report

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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 pr/needs-community-review This PR needs a review from a Trusted Community Member or Core Team Member.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

route53: Add Support for HTTPSRecord
2 participants