Skip to content

Commit fd9be1b

Browse files
committed
Add AAAA DNS record to provide IPv6 support
1 parent 4c032ee commit fd9be1b

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

packages/cdk/constructs/RestApiGateway.ts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ import {CfnSubscriptionFilter, LogGroup} from "aws-cdk-lib/aws-logs"
1414
import {Construct} from "constructs"
1515
import {accessLogFormat} from "./RestApiGateway/accessLogFormat"
1616
import {Certificate, CertificateValidation} from "aws-cdk-lib/aws-certificatemanager"
17-
import {ARecord, HostedZone, RecordTarget} from "aws-cdk-lib/aws-route53"
17+
import {
18+
ARecord,
19+
AaaaRecord,
20+
HostedZone,
21+
RecordTarget
22+
} from "aws-cdk-lib/aws-route53"
1823
import {ApiGateway as ApiGatewayTarget} from "aws-cdk-lib/aws-route53-targets"
1924

2025
export interface RestApiGatewayProps {
@@ -100,6 +105,12 @@ export class RestApiGateway extends Construct {
100105
zone: hostedZone
101106
})
102107

108+
new AaaaRecord(this, "AAAARecord", {
109+
recordName: props.stackName,
110+
target: RecordTarget.fromAlias(new ApiGatewayTarget(apiGateway)),
111+
zone: hostedZone
112+
})
113+
103114
const cfnStage = apiGateway.deploymentStage.node.defaultChild as CfnStage
104115
cfnStage.cfnOptions.metadata = {
105116
guard: {

0 commit comments

Comments
 (0)