On July 2019 was released the AWS CDK a code-first library to define cloud application infrastructure.
The AWS CDK is a new software development framework from AWS with the sole purpose of making it fun and easy to define cloud infrastructure in your favorite programming language and deploy it using AWS CloudFormation.
The first thing that i realized is the AWS Cloudformation compatibility. every new written code is transformed to YML template, so almost everything in Cloudformation can be used here and that is really util.
And now as the resources are created using code, you can create unit test to improve the quality and make sure a new developer is no going to change something important there.
With CloudFormation, you also can write some tests, but it requires another tool
Ok, now let's talk about constructors, is a new introduced concept and are so useful because now you won't need to create a lot of unnecessary as you usually do in YAML, just "WRITE LESS AND DO MORE", for example We need to write around 1000 lines of code using CloudFormation, when we try with AWS CDK, we only need to write around 50 lines of code.
// DynamoDB table constructor new Table(scope: Construct, id: string, props: TableProps); // This represents a single EC2 instance. new Instance(scope: Construct, id: string, props: InstanceProps) // Creates a new EBS Volume in AWS EC2 new Volume(scope: Construct, id: string, props: VolumeProps)
More good things, the deployment process is a little bit friendly and request some confirmations before deploy.
Also you can see the updated resources easily after deploy.
There is something that personally is bad, and is the way to run the application locally. You can't do it using AWS CDK, you have to build the code to YML and execute it using AWS SAM, so you will need and step more before try every new change locally.
I hope this post has been useful for you.
Finally, you have a great Workshop here: https://cdkworkshop.com/
CDK use guide: https://docs.aws.amazon.com/cdk/latest/guide/home.html
Some examples: https://github.com/aws-samples/aws-cdk-examples