@reapit-cdk/email-receiver
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

@reapit-cdk/email-receiver

npm version npm downloads coverage: 99.02%25 Integ Tests: ✔

This construct sets up everything necessary to receive email. The emails get stored in a dynamodb table, queryable by recipient. This is designed to be used in end-to-end tests, with the @reapit-cdk/email-receiver-client helper library.

Package Installation:

yarn add --dev @reapit-cdk/email-receiver
# or
npm install @reapit-cdk/email-receiver --save-dev

Usage

import { CfnOutput, Stack, App } from 'aws-cdk-lib'
import { HostedZone } from 'aws-cdk-lib/aws-route53'
import { EmailReceiver } from '@reapit-cdk/email-receiver'

const app = new App()
const stack = new Stack(app, 'stack-name', {
  env: {
    region: 'us-east-1', // region must be specified
  },
})

const hostedZone = new HostedZone(stack, 'hostedZone', {
  zoneName: 'example.org',
})

const emailReceiver = new EmailReceiver(stack, 'domain', {
  hostedZone,
  // you can optionally override the parent domain
  // (e.g. your hosted zone is example.org but you want to use dev.example.org)
  // parentDomain: '',
  // you can optionally override the subdomain
  // this defaults to 'email' so the resulting domain will be email.example.org
  // subdomain: '',
})

new CfnOutput(stack, 'emailReceiverDomainName', {
  value: emailReceiver.domainName,
})
new CfnOutput(stack, 'emailReceiverTableArn', {
  value: emailReceiver.table.tableArn,
})

Readme

Keywords

Package Sidebar

Install

npm i @reapit-cdk/email-receiver

Weekly Downloads

1

Version

0.1.2

License

MIT

Unpacked Size

1.92 MB

Total Files

13

Last publish

Collaborators

  • joshbalfour