TerraformHclModule class. This enables you to leverage the vast ecosystem of community-maintained modules while still writing your infrastructure in TypeScript.
Using a Module
To use a module, you provide its source, version, and any required variables.Managing Variables and Providers
You can set variables after initialization using theset method:
Accessing Outputs
Modules often expose outputs that you need to use in other parts of your configuration.TerraformHclModule provides typed methods to access these outputs.
get(outputName): Returns a generic token.getString(outputName): Returns a string token.getNumber(outputName): Returns a number token.getBoolean(outputName): Returns a boolean token.getList(outputName): Returns a list token.
Example: VPC and EC2
TerraformHclModule is the fastest way to integrate complex, pre-built infrastructure components into your tfts project.