Terraform module
modules/neolite-vm/variables.tf:
modules/neolite-vm/main.tf:
modules/neolite-vm/outputs.tf:
var.console_password here is exactly what the quickstart and project structure tutorials already declared in full. product_id is picked by name per environment, the same pattern used in Environments - never pass a module products[0] directly, since a module has no way to warn its caller that the value is arbitrary:
"MS 4.2" against your own account’s catalog output first - see Step 1 in the catalog overview. A local ./modules/... source is enough for one repository. Publishing to a module registry is possible but only worth it once more than one repository needs the same module.
Pulumi component
The equivalent in Pulumi is aComponentResource, shown here in TypeScript:
{ parent: this } registers the keypair and VM as children of the component in Pulumi’s resource tree, so pulumi up and the Pulumi Cloud console show them nested under it instead of as two unrelated top-level resources.
Instantiate one per stack. config is exactly what the Pulumi quickstart already declared in full. productId is picked by name, the same pattern used in Environments - never pass a component products[0] directly:
Next steps
- Testing, validation, and guardrails - catch mistakes before this module ever calls the real API