Upgrade CDK v1 to v2#1
Open
Valamorde wants to merge 1 commit into
Open
Conversation
- 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
@aws-cdk/*v1 packages withaws-cdk-libv2 andconstructsv10overrideLogicalIdto prevent resource replacement on deployNotes
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 diffshows the DynamoDB table as unchanged (no replacement)/servicesendpoints return data