Development Tool of the Next Generation — AWS CDK

Beatrice
SoftChef Blog_EN
Published in
4 min readMay 25, 2022

Release New Functions, Versions with a Few Lines of Code

CDK Makes Auto-provisioning Possible

Since IaC (Infrastructure as Code) emerged, SoftChef has been sharing open source SDKs (Software Development Kit) on Github to help developers build AWS services and infrastructure faster. Not only does IaC hugely decrease the rate of manual errors, it also enables auto-provisioning workflow that saves a considerable amount of time for developers. AWS SDK has reached a stage of maturity. It is now compatible with all AWS services and supports many languages such as C++, Python, JavaScrip, etc.

Although AWS SDK has won applause from all sides, there is still inconvenience in real practices. For example, since each API addresses subtle actions independently, developers can’t preview the range of sectors about to be affected by the updates, let alone unit testing. It is difficult to carry out state management and version control. Given the existing problems of SDK, AWS launched CDK (Cloud Development Kit) in recent years, which not only makes it easier for developers to maintain IT infrastructure, but also lets developers automatically complete administrative tasks by code, helping the communities reduce lots of provisioning work.

Deploy Infrastructure Instantly, No Matter You Are a Beginner or Senior

CDK is an open framework for developers to use the languages they are familiar with to conduct AWS resource modelling and provisioning. In the past, developers could only use AWS CloudFormation to provision their cloud resources, meaning that they had to enter many lines of code to complete their tasks. But with CDK, developers can now finish most actions through modelling development tasks, which accelerates the speed of development.

As a heady IaC tool, AWS CloudFormation has already resolved the inconvenience of interacting with UI/CLI manually and it also enables an automated deployment process. However, its learning curve of state management is comparatively higher. Using AWS CloudFormation for state management would require high-level coding abilities. Moreover, once an update is made, developers need to wait for 5 to 10 minutes, which is against the implementation of CI/CD. Therefore, AWS launched CDK, the tool kit which helps developers instantly build development environments without the need to master AWS services. Developers can compile CDK applications at the preferred IDE (Integrated Development Environment), using the same environment for runtime process and infrastructure. This also facilitates the process of Serverless application development. Simply put, AWS CloudFormation is designed for advanced developers while AWS CDK marks the opening of the next generation of IaC by being able to help both junior and experienced AWS developers build their applications faster.

source

No More Coding, Just Copy and Paste

CDK is the formula that helps developers get the ideal results. By applying CDKs to their applications, developers don’t need to be coding day and night just for an insignificant feature. Developers can quickly test, deploy and even skip lengthy code reviews, which shortens the development lifecycle to a great extent.

const demoRestApi = new RestApi(stack, 'RestApiDemo', {
resources: [
{
path: '/articles',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticles', {
entry: `./lambda-assets/articles/get-articles/app.ts`,
}),
},
{
path: '/articles',
httpMethod: HttpMethod.POST,
lambdaFunction: new lambda.NodejsFunction(stack, 'CreateArticle', {
entry: `./lambda-assets/articles/create-article/app.ts`,
}),
},
{
path: '/articles/{articleId}',
httpMethod: HttpMethod.GET,
lambdaFunction: new lambda.NodejsFunction(stack, 'GetArticle', {
entry: `./lambda-assets/articles/get-article/app.ts`,
}),

@softchef/cdk-restapi

SoftChef takes on the experiences of developing AWS SDKs to share more open source CDKs for IoT management, API management, website auto-provisioning, AWS Lambda event management, IoT device management and JITP/JITR. Take @softchef/cdk-restapi for example. This CDK helps developers view different API source code easier by automatically sorting the data source and HttpMethod of each API. Developers can then save effort in administering REST APIs.

The most popular CDK is Constructs, maintained by AWS. Having about 2 million downloads every week, constructs is a model that helps fix issues of configuration and compatibility while representing the state of cloud applications. Currently it supports TypeScript, Python, Java, Go, .Net.

SoftChef is One of the AWS Construct Hub Publishers

To create a dynamic ecosystem, AWS launched the AWS Construct Hub, the open source online database for the CDK community earlier this year. For now, there are only five authorized publishers: AWS, Datadog, HashiCorp, Enfo, SoftChef. The CDKs maintained by SoftChef have about 4 thousand weekly downloads. Besides authorized publishers, individual developers can share their own construct resources as well. There are nearly 1 thousand CDK resources on the AWS Construct Hub now.

Progress with developers around the globe

The annual CDK Day is going to take place by the end of May. CDK Day is an online meetup for both beginner & expert CDK users around the world to share best practices, adaptation practices, optimization and more topics. SoftChef is looking forward to seeing more and more well-functioning CDKs. We believe that CDK is the most significant tool that realizes the idea of IaC, which is surely going to make developing AWS applications more efficient.

SoftChef Lab Team is actively maintaining the CDKs on the AWS Construct Hub. On top of that, our lab team is still working on projects of Modbus poll, CI/CD and will keep on contributing to the CDK developer community to accelerate development process as well as enriching the ecosystem.

References: AWS, iThome, iT邦幫忙

--

--