How to build a CDK application without executing CLI?

Is there a way to trigger CDK builds from within another application?

For example I have a .NET hosted service and I want to generate TF templates with the .NET service, but without having to execute a CLI command.

Is this possible and if so, what’s the class/command for doing so?

Hi @rcollette,

currently there is no way to do that. Here’s an issue tracking this feature request: API to interact with terraform cli · Issue #237 · hashicorp/terraform-cdk · GitHub

However, when invoking app.synth() in your C# code, that invocation will output a TF Template to the output directory. So you could theoretically read from that directory afterwards and work with that.