Module 1: Understand CDK Requirements
TUTORIAL
Understand CDK Requirements
In this module, you will learn about prerequisites for running CDK
What you will accomplish
- Set up the AWS CLI
- Choose and install an IDE
- Ensure that you have the correct language framework ready
Implementation
To use CDK, you need to have a few prerequisites installed and configured. We will not be diving into the details of these in this tutorial, but reference existing tutorials or documentation on how to accomplish the tasks.
Time to complete
5 minutes
Module prereqs
- AWS account with administrator-level access**
- Recommended browser: The latest version of Chrome or Firefox
[**]Accounts created within the past 24 hours might not yet have access to the services required for this tutorial.
Install and configure AWS CLI
For AWS CDK to interact with your AWS Account, it needs credentials and the AWS CLI installed and configured. If you haven't done so, please follow the Setting Up Your AWS Environment guide to set up the CLI on your workstation. When you're setting up your AWS CLI, remember to use an AWS account with administrator-level access.
If you will be using AWS CDK on AWS Cloud9, the CLI should already be installed and configured.
Choose and install an IDE
One of the benefits of AWS CDK is that you can use your favorite development environment and have a rich experience when exploring the hundreds of different services and features of AWS. We highly recommend you use an IDE that supports code-completion and syntax highlighting for your language of choice:
- Visual Studio Code (VSCode)
- AWS Cloud9
- Atom
- vim
- emacs
- WebStorm
- PyCharm
Check your language framework
The AWS CDK has first-class support for TypeScript, JavaScript, Python, Java, C#, and Go. Other JVM and .NET CLR languages may also be used, at least in theory, but we are unable to offer support for them at this time.
All AWS CDK developers, even those working in Python, Java, or C#, need Node.js 10.13.0 or later. All supported languages use the same backend, which runs on Node.js.
TypeScript
To work with the AWS CDK, you must have an AWS account and credentials and have installed Node.js and the AWS CDK Toolkit. You also need TypeScript itself (version 3.8 or later).
If you don't already have it, you can install it using npm:
npm install -g typescript
If you get a permission error, and have administrator access on your system, you can try:
sudo npm install -g typescript
For full information, see Working with the AWS CDK in TypeScript.
JavaScript
To work with the AWS CDK, you must have an AWS account and credentials and have installed Node.js and the AWS CDK Toolkit. JavaScript AWS CDK applications require no additional prerequisites beyond these. For full information, see Working with the AWS CDK in JavaScript.
Python
If you decide to use Python as your CDK language of choice, you will need to have Python installed. Specifically you will need Python 3.6 or later installed. You can find information on installing Python here.
Additionally you will need to have the Python Package Manager (pip) and virtualenv installed. See the installation instructions here. For full information, see Working with the AWS CDK in Python.
Java
If Java is your language of choice, you will need to have the following installed:
- JDK (Java Development Kit) 8 (Java 1.8) or later
- Apache Maven 3.5 or later
You can find information about downloading and installing the Amazon Coretto 8 distribution here. Other JDK 8 distributions are available if you do not wish to use Amazon Coretto. For full information, see Working with the AWS CDK in Java.
C#
If C# is your language of choice, you need .NET Core 3.1 or later. Visual Studio 2019 (any edition) or Visual Studio Code is recommended. For full information, see Working with the AWS CDK in C#.
Conclusion
You are now ready to get started with the AWS CDK. It is recommended to use AWS Cloud9 for this tutorial as all the prerequisites have been installed.