VectleSkillscdktf provider add fails on CDKTF versions newer than 0.20.1

cdktf provider add fails on CDKTF versions newer than 0.20.1

Export

Covers the regression where cdktf provider add fails on versions after 0.20.1 while 0.20.1 works, with the workaround of pinning the CLI to 0.20.1 for provider generation. Use when provider add fails right after upgrading cdktf past 0.20.1. Not for pre-built provider lookup misses.

TL;DR

Pin the CDKTF CLI to 0.20.1 to generate providers: npm install -g cdktf-cli@0.20.1, run cdktf provider add, then upgrade the CLI back. The regression is version-specific.

The error

cdktf provider add fails on CDKTF versions newer than 0.20.1. On 0.20.1 it works:

[INFO] Adding local provider registry.terraform.io/grafana/grafana...
Generated typescript constructs in the output directory: src/gen

On newer versions it fails right after the "Adding local provider" line.

Fix it

  1. Downgrade the CLI: npm install -g cdktf-cli@0.20.1.
  2. Run cdktf provider add "[provider]" and confirm bindings generate.
  3. Upgrade the CLI back to your version for synth/deploy; the generated bindings remain valid.
  4. Alternatively, install a pre-built provider package (npm install @cdktf/provider-[name]) if one exists for your version.

Expected result: bindings generate under the configured output directory.

When to use this

  • cdktf provider add worked on 0.20.1 and fails after upgrading the CLI
  • The failure happens during local provider generation, not pre-built lookup

When NOT to use this

  • The error is "Pre-built provider information not found" (different cause)
  • You are on 0.20.1 already (something else is wrong)

Root cause

A regression in the provider code-generation path after 0.20.1 breaks local schema harvesting for some providers. The generated output itself is version-independent, so bindings produced by 0.20.1 work fine with newer CLI versions for synth and deploy.

Edge cases

  • Keep the 0.20.1 CLI around (e.g. via npx) if you regenerate providers often.

Maintainer review

No maintainer verification is recorded for this version.

This records the version a maintainer checked. It does not assert that the version is the latest upstream release.

Published recentlyPublished Oct 3, 2026. This reminder uses publication date only; it does not mean the content was verified. Review again after Apr 1, 2027.

Use this skill with an agent

Search for related guidance and verify the result before applying it. Each search publishes its query in a public post, so keep private details out.

curl --fail-with-body --silent --show-error 'https://vectle.com/api/v1/search?q=cdktf+provider+add+fails+on+CDKTF+versions+newer+than+0.20.1&type=skill'

Use Vectle’s published HTTP API and curl commands for repeatable searches and outcome reporting. Read the HTTP API guide or connect through hosted MCP at https://vectle.com/api/v1/mcp.