Skip to content

Specify module versions in cdktf.json #425

@redeux

Description

@redeux

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

Description

cdktf.json currently pulls down the latest version of a module when one is specified in the config. However, there are reasons a user would want to specify a version that isn't latest.

For example, the typhoon modules' version correspond to the version of Kubernetes that it will install.

How it currently works:

{
  "language": "typescript",
  "app": "npm run --silent compile && node main.js",
  "terraformProviders": [
    "google@~> 3.47.0",
    "poseidon/ct@~> 0.6.1",
    "tls@~> 2.0.0"
  ],
  "terraformModules": [
    "poseidon/kubernetes/google"
  ],
  "context": {
    "excludeStackIdFromLogicalIds": "true",
"allowSepCharsInLogicalIds": "true"
  }
}

How I would expect it to work:

{
  "language": "typescript",
  "app": "npm run --silent compile && node main.js",
  "terraformProviders": [
    "google@~> 3.47.0",
    "poseidon/ct@~> 0.6.1",
    "tls@~> 2.0.0"
  ],
  "terraformModules": [
    "poseidon/kubernetes/google@ 1.18.8"
  ],
  "context": {
    "excludeStackIdFromLogicalIds": "true",
"allowSepCharsInLogicalIds": "true"
  }
}

But that currently results in:

➜  cdktf get
⠧ downloading and generating modules...
Error: Not Found
    at ClientRequest.<anonymous> (/usr/local/lib/node_modules/cdktf-cli/lib/get/registry-client.js:28:27)
    at Object.onceWrapper (events.js:422:26)
    at ClientRequest.emit (events.js:315:20)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:634:27)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:117:17)
    at TLSSocket.socketOnData (_http_client.js:503:22)
    at TLSSocket.emit (events.js:315:20)
    at addChunk (_stream_readable.js:302:12)
    at readableAddChunk (_stream_readable.js:278:9)
    at TLSSocket.Readable.push (_stream_readable.js:217:10)
Not Found

References

Typhoon Google Cloud v1.18.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions