Skip to content

Commit

Permalink
Merge branch 'main' into ashishdhingra-eks-KubectlV30Layer
Browse files Browse the repository at this point in the history
  • Loading branch information
ashishdhingra authored Jun 21, 2024
2 parents ad63578 + 95280a0 commit c911ffb
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 26 deletions.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-route53/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ const delegationRole = iam.Role.fromRoleArn(this, 'DelegationRole', delegationRo

// create the record
new route53.CrossAccountZoneDelegationRecord(this, 'delegate', {
delegatedZone: subZone, // Note that an imported HostedZone is not supported as Name Servers info will not be available
delegatedZone: subZone,
parentHostedZoneName: 'someexample.com', // or you can use parentHostedZoneId
delegationRole,
});
Expand Down
4 changes: 0 additions & 4 deletions packages/aws-cdk-lib/aws-route53/lib/record-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -929,10 +929,6 @@ export class CrossAccountZoneDelegationRecord extends Construct {
throw Error('Only one of parentHostedZoneName and parentHostedZoneId is supported');
}

if (!props.delegatedZone.hostedZoneNameServers) {
throw Error(`Not able to retrieve Name Servers for ${props.delegatedZone.zoneName} due to it being imported.`);
}

const provider = CrossAccountZoneDelegationProvider.getOrCreateProvider(this, CROSS_ACCOUNT_ZONE_DELEGATION_RESOURCE_TYPE);

const role = iam.Role.fromRoleArn(this, 'cross-account-zone-delegation-handler-role', provider.roleArn);
Expand Down
21 changes: 0 additions & 21 deletions packages/aws-cdk-lib/aws-route53/test/record-set.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -893,27 +893,6 @@ describe('record set', () => {
});
});

test('CrossAccountZoneDelegationRecord should throw if delegatedZone is imported', () => {
// GIVEN
const stack = new Stack();
const parentZone = new route53.PublicHostedZone(stack, 'ParentHostedZone', {
zoneName: 'myzone.com',
});

// WHEN
const childZone = route53.PublicHostedZone.fromPublicHostedZoneAttributes(stack, 'ChildHostedZone', {
hostedZoneId: 'fake-id',
zoneName: 'fake-name',
});

//THEN
expect(() => new route53.CrossAccountZoneDelegationRecord(stack, 'Delegation', {
delegatedZone: childZone,
parentHostedZoneId: parentZone.hostedZoneId,
delegationRole: parentZone.crossAccountZoneDelegationRole!,
})).toThrow(/Not able to retrieve Name Servers for fake-name due to it being imported./);
});

testDeprecated('Cross account zone delegation record with parentHostedZoneName', () => {
// GIVEN
const stack = new Stack();
Expand Down

0 comments on commit c911ffb

Please sign in to comment.