UNPKG

@common-creation/aws-cdk-ses-domain-identity

Version:

Constructs for provisioning and referencing domain identities which can be used in SES RuleSets and Actions Construct.

25 lines 1.07 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DeleteCustomResourceHandler = void 0; const verifier_1 = require("../verifier"); const base_1 = require("./base"); class DeleteCustomResourceHandler extends base_1.CustomResourceHandler { async consumeEvent() { // If the resource didn't create correctly, the physical resource ID won't be // the requested domain name. so don't try to delete it in that case. if (this.event.PhysicalResourceId === this.event.ResourceProperties.DomainName) { const verifier = verifier_1.Verifier.from(this.event.ResourceProperties); if (this.event.ResourceProperties.DKIM) { await verifier.disableDKIM(); } await verifier.revokeIdentity(); } return { // Keep Physical Resource ID physicalResourceId: this.event.PhysicalResourceId, data: {}, }; } } exports.DeleteCustomResourceHandler = DeleteCustomResourceHandler; //# sourceMappingURL=delete.js.map