Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
{
"Resources": {
"HostedZoneDB99F866": {
"Type": "AWS::Route53::HostedZone",
"Properties": {
"HostedZoneFeatures": {
"EnableAcceleratedRecovery": true
},
"Name": "cdk.test."
}
}
},
"Parameters": {
"BootstrapVersion": {
"Type": "AWS::SSM::Parameter::Value<String>",
"Default": "/cdk-bootstrap/hnb659fds/version",
"Description": "Version of the CDK Bootstrap resources in this environment, automatically retrieved from SSM Parameter Store. [cdk:skip]"
}
},
"Rules": {
"CheckBootstrapVersion": {
"Assertions": [
{
"Assert": {
"Fn::Not": [
{
"Fn::Contains": [
[
"1",
"2",
"3",
"4",
"5"
],
{
"Ref": "BootstrapVersion"
}
]
}
]
},
"AssertDescription": "CDK bootstrap stack version 6 required. Please run 'cdk bootstrap' with a recent version of the CDK CLI."
}
]
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import * as cdk from 'aws-cdk-lib';
import * as route53 from 'aws-cdk-lib/aws-route53';
import { IntegTest } from '@aws-cdk/integ-tests-alpha';

const app = new cdk.App();
const stack = new cdk.Stack(app, 'route53-accelerated-recovery');

new route53.PublicHostedZone(stack, 'HostedZone', {
zoneName: 'cdk.test',
acceleratedRecoveryEnabled: true,
});

new IntegTest(app, 'route53-accelerated-recovery-integ', {
testCases: [stack],
});
16 changes: 16 additions & 0 deletions packages/aws-cdk-lib/aws-route53/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,22 @@ When directly constructing the `KeySigningKey` resource, enabling DNSSEC signing
zone will be need to be done explicitly (either using the `CfnDNSSEC` construct or via another
means).

## Accelerated Recovery

Route 53 accelerated recovery for managing public DNS records is designed to achieve a 60-minute Recovery Time Objective (RTO) in the event of service unavailability in the US East (N. Virginia) Region.
When enabled on a Route 53 public hosted zone, you will be able to resume making changes to DNS records in the public hosted zone within approximately 60 minutes after AWS detects that operations in the US East (N. Virginia) Region are impaired.

This feature is only available for public hosted zones.

```ts
new route53.PublicHostedZone(this, 'HostedZone', {
zoneName: 'example.com',
acceleratedRecoveryEnabled: true,
});
```

For more information, see [Enabling accelerated recovery for managing public DNS records](https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/accelerated-recovery.html).

## Imports

If you don't know the ID of the Hosted Zone to import, you can use the
Expand Down
20 changes: 20 additions & 0 deletions packages/aws-cdk-lib/aws-route53/lib/hosted-zone.ts
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,19 @@ export interface PublicHostedZoneProps extends CommonHostedZoneProps {
*/
readonly caaAmazon?: boolean;

/**
* Whether to enable accelerated recovery for this hosted zone.
*
* Accelerated recovery reduces the time to recovery when a hosted zone
* becomes unavailable due to DNS resolution issues.
*
* This feature is only available for public hosted zones.
*
* @default - no accelerated recovery
* @see https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/hosted-zone-accelerated-recovery.html
*/
readonly acceleratedRecoveryEnabled?: boolean;

/**
* A principal which is trusted to assume a role for zone delegation
*
Expand Down Expand Up @@ -435,6 +448,13 @@ export class PublicHostedZone extends HostedZone implements IPublicHostedZone {
// Enhanced CDK Analytics Telemetry
addConstructMetadata(this, props);

if (props.acceleratedRecoveryEnabled !== undefined) {
const cfnHostedZone = this.node.defaultChild as CfnHostedZone;
cfnHostedZone.hostedZoneFeatures = {
enableAcceleratedRecovery: props.acceleratedRecoveryEnabled,
};
}

if (props.caaAmazon) {
new CaaAmazonRecord(this, 'CaaAmazon', {
zone: this,
Expand Down
23 changes: 23 additions & 0 deletions packages/aws-cdk-lib/aws-route53/test/hosted-zone.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,3 +765,26 @@ describe('key signing key', () => {
expect(() => zone.enableDnssec({ kmsKey: key })).toThrow('DNSSEC is already enabled for this hosted zone');
});
});

describe('acceleratedRecoveryEnabled', () => {
test.each([
[true, { EnableAcceleratedRecovery: true }],
[false, { EnableAcceleratedRecovery: false }],
[undefined, Match.absent()],
])('acceleratedRecoveryEnabled=%p creates HostedZoneFeatures=%p on PublicHostedZone', (acceleratedRecoveryEnabled, expectedFeatures) => {
// GIVEN
const stack = new cdk.Stack();

// WHEN
new PublicHostedZone(stack, 'HostedZone', {
zoneName: 'testZone',
acceleratedRecoveryEnabled,
});

// THEN
Template.fromStack(stack).hasResourceProperties('AWS::Route53::HostedZone', {
Name: 'testZone.',
HostedZoneFeatures: expectedFeatures,
});
});
});
Loading