CDK concepts
We have initiated our CDK app, but before we go further, there are a few key CDK concepts that you should understand first. Let’s delve into them one by one.
A CDK app
An AWS CDK app is an application written in a programming language, the most popular being TypeScript (see the language flag when we ran cdk init
), which uses the standard CDK library alongside custom-written components to define an AWS-powered infrastructure.
Open up bin/infrastructure.ts
. You will see the following line of code:
const app = new cdk.App();
The app constantly acts as the root of our CDK application. The reference to the app will be passed down to all our CDK stacks:
new InfrastructureStack(app, 'InfrastructureStack', {})
CDK stacks
Stacks act as high-level containers for constructs, then are used to define AWS services such as ECS, DynamoDB, and others. Looking at our starter repository so far, we will define only one stack – WebStack
. It&...