Time to deploy! Learn how to use the npm run watch
command to watch for changes and compile TypeScript to JavaScript.
But, the main thing you'll learn is how to use the cdk deploy
command to deploy your app to AWS and then navigate to your app through the AWS web console.
Tomasz Łakomy: [0:00] Let's make sure that we can deploy this empty CDK stack. In order to do that, let us open up the terminal and run npm run watch. This is going to enable TypeScript configuration from TypeScript to JavaScript in watch mode.
[0:13] For instance, if I add this variable, which is a TypeScript variable, because it is of type string, I can see that a JavaScript file was created for me. You can see that it was successfully compiled because there are no types here. With that, I can open up a new terminal tab. Let me remove this bit in the meantime. I'm going to run cdk deploy, in order to deploy this empty stack to AWS.
[0:36] After a couple of seconds, we can see that our stack has been successfully deployed. Let me navigate to AWS Management Console. Next, I'm going to navigate to CloudFormation, in order to make sure that our stack is successfully deployed to CloudFormation. We can see two stacks here. This is the internal CDK one, and this is our stack that we're going to build over the course of this course.
[0:59] If I click over here, I'm going to navigate to Resources, and we can see that our stack has been successfully created. Even though there isn't much here, apart from this AWS CDKMetadata, but this is going to change very soon.
[1:11] Last side note, if you cannot see you're stack over here, make sure that you have selected the proper region in AWS Console.