Create a Component and Bundle β
Learn how to scaffold a Component from an existing Terraform/OpenTofu module and use it inside a Bundle.
Prerequisites β
- A Terraform/OpenTofu module directory with variables
Steps β
- Create a Component from a module
sh
cd path/to/module
terramate component create- Review generated component metadata and inputs.
- Define a Bundle that uses the Component
Create a new bundle definition directory and add a stack with a component instance:
hcl
define bundle stack "example" {
metadata {
path = "stacks/example"
name = "Example Stack"
}
component "example" {
source = "/components/path/to/created-component"
inputs = {} # wire bundle inputs as needed
}
}- Scaffold and generate
sh
terramate scaffold
terramate generateNext steps β
- Howβto: Convert a module to a Component
- Reference: Bundle Definition