Using higher level programming languages with tf modules

Is it possible to use existing terraform modules with higher level programming languages running the CDK?

As an example we have our own internal re-usable modules, but have a particular project that is running on an automated schedule. The schedule is managed by a C# app. We do not want to have to re-write all the modules to use them in this app and am hoping there is a way to use the CDK to read existing *.tf & *.tfvar files.

Hi @alexwhiteoval :wave:

You can use existing Terraform modules written in HCL in CDK for Terraform projects. You don’t have to rewrite them :+1:

But as you mentioned a C# app running on a schedule: While a CDKTF project is written in C#, invoking it (i.e. applying changes to infrastructure) requires the CDKTF CLI and currently there is no API to programmatically plan/apply changes. Here’s the open issue tracking this: API to interact with terraform cli · Issue #237 · hashicorp/terraform-cdk · GitHub

Thanks, we will have to continue with a CLI facade for now.