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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

HCL to CDKTF Tool #232

Closed
skorfmann opened this issue Jul 22, 2020 · 3 comments
Closed

HCL to CDKTF Tool #232

skorfmann opened this issue Jul 22, 2020 · 3 comments

Comments

@skorfmann
Copy link
Collaborator

@skorfmann skorfmann commented Jul 22, 2020

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

It'd be pretty cool to have a hcl2cdktf tool. It would take HCL and transform it to cdktf Typescript Constructs. This would enable:

  • Converting an existing HCL based project to Typescript
  • Transform modules (see #231)
  • Generate documentation examples

References

#231

@jsteinich
Copy link
Collaborator

@jsteinich jsteinich commented Aug 2, 2020

Using https://github.com/tmccombs/hcl2json packaged with https://github.com/sanathkr/go-npm might provide an easier path for parsing HCL

@skorfmann
Copy link
Collaborator Author

@skorfmann skorfmann commented Aug 3, 2020

Using https://github.com/tmccombs/hcl2json packaged with https://github.com/sanathkr/go-npm might provide an easier path for parsing HCL

There's some early work going on here

@DanielMSchmidt
Copy link
Collaborator

@DanielMSchmidt DanielMSchmidt commented Jun 24, 2021

I think sub-steps here could be:

  • Generating TS code via cat main.tf | cdktf tf2cdk > main.ts
  • Use Rosetta internally to allow --language=<java,go,python,c#>
  • Create vscode "Paste as CDK" command
  • Create function that creates a resource class from folder / module
  • Create cdktf import <project-path> command

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

4 participants