简体   繁体   中英

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 ? eg how would I generate the right cdktf.json file?

You can not use CDKTF to programmatically run a deployment (eg 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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM