diff --git a/lambda-packages/dns-validated-domain-identity-handler/src/record.ts b/lambda-packages/dns-validated-domain-identity-handler/src/record.ts index 69f2d7bd..c5fb4714 100644 --- a/lambda-packages/dns-validated-domain-identity-handler/src/record.ts +++ b/lambda-packages/dns-validated-domain-identity-handler/src/record.ts @@ -19,26 +19,16 @@ export class Record { ) {} public action(type: "CREATE" | "UPSERT" | "DELETE"): Change { - if (type === "DELETE") { - return { - Action: "DELETE", - ResourceRecordSet: { - Name: this.name, - Type: this.type, - }, - }; - } else { - return { - Action: type, - ResourceRecordSet: { - Name: this.name, - Type: this.type, - ResourceRecords: [{ - Value: this.value, - }], - TTL: this.ttl, - }, - }; - } + return { + Action: type, + ResourceRecordSet: { + Name: this.name, + Type: this.type, + ResourceRecords: [{ + Value: this.value, + }], + TTL: this.ttl, + }, + }; } } diff --git a/lambda-packages/dns-validated-domain-identity-handler/test/record.test.ts b/lambda-packages/dns-validated-domain-identity-handler/test/record.test.ts index aa30cb21..6d8bd0cb 100644 --- a/lambda-packages/dns-validated-domain-identity-handler/test/record.test.ts +++ b/lambda-packages/dns-validated-domain-identity-handler/test/record.test.ts @@ -69,6 +69,10 @@ describe(Record.name, () => { ResourceRecordSet: { Name: "example.com", Type: "CNAME", + TTL: 1234, + ResourceRecords: [ + { Value: "target.example.com" }, + ], }, }); }); diff --git a/lambda-packages/dns-validated-domain-identity-handler/test/verifier.test.ts b/lambda-packages/dns-validated-domain-identity-handler/test/verifier.test.ts index bcf19278..e90bdf89 100644 --- a/lambda-packages/dns-validated-domain-identity-handler/test/verifier.test.ts +++ b/lambda-packages/dns-validated-domain-identity-handler/test/verifier.test.ts @@ -179,6 +179,10 @@ describe(Verifier.name, () => { ResourceRecordSet: { Name: "_amazonses.example.com", Type: "TXT", + TTL: 1800, + ResourceRecords: [ + { Value: "\"token\"" }, + ], }, }], }, @@ -395,18 +399,30 @@ describe(Verifier.name, () => { ResourceRecordSet: { Name: "foo._domainkey.example.com", Type: "CNAME", + TTL: 1800, + ResourceRecords: [ + { Value: "foo.dkim.amazonses.com"}, + ], }, }, { Action: "DELETE", ResourceRecordSet: { Name: "bar._domainkey.example.com", Type: "CNAME", + TTL: 1800, + ResourceRecords: [ + { Value: "bar.dkim.amazonses.com"}, + ], }, }, { Action: "DELETE", ResourceRecordSet: { Name: "baz._domainkey.example.com", Type: "CNAME", + TTL: 1800, + ResourceRecords: [ + { Value: "baz.dkim.amazonses.com"}, + ], }, }], },