Skip to content

Upgrade CDK v1 to v2#1

Open
Valamorde wants to merge 1 commit into
mainfrom
refactor/phase-1-cdk-v2
Open

Upgrade CDK v1 to v2#1
Valamorde wants to merge 1 commit into
mainfrom
refactor/phase-1-cdk-v2

Conversation

@Valamorde
Copy link
Copy Markdown
Owner

Summary

  • Replaces all @aws-cdk/* v1 packages with aws-cdk-lib v2 and constructs v10
  • Updates all imports across the CDK stack
  • Preserves the DynamoDB table CloudFormation logical ID via overrideLogicalId to prevent resource replacement on deploy

Notes

The DynamoDB table (abovevtt) holds live data. The logical ID override is required — without it, CDK v2 would generate a new physical resource and destroy the existing table. No Lambda code changes in this phase.

Test plan

  • cdk diff shows the DynamoDB table as unchanged (no replacement)
  • WebSocket connect/disconnect/sendmessage work end-to-end
  • HTTP /services endpoints return data

- Replace @aws-cdk/* v1 packages with aws-cdk-lib v2 + constructs v10
- Update all index.ts imports to aws-cdk-lib/* paths
- Construct moves from @aws-cdk/core to constructs package
- ConcreteDependable removed; replaced with addDependency(...args)
- Switch cdk.json app to npx ts-node (no pre-compile step required)
- Upgrade TypeScript 3.7 → 5.6, @types/node 10 → 20, add ts-node dep
- Fix tsconfig: target ES2020, noFallthroughCasesInSwitch (typo fixed)
- overrideLogicalId on DynamoDB table to prevent replacement on deploy
- Add config.json and index.js to .gitignore

Lambda runtimes unchanged (Node 12) — Phase 2 handles runtime upgrade.
cdk synth verified: table logical ID abovevttbackendapitableF5D5D98F,
DeletionPolicy: Retain, UpdateReplacePolicy: Retain.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant