Skip to content

Commit

Permalink
fix(route53): CaaAmazonRecord ignores recordName (#6027)
Browse files Browse the repository at this point in the history
Fixes #5764

Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
  • Loading branch information
jogold and mergify[bot] authored Feb 3, 2020
1 parent 0a586fc commit 16f9721
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 2 deletions.
1 change: 0 additions & 1 deletion packages/@aws-cdk/aws-route53/lib/record-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,6 @@ export class CaaAmazonRecord extends CaaRecord {
value: 'amazon.com'
}
],
recordName: props.zone.zoneName
});
}
}
Expand Down
30 changes: 29 additions & 1 deletion packages/@aws-cdk/aws-route53/test/test.record-set.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,6 @@ export = {
// WHEN
new route53.CaaAmazonRecord(stack, 'CAAAmazon', {
zone,
recordName: 'www', // should have no effect
});

// THEN
Expand All @@ -393,6 +392,35 @@ export = {
test.done();
},

'CAA Amazon record with record name'(test: Test) {
// GIVEN
const stack = new Stack();

const zone = new route53.HostedZone(stack, 'HostedZone', {
zoneName: 'myzone'
});

// WHEN
new route53.CaaAmazonRecord(stack, 'CAAAmazon', {
zone,
recordName: 'www',
});

// THEN
expect(stack).to(haveResource('AWS::Route53::RecordSet', {
Name: "www.myzone.",
Type: "CAA",
HostedZoneId: {
Ref: "HostedZoneDB99F866"
},
ResourceRecords: [
'0 issue "amazon.com"'
],
TTL: "1800"
}));
test.done();
},

'MX record'(test: Test) {
// GIVEN
const stack = new Stack();
Expand Down

0 comments on commit 16f9721

Please sign in to comment.