In case you don't have AWS Command Line Interface (CLI) installed, please refer to the instructions to intall.
https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-install.html
Install or update the AWS CDK CLI from npm (requires Node.js >= 8.11x):
$ npm i -g aws-cdkcheck the cdk version to verify installation success, the version should be + aws-cdk@1.8.0
We'll walk through by a sample project to install some useful IDE and extensions to have better development experience. In this workshop we are developing aws-cdk python application, please make sure you have installed python3 ( >= 3.6) with pip3 interpreter accordingly.
# create a test folder as below, or name it whatever you want.
$ mkdir cdk-test
$ cd cdk-test
# create the aws cdk project by init sub-command and sample application, specify the language as python
$ cdk init sample-app --language=pythonActivate the python environment, and install all of the required libs by pip.
$ python3 -m venv .env
$ source .env/bin/activate
$ pip install -r requirements.txtWe'll take Visual Studio Code to walk you through CDK labs, install and configure it as the following steps.
The following instructions is fully new installation, if you had did it, then just skip it.
Recommand to download the Visual Studio code (vscode) from https://code.visualstudio.com/download.
Download anbd install the suitable distribution on your laptop.
Click the extentions pannel, and install the following extensions.
After the python extension is installed, when you open any .py file in vscode, will also ask you to install Linter pylint.
Please install for code assistence directly or manually install it:
$ source cdk-test/.env/bin/activate
$ cdk-test/.env/bin/python3 -m pip install -U pylintRun the test to see if any error is occured, if no, now you are ready to explore the AWS CDK python world.
- Check the unit test
$ pytest- generate cloudformation json file
cdk synthThe best way to have developing productivity is enable vscode trigger suggest, if the built-in shortcuts doesn't work for you, just open preferences panel by:
Code --> Preferences --> Keyboard Shortcuts
Then, search for : trigger and edit.
Finally, you could have the intelligence suggestion by hitting the shortcuts.








