DEV Community

Discussion on: Getting started with CDK for Terraform

Collapse
 
khushil profile image
Khushil Dep

Oddly I get the following when running the cdktf command?

Adding cdktf~=0.1.0 to Pipfile's [packages]…
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pipenv/project.py", line 527, in write_toml
formatted_data = contoml.dumps(data).rstrip()
File "/usr/lib/python3/dist-packages/pipenv/patched/contoml/init.py", line 36, in dumps
raise RuntimeError("Can only dump a TOMLFile instance loaded by load() or loads()")
RuntimeError: Can only dump a TOMLFile instance loaded by load() or loads()

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/bin/pipenv", line 11, in
load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')()
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in call
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 697, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 535, in invoke
return callback(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 349, in install
core.do_install(
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 1979, in do_install
project.add_package_to_pipfile(package_name, dev)
File "/usr/lib/python3/dist-packages/pipenv/project.py", line 610, in add_package_to_pipfile
self.write_toml(p)
File "/usr/lib/python3/dist-packages/pipenv/project.py", line 530, in write_toml
for package in data[section]:
KeyError: 'dev-packages'
cdktf init [OPTIONS]

Create a new cdktf project from a template.

Options:
--version Show version number [boolean]
--disable-logging Dont write log files. Supported using the env CDKTF_DISABLE_LOGGING. [boolean] [default: true]
--disable-plugin-cache-env Dont set TF_PLUGIN_CACHE_DIR automatically. This is useful when the plugin cache is configured differently. Supported using the env CDKTF_DISABLE_PLUGIN_CACHE_ENV. [boolean] [default: false]
--log-level Which log level should be written. Only supported via setting the env CDKTF_LOG_LEVEL [string]
--template The template name to be used to create a new project. [string] [choices: "csharp", "java", "python", "python-pip", "typescript", "typescript-minimal"]
--project-name The name of the project. [string]
--project-description The description of the project. [string]
--dist Install dependencies from a "dist" directory (for development) [string]
--local Use local state storage for generated Terraform. [boolean] [default: false]
--cdktf-version The cdktf version to use while creating a new project. [string] [default: "0.1.0"]
-h, --help Show help [boolean]

{ Error: Command failed: pipenv install cdktf~=0.1.0
at checkExecSyncError (child_process.js:629:11)
at execSync (child_process.js:666:13)
at Object.exports.post.options as post
at executePostHook (/home/khushil/.npm-global/lib/node_modules/cdktf-cli/node_modules/sscaff/lib/sscaff.js:61:37)
at Object.sscaff (/home/khushil/.npm-global/lib/node_modules/cdktf-cli/node_modules/sscaff/lib/sscaff.js:28:15)
status: 1,
signal: null,
output: [ null, null, null ],
pid: 13295,
stdout: null,
stderr: null }