Setup AWS CDK In 2 Minutes

In 2 Minutes โ€” Setup AWS CDK for You AWS Cloud Projects

โ€ข

This article will guide you to install and configure AWS CDK for all your future projects that are going to build on AWS. This guide will work for all three platforms โ€” Linux, Mac, and Windows

The AWS Cloud Development Kit (AWS CDK) is an open-source software development framework to define your cloud application resources using familiar programming languages.

CDK can save you from all troublesome activities like manually creating buckets on AWS, write custom scripts, maintain templates, or learn domain-specific languages. It utilizes highly expressive and easy to code syntax in your favorite programming language โ€” In our case, it will be Python.

Prerequisites for following this article โ€”

  1. NPM and Node v12+ installed

  2. Python v3.6+ version installed

Step 1. Install AWS CDK

AWS CDK is fairly easy to install using NPM. Run the below command to install AWS CDK.

$ npm install -g aws-cdk

This will install the latest stable version of CDK globally in your system. CDK will be used to create our very first CDK app.

Step 2. Create Your First CDK App

  1. Run the below commands to create a CDK app with the runtime as Python. Following commands works well in Mac and Linux OS.

    $ mkdir project-cdk && cd project-cdk $ cdk init app --language=python

In case you are using _Windows, _you can create **project-cdk **directory using right-click option and then run the _cdk init _command inside project-cdk.

After successful initialization, you will see some files inside the directory as shown below:

.
โ”œโ”€โ”€ README.md
โ”œโ”€โ”€ app.py
โ”œโ”€โ”€ cdk.json
โ”œโ”€โ”€ project-cdk
โ”‚ โ”œโ”€โ”€ __init__.py
โ”‚ โ””โ”€โ”€ project-cdk_stack.py
โ”œโ”€โ”€ requirements.txt
โ”œโ”€โ”€ setup.py
โ””โ”€โ”€ source.bat

And thatโ€™s it!

More About The Author๐Ÿ˜„

I am a full-time software engineer with 4+ years of experience in Python, AWS, and many more technologies. I have started writing recently as it helps me to read more. I am looking forward to sharing technical knowledge and my life experiences with people out there.

Register Here for my Programmer Weekly newsletter where I share interesting tutorials, python libraries, and tools, etc.

image

Github | LinkedIn | Twitter | Facebook | Quora | Programmer Weekly

Enjoyed this article?

Share it with your network to help others discover it

Continue Learning

Discover more articles on similar topics