DEV Community

Cover image for Install AWSCDK / CDKTF
Anjana Prasad
Anjana Prasad

Posted on • Updated on

Install AWSCDK / CDKTF

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.

Image description

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

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

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

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

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

cdk init --list: This lists available option in CDK.

Image description

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 zip package version from the official website.

Image description

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

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

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

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

Image description

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

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

Top comments (0)