With an AWS CDK example to configure SES for outbound email

Barely relevant photo by Onlineprinters on Unsplash

I’ve always felt that AWS Simple Email Service (SES) doesn’t get the love it deserves. It is significantly cheaper than more full-featured email services like MailChimp and Constant Contact, and significantly more powerful than your own SMTP relay server.

If you are making a business out of email marketing then SES probably isn’t for you — and you are probably already using one of the pros. …


How to set up parameters and logging to S3 for SNS SMS messaging

Photo by Oleg Magni on Unsplash

Configuring SMS messaging parameters in SNS seems to come up often for me, required in most test and new accounts — so why not automate it using CDK.

The TLDR version — you can download the Javascript code on GitHub here.

One of my favourite things about CDK is the ease in creating custom Lambda resources to make AWS API calls. It means you can configure just about anything in your AWS environment with CDK.

More specifically — CDK custom resources use the Javascript SDK, so you can do anything supported by the SDK.

This one is a simple operation…


Create a public web server behind an ALB using CDK

Fargate Web App

This is a short article to explain a demo you can download the Javascript code on GitHub here.

The demo creates Fargate services with a Docker containers for a web apps. The containers can be created from a local definition or an image on Docker Hub or ECR.

As a bonus there is a basic scheduler included using EventBridge.

I use this pattern a to test web apps created by other teams (front-end applications are definitely not my thing).

In this case the ALB is created publicly because it’s simpler…


How to enable custom names for your internal APIs, with CDK example

Photo by Safar Safarov on Unsplash

AWS API Gateway Private is the ideal way to front our internal applications and services, but there’s one frustrating limitation — you cannot assign a custom domain name to a private API like you do with one that is public facing.

This leads to internal APIs with less than friendly names like:

https://abcdefsxthl.execute-api.ap-southeast-1.amazonaws.com/v1

Or if you need the name to resolve for remote users (VPN or on-prem over Direct Connect), then it would look like this:

https://abcdefsxthl-vpce-aaaaff0d0673c9999.execute-api.ap-southeast-1.amazonaws.com/v1

Either way, it’s a pain to remember! What’s worse is if it’s redeployed for any reason the name will change — ok for…


Now the infrastructure really is code, and it’s a game changer

Photo by Chris Briggs on Unsplash

I believe AWS CDK is a game-changer.

I’ve been using CloudFormation on AWS since it was first introduced, but it never felt like code. Terraform and Serverless are just more specialised (or cross-platform) versions of the same.

With CDK the infrastructure really is code. With loops, and reusable constructs, and unit tests, and all the other goodness that comes with real programming languages. This is a good thing. Some of the modules and microservices I’ve migrated to CDK require CloudFormation templates of more than 1000 lines of code (although…


How to use shared services to deploy code from development into production

Pipeline Workflow

Cross account pipelines are a pretty common scenario, and recommended by AWS amongst others as a best practice, but complete documentation on how to do it with CDK Pipelines was impossible to find. So here it is…

The Scenario

I’m using AWS CDK to develop and deploy infrastructure and apps into pre-prod and production environments. Specifically, there is:

  • A Dev account (Account number: 111111111111), where the code resides in CodeCommit repositories, and where development code is deployed. …

Mark Ilott

Solution Architect specialising in AWS, sharing IaC tips and tricks

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store