AWS

About migrating the rootmail feature to cdk

The story of the migration of the opinionated **rootmail** from superwerker on AWS to cdk and the learnings.

Photo by Manuel Vogel-Johnson

This talk is about the journey of migrating the rootmail feature into a standalone cdk construct. The challenges, obstacles and solution.

As mentioned in the linked post here

I wanted port the existing superwerker rootmail feature for AWS to cdk.

TL;DR

You can use the construct in your cdk app as follows:

import { Rootmail } from '@mavogel/awscdk-rootmail';
import {
  App,
  Stack,
  StackProps,
  aws_route53 as r53,
} from 'aws-cdk-lib';
import { Construct } from 'constructs';
 
export class BoostrapStack extends Stack {
  constructor(scope: Construct, id: string, props: StackProps = {}) {
    super(scope, id, props);
 
    const domain = 'mycompany.test'
 
    const hostedZone = r53.HostedZone.fromLookup(this, 'rootmail-parent-hosted-zone', {
      domainName: domain,
    });
 
    new Rootmail(this, 'rootmail', {
      // 1. a domain you own, registered via Route53 in the SAME account
      domain: domain,
      // 2. so the subdomain will be aws.mycompany.test and
      subdomain: 'aws',
      // wired / delegated  automatically
      wireDNSToHostedZoneID: hostedZone.hostedZoneId,
    });
  }
}

Architecture

Next up is a short overview of the architecture:

All the lessons learned are documented in the linked blog post in the slides, also the associated repositories are the following:

Some impressions

Feel free to provide feedback in the form of issues or pull requests. There is also a CONTRIBUTING.md in the repository, which explains it in more detail.

Photos by Manuel Vogel-Johnson
Engineers reviewing cloud architecture

Track record

Outcomes that hold up in production

Measured results from real engagements - faster releases, lower bills, and platforms that stay healthy under load.

Production AWS workloads shipped
25+
Typical deployment frequency
10x / day
Uptime maintained across clients
99.999%
Average cloud cost reduced
23%

Ready to ship faster on AWS?

Tell us what you are building. We will map the fastest safe path to production and the platform to keep it there.