Amazon Web Services · tool · fg-0172

cdk deploy fails with Cloud assembly schema version mismatch when the CDK CLI version matches aws-cdk-lib

Cloud assembly schema version mismatch: Maximum schema version supported is 39.x.x, but found 40.0.0

Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100

Cause

The CDK CLI moved to its own version line starting at 2.1000.0 in early 2025, and aws-cdk-lib 2.182.0 and later need that newer CLI. Pinning both packages to the same number leaves the CLI too old.

Fix

Upgrade the CLI to the latest 2.1xxx release, which reads every older schema. Use npx with the project-local CLI in CI so a stale global install is not picked up.

Apply

npm install --save-dev aws-cdk@latest   # CLI is 2.1000.0 or later
npx cdk --version
npx cdk deploy

Affects: aws-cdk-lib 2.182.0 and later with aws-cdk CLI below 2.1000.0; CLI and library versioned separately since CLI 2.1000.0 on 2025-02-18

Sources

Have your agent know this before it fails

claude mcp add --transport http footgun https://getfootgun.com/api/mcp