AWS CDK (Cloud Development Kit)— 101
This post provides you a quick overview for AWS Cloud Development Kit, also known as CDK
What is AWS CDK?
The AWS CDK lets you build reliable, scalable, cost-effective applications in the cloud with the considerable expressive power of a programming language.
This is how AWS puts the definition for AWS CDK. The key here is the “programming language”
Building applications on Cloud primarily refers to IaC here, which stands for “Infrastructure as a code”. AWS already provides AWS CloudFormation, as one of the fundamental “infrastructure as a code” framework, to provision AWS resources.
CloudFormation and other similar IaC tools, based on configuration file, have some shortcomings though. You need to learn a new syntax and rules. Also its difficult to apply advanced logic like conditions, loops, etc. as the CodeFormation is based on configuration files.
CDK tries to address these challenges. It provides the framework, where you can use your own “programming language”, like Python, Node, Java, etc., to automate your infrastructure provisioning.
What are the Benefits?
CDK can enable the developers and teams, to automate their continuous delivery pipelines, with more efficiency and ease. Lets look at the complete set of benefits —
You can use programming idioms like parameters, conditionals, loops to model your IaC code, with advanced decision flow. As discussed earlier, with configuration files, this becomes more complex to implement.
You can also use the constructs, provided by AWS, to build your code more granular. You can leverage the object oriented concepts, like inheritance, to build and manage your infrastructure code, much better.