Skip to content

Commit

Permalink
fix(domain): expose sns topic
Browse files Browse the repository at this point in the history
Fixes #514
  • Loading branch information
pflorek committed Oct 19, 2022
1 parent 143b58d commit c774147
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
8 changes: 8 additions & 0 deletions API.md

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

9 changes: 7 additions & 2 deletions src/verify-ses-domain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,11 @@ export interface IVerifySesDomainProps {
* });
*/
export class VerifySesDomain extends Construct {
/**
* The SNS topic where bounces, complaints or delivery notifications can be sent to.
*/
public readonly notificationTopic: ITopic;

constructor(parent: Construct, name: string, props: IVerifySesDomainProps) {
super(parent, name);

Expand All @@ -85,8 +90,8 @@ export class VerifySesDomain extends Construct {
} = props;

const verifyDomainIdentity = this.verifyDomainIdentity(domainName);
const topic = this.createTopicOrUseExisting(domainName, verifyDomainIdentity, notificationTopic);
this.addTopicToDomainIdentity(domainName, topic, notificationTypes);
this.notificationTopic = this.createTopicOrUseExisting(domainName, verifyDomainIdentity, notificationTopic);
this.addTopicToDomainIdentity(domainName, this.notificationTopic, notificationTypes);

const zone = this.getHostedZone({ name: hostedZoneName || domainName, id: hostedZoneId });
if (!zone) throw new Error('Can not determine hosted zone. Provide a hostedZoneName or hostedZoneId.');
Expand Down

0 comments on commit c774147

Please sign in to comment.