Instead of referring terraform module in cdktf i want to refer CDKTF typescript files to combine several resources as one. How can i achieve this?
Below is for terraform module but expecting something like this for cdktf
"terraformModules": [
{
"name": "my-local-module",
"source": "./New folder"
}
],
You can use
import {myExport} from "./path-to-ts-file";andexport myExport = ...in the file you are exporting from. You can see an example for this in the serverless typescript demo: https://github.com/hashicorp/cdktf-integration-serverless-example/blob/main/main.ts#L5 & https://github.com/hashicorp/cdktf-integration-serverless-example/blob/main/posts/index.ts#L13