Sabo Boz
Sabo Boz

Reputation: 2575

how to deploy terraform directly from an existing typescript project

I wish to deploy infrastructure that is commonly based on terraform directly using typescript/node.js code. I know there is a cdk for terraform (which you can use in typescript) - however, the documentation only seems to give instructions for doing this in a completely new project. However, I already have an existing project and thus I cannot just run the init command. Does anyone know what requirements there are to use cdktf in an existing typescript file, beyond just running yarn add cdktf? e.g. how would I generate the right cdktf.json file?

Upvotes: 0

Views: 737

Answers (1)

Daniel Schmidt
Daniel Schmidt

Reputation: 11921

You can not use CDKTF to programmatically run a deployment (e.g. calling a method to run TF apply from node) yet. You can also not run plain terraform code from CDKTF yet, but you can use modules. You can also move your TF code over to CDKTF by running cdktf init --from-terraform-project which uses convert to translate your code.

Upvotes: 1

Related Questions