Examining the CDK code
As you’ve already guessed, the CDK code resides within the /infrastructure
directory, with the CDK entry point being the /
infrastructure/bin/chapter-3.ts
file:
#!/usr/bin/env node import 'source-map-support/register'; import * as cdk from 'aws-cdk-lib'; import { Chapter3Stack } from '../lib/chapter-3-stack'; const app = new cdk.App(); new Chapter3Stack(app, 'Chapter3Stack', {});
Nothing fancy is going on here. We are just telling it to load up the root stack of the CDK app, which is Chapter3Stack
. Open /infrastructure/lib/chapter-3-stack.ts
in your code editor:
export class Chapter3Stack extends Stack { public readonly dynamodb: Dynamodb; public readonly s3: S3; public readonly ecs: ECS; constructor(scope: Construct, id: string, props?: StackProps) { super(scope, id, props); this.dynamodb = new Dynamodb(this,...