Install AWSCDK / CDKTF
Tags: aws, beginners, cloudskills, tutorial
Published: 2022-07-14 04:56:22

In this tutorial, you will learn how to install _NodeJS_, _AWSCDK_  and _Terraform_, _AWSCDKTF_ in your windows system.

**Prerequisites:**
Windows System with Administrator login.

**Install NodeJS in your system.**

Step 01.
Download NodeJS package.
Go to NodeJS official site and download the NodeJS latest version. You can go to official web site by clicking on [here](https://nodejs.org/en/download/).




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ol9v0clyz03qpjbrju25.PNG)




> Once you click on Windows Installer it will automatically download the NodeJS package into your system.


Step 02.
Installing NodeJS in your computer. 
You can find a downloaded package in your system download folder or click on the download icon on your browser. 
As shown in the below you can see the package downloaded into the system.
To open setup wizard double click on downloaded **.exe** file.





![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hy5po3beq96wnxk5uvno.PNG)




As you can see in the above figure, it will appear NodeJS setup wizard.
On the next page, it will appear end user license and agreement step. Put a tick on I accept the terms in the license agreement and click on the Next button.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0ub64okktzr0q8tp94wy.PNG)




The Installer will prompt to confirm the package install location. I’m going to use the default location to install node packages and click on the next button. If you want to install your node package in the custom location you can change it in this step.

The next step is the wizard prompt about the custom installation setup. Leave it as default and click on the Next button.
The install wizard prompt to confirm additional node 
modules. Put a tick on automatically installing necessary node modules.


Eventually, click on the install button to start NodeJS installation in your system. It will take a couple of minutes to complete the installation base on your system performance. Click on the finish button once the installation is completed.


Now we can verify our node installation, open your cmd prompt and type **npm -v** and **node -v** command.




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/6peztyh0tjw0tiai72p3.PNG)




**Install AWS CDK in your windows system.**

Open your windows command prompt with admin privileges and type npm install aws-cdk -g and press enter key. It will start the cdk installation.




![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7uk0vzs4bq0tnhwvozmv.PNG)




To verify cdk installed in your system run _cdk –version_ command.

**Initiate your first cdk project.** 

Create an empty folder for your project and change directory _mkdir example-project && cd example-project_.


_cdk init app --language typescript_. Once you execute, it will download relevant configuration files into the project folder.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wadg3yqn99ntcoc0bd2f.PNG)



_cdk init --list_: This lists available option in CDK.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ek05xtammrp2dd9ltfre.PNG)


**Install CDK TF in your system.**

Install CDKTF in your local system. As a first step, you need to install terraform package in your local system. Let’s get started with to terraform installation.

Step 01.
We need to download the terraform package to our local system. Downloads _[terraform ](https://www.terraform.io/downloads)_ zip package version from the official website.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gtxuw9rhxv8u0he779re.PNG)


> Click on Amd64 it will start download package to system.


Step 02.
Once a package is download, create an empty folder. Create a folder called terraform in **C** drive and extract a zip file from the download folder to extract the executable to a directory. After extract the zip file can see the terraform.exe file in **C:\terraform**.



Step 03.
Now we need to set a system environment variable. For that press _windows key + R_ . it will open windows run. In windows run type **sysdm.cpl** it will open system properties. In the system, properties select _Advanced tab_ under Advanced tab click on _Environment variable_ option.



Step 04.
On the Next page, Under the System variable select PATH and click on the edit button. It will prompt _Edit environment_ variable option. Click on **New** and add your _terraform zip file extract location_ and click on the ok button in both prompts.



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fsd21old43f7iabdkc9i.PNG)


Step 05
Using terraform version command, can verify the terraform version. Open a command prompt in your system and type terraform version command and hit enter key. it will give you the terraform version.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3bjgj0kmquxy1ek4keba.PNG)

> Run terraform -h command to list available commands in terraform.

**Installing CDKTF in your windows system.**
Step 01.
Open your windows command prompt with admin privileges and type _npm install -g cdktf-cli_ and hit the enter key. It will start the cdktf installation for getting the latest version use this command _npm install -g cdktf-cli@next_.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/yomkk4nukqbvkd9d6eav.PNG)


To verify cdk installed in your system run _cdktf --version _ command.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wfpjt8p6wnoqkhpgi55k.PNG)


**Step 02.**
Initiate your first cdk project. 
Create an empty folder for your project and change directory_ mkdir cdktf -example && cd cdktf-example_
_cdktf init --template=typescript --local_. Once you execute, it will download relevant configuration files into the project folder.
_cdktf --list _This lists available option in CDK.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4nw5uic66f0ug2h5oxje.PNG)


Conclusion.
In this tutorial, we discussed AWSCDK and CDKTF installation steps. In addition to that, you have learned terraform and nodejs installation.
Feel free to add your valuable comment below the comment section. 



> AWSCDK use a cloud formation template to create resources in AWS.



> AWSCDKTF use terraform to create resources in AWS