Getting Started with the AWS CDK¶
This topic describes how to download, install, and configure the AWS CDK.
Installing the AWS CDK¶
This section describes how to install the AWS CDK, and lists the prerequsites for each supported language.
You must install Node.js (>= 8.11.x) to use the command-line toolkit and language bindings.
If you use Java, you must set the JAVA_HOME environment variable to the path to where you have installed the JDK on your machine to build an AWS CDK app in Java.
Specify your credentials and region with the AWS CLI. You must specify both your credentials and a region to use the toolkit. See credentials for information on using the AWS CLI to specify your credentials.
Configuring the AWS CDK¶
You must specify your default credentials and region to use the toolkit.
Use the AWS Command Line Interface
aws configure command to specify your default credentials and region.
You can also set environment variables for your default credentials and region. Environment variables take precedence over settings in the credentials or config file.
- AWS_ACCESS_KEY_ID specifies your access key
- AWS_SECRET_ACCESS_KEY specifies your secret access key
- AWS_DEFAULT_REGION specifies your default region
See Environment Variables in the CLI User Guide for details.
The China regions (cn-north-1 and cn-northwest-1) do not support version reporting.
See version_reporting for more details and how to opt-out
The AWS CDK toolkit needs to know how to execute your AWS CDK app. It requires that the
--app command-line option points to an executable program that adheres
to the toolkit’s protocol.
Although you can include an
--app option every time you use the toolkit,
we recommend that you instead create a
cdk.json file at the root of
your project directory with the following content: