Creating and initializing a new AWS CDK app

2.1. Create a directory for your app with an empty Git repository.

cd ~/environment/
mkdir cdk-msg-app-backend
cd cdk-msg-app-backend

2.2. To initialize your new AWS CDK app use the cdk init command as follows.

cdk init --language typescript

CDK init

2.3. Bootstrapping your AWS environment:

cdk bootstrap

2.4. Explore your project directory, you will have the following files:

  • lib/cdk-msg-app-backend-stack.ts is where your CDK application’s main stack is defined. This is the file we’ll working on.

  • bin/cdk-msg-app-backend.ts is the entrypoint of the CDK application. It will load the stack defined in lib/cdk-msg-app-backend-stack.ts.

CDK Files