Skip to content
binaryheap
Go back

Intro to CDK

AWS CDK (Cloud Developer Kit) is a new way to develop cloud infrastructure as it relates to AWS by brining your favorite programming language to apply abstractions on top of CloudFormation. This won’t be a super in-depth post on the tech and how to apply it (I’ll follow up with more articles later) but I’d like outline some of the benefits and reasons that you might consider your next feature’s infrastructure be coded up with it.

Why Choose CDK

Developer productivity. Hard to call it traditional considering how far Cloud Infra development has come, but usually infra has been constructed by another team. CloudFormation often proved a high bar for developers to overcome and take ownership over. Reasons for this

How does CDK address the above?

test('Should have Queue with Name', () => {
  let stack = new Stack();
  let ms = new MessagingStack(stack, 'TestLib', props);

  let template = Template.fromStack(ms);
  template.hasResourceProperties('AWS::SQS::Queue', {
    QueueName: `${props.stackPrefix}-${props.queueName}-queue`,
  });
});
import { Construct } from 'constructs';

export class YourConstruct extends Construct {
    // insert all of your specifics here like defining a Lambda function with
    // a queue that allows a developer to use this while getting 
    // organizational best practices

By giving developers constructs like included testing and allowing them to take advantage of organizational best practices, you can reduce the burden on your Cloud/DevOps teams to focus other key tasks. Another nice benefit is that you can code up this infra in (as of now)

Also, you spread the Cloud awareness so that everyone is super familiar with the infra and services that are being used in your organization

How to get Started

The place I did was to have a look at the CDK Pipelines Construct. Also this is a great AWS Article describing what it all means and how to use it.

What does this mean? A very opinionated set of code that easily allows you as the developer to focus on deploying code and not worrying about how. The construct will build pipeline that

Important thing about CDK. It ultimately boils down to building really good CloudFormation code with the appropriate permissions and restrictions so that you aren’t just granting ”*” on all resources with a give permission.

Wrap Up

Give CDK a shot if you are looking to start a new feature or you are looking to expand your team’s knowledge in your Cloud Infra while also removing some burden on the CloudOps team. I know that I’ve personally seen the speed and safety that it’s brought to my groups and the relief in terms of having to make changes in the way a teams code is deployed.

Next Steps


Share this post on:

Previous Post
AWS CDK Pipeline