terraform-cdk: `cdktf get` keeps on `downloading and generating`, but never finishes

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

cdktf & Language Versions

Terraform v1.0.11 on darwin_arm64 cdktf: 0.8.1

Affected Resource(s)

cdktf

Debug Output

GIST

Expected Behavior

Finish eventually

Actual Behavior

It keeps on running, never finishing the download (and it never populates the generated folder)

Steps to Reproduce

brew install terraform cdktf
mkdir folder
cd folder
cdktf init --template="go" --local

Add the aws provider to cdktf.json:

"terraformProviders": [
    "hashicorp/aws@~> 3.68.0"
],
cdktf get

Important Factoids

Trying to follow this tutorial

As simple as it gets

References

https://github.com/hashicorp/terraform-provider-aws/issues/22075

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 11
  • Comments: 19 (7 by maintainers)

Most upvoted comments

Closing this as there have been different performance improvements to the code generation since, most recently through an upstream fix in JSII by @DanielMSchmidt.

https://github.com/hashicorp/terraform-cdk/issues/1886 contains a bit more context on this whole topic as well.

But as usual, if anything still feels off, don’t hesitate to file a new issue and we’ll look into it!

My workaround has been to use this pre-built package. Add it to the dependencies in the Pipfile:

[packages]
cdktf-cdktf-provider-aws = "4.0.2"

This will also install matching cdktf and constructs packages, with the command pipenv install.

Then in the main.py script, just do a usual import as such:

from cdktf_cdktf_provider_aws import AwsProvider, ec2

Then no need to do cdktf get, just jump to cdktf plan or deploy.

Using pre-built packages is probably more pythonic anyways.