Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: provider generation fails on versions newer than 0.20.1 #3803

Open
1 task
glacion opened this issue Jan 17, 2025 · 0 comments
Open
1 task

CLI: provider generation fails on versions newer than 0.20.1 #3803

glacion opened this issue Jan 17, 2025 · 0 comments
Labels
bug Something isn't working new Un-triaged issue

Comments

@glacion
Copy link

glacion commented Jan 17, 2025

Expected Behavior

cdktf provider add grafana/grafana completes successfully with the following log:

[2025-01-17T13:33:51.101] [INFO] default - Checking whether pre-built provider exists for the following constraints:
  provider: grafana/grafana
  version : latest
  language: typescript
  cdktf   : 0.20.11

[2025-01-17T13:33:51.466] [INFO] default - Pre-built provider does not exist for the given constraints.
[2025-01-17T13:33:51.467] [INFO] default - Adding local provider registry.terraform.io/grafana/grafana with version constraint undefined to cdktf.json
Local providers have been updated. Running cdktf get to update...
Generated typescript constructs in the output directory: src/gen

Actual Behavior

On cdktf-cli versions higher than 0.20.1 this command fails with the following:

[2025-01-17T13:35:11.795] [INFO] default - Checking whether pre-built provider exists for the following constraints:
  provider: grafana/grafana
  version : latest
  language: typescript
  cdktf   : 0.20.11

[2025-01-17T13:35:12.171] [INFO] default - Pre-built provider does not exist for the given constraints.
[2025-01-17T13:35:12.171] [INFO] default - Adding local provider registry.terraform.io/grafana/grafana with version constraint undefined to cdktf.json
Local providers have been updated. Running cdktf get to update...
⠋ starting...
[2025-01-17T13:35:12.833] [INFO] default - The CDKTF version has changed, generating all cons
Error: Could not find provider with constraint {"constraint":{"name":"grafana","fqn":"grafana","version":"~> 3.16","source":"grafana/grafana","namespace":"grafana"},"targetLanguage":"typescript","fileName":"providers/grafana/index.ts"}
    at HT.generate (/Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:111:13762)
    at Ane.generateTypescriptProvider (/Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:114:84132)
    at Ane.generateTypescript (/Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:114:86199)
    at /Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:117:618
    at Array.map (<anonymous>)
    at Ane.generate (/Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:117:606)
    at async YUe (/Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:197:3611)
    at async /Users/glacion/Source/infrastructure/node_modules/cdktf-cli/bundle/bin/cmds/handlers.js:519:16936
⠙ downloading and generating modules and providers...
Error: Could not find provider with constraint {"constraint":{"name":"grafana","fqn":"grafana","version":"~> 3.16","source":"grafana/grafana","namespace":"grafana"},"targetLanguage":"typescript","fileName":"providers/grafana/index.ts"}
error: "cdktf" exited with code 1

Steps to Reproduce

  1. Create a typescript cdktf project.
  2. Install cdktf-cli with version 0.20.1 or lower.
  3. Run cdktf provider add grafana/grafana.
  4. Reset
  5. Create a typescript cdktf project.
  6. Install cdktf-cli with version 0.20.2 or higher.
  7. Run cdktf provider add grafana/grafana.

Versions

language: typescript
cdktf-cli: 0.20.11
node: v20.18.1
cdktf: 0.20.11
constructs: 10.4.2
jsii: null
terraform: 1.8.4
arch: arm64
os: darwin 24.2.0

Providers

┌───────────────────────┬──────────────────┬─────────┬────────────┬──────────────────────────────┬─────────────────┐
│ Provider Name │ Provider Version │ CDKTF │ Constraint │ Package Name │ Package Version │
├───────────────────────┼──────────────────┼─────────┼────────────┼──────────────────────────────┼─────────────────┤
│ grafana/grafana │ │ │ ~> 3.16 │ │ │
├───────────────────────┼──────────────────┼─────────┼────────────┼──────────────────────────────┼─────────────────┤

Gist

No response

Possible Solutions

No response

Workarounds

Pin cdktf-cli version to 0.20.2

Anything Else?

No response

References

No response

Help Wanted

  • I'm interested in contributing a fix myself

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@glacion glacion added bug Something isn't working new Un-triaged issue labels Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working new Un-triaged issue
Projects
None yet
Development

No branches or pull requests

1 participant