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 🥳
Instructor: [0:00] In order to get started with AWS CDK, run npm install -g aws-cdk. Afterwards, verify if CDK has been successfully installed by running cdk --version. Now we can see that CDK has been installed and we have a version 1.32.2.
[0:15] Let me clear the terminal and we're going to start a brand new CDK project. I'm going to run cdk init and it is going to tell us that we have a couple of templates to choose from and also a number or programming languages that are supported by AWS CDK. For instance, we can use C#, F#, Java, JavaScript, TypeScript and Python. In this course, we are going to use TypeScript.
[0:34] We are going to start with our sample app. This is an example sticky application with some constructs that were already configured for us.
[0:40] Next let's create a directory for our app to live in. I'm going to mkdir ToDo-App and also cd into it. Next, we're going to run cdk init sample-app --language TypeScript. This is going to take a second. I'm just going to fast forward the video.
[0:57] Awesome. Everything went fine and we can see that we have created our very first CDK TypeScript project. Let's open up our editor and see what exactly was created for us.
[1:04] Cdk init has created a complete TypeScript CDK project for us. If we take a look into zip ToDo-App-stack.ts file, we're going to see our sample CDK stack.
[1:13] In order to make sure that we are able to build it, let's open up our terminal, enter run npm run build. As we can see, there are no warnings or issues, so we are ready to continue building our very first AWS CDK application.