Install AWS Cloud Development Kit (CDK) and Create a New Project

Tomasz Łakomy
InstructorTomasz Łakomy

Share this video with your friends

Send Tweet
Published 4 months ago
Updated 3 months ago

All amazing projects have to start somewhere and AWS CDK is no exception. In this quick lesson we're going to learn how to install AWS CDK command line interface with npm as well as how to use cdk init in order to create our very first CDK project :partying_face:

Instructor: [0:00] To get started with AWS CDK, we are going to run npm install -g aws-cdk. We can run CDK --version to verify which CDK version are we on. You will probably see a newer version on your machine, but what matters here is that we are running CDK version 2.

[0:17] Let me create a new directory for our project. I'm going to cd into it, and here I'm going to run cdk init to create a new CDK project.

[0:26] We can see that we have three available templates to choose from. I'm going to go with sample-app. I'm going to run cdk init sample-app, and I'm going to choose language, which is going to be equal to typescript.

[0:39] This command has done the following. It has created a brand-new git repository for us, executed npm install, and created a brand-new CDK App, which contains an Amazon SQS queue that is subscribed to an SNS topic.

[0:51] Let me open up a code editor. Here, we can see that the CDK command-line interface has created a brand-new project for us. Let's take a look at package.json. Here, we can see that the CDK version is exactly the same as we have installed before using the command line interface.

[1:06] In order to verify that the whole project has been configured successfully, I'm going to run the build command. I'm going to open up the terminal and run npm run build. With all of that in place, we can see that there are no warnings, there are no errors, and we are ready to get started.