Reusable projects · 22 / 23
Wire a module into its caller
Use the typed module output to connect Alice to the team without exposing its internals.
YOUR TASK
Make this happen
Use
module.dispatch.idfor the membership teamId.Keep the existing user lookup and user.alice.id reference.
Inspect the cross-module dependency and simulate.
Read the starter files
main.cococo
module "dispatch" {
source = "./modules/team"
inputs = { name = "Fulfillment" }
}
team_membership "alice" {
teamId = module.dispatch.missing
userId = user.alice.id
}
modules/team/cococo.module.toml
format = 1
modules/team/main.cococo
input "name" { type = "string" }
team "this" {
name = input.name
description = "Ships customer orders"
}
output "id" {
type = "identity<team>"
value = team.this.id
}
people.cococo
user "alice" {
email = "alice@example.com"
}