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

Figures from a hands-on NTC landing-zone delivery through Nuvibit's partner programme.

Full NTC landing zone delivered
1-2 weeks
Terraform plan/apply feedback cycle
3-8 min
NTC deployment phases shipped end to end
6+
GitHub to AWS federation - no long-lived AWS credentials in CI after bootstrap
OIDC

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.