← IaC Academy

Reusable projects · 23 / 23

Assemble a reusable team project

Combine defaults, module inputs, confined files, typed outputs and user references in one working stack.

YOUR TASK

Make this happen

3 steps
  1. Set team_name to Fulfillment.

  2. Use the module’s own purpose.txt file for its description.

  3. Connect Alice through module.dispatch.id; check, inspect and simulate.

Read the starter files

main.cococo

variable "team_name" { default = "TODO" }
module "dispatch" {
  source = "./modules/team"
  inputs = { name = var.team_name }
}

team_membership "alice" {
  teamId = module.dispatch.id
  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 = file("purpose.txt")
}
output "id" {
  type = "identity<team>"
  value = team.this.id
}

people.cococo

user "alice" {
  email = "alice@example.com"
}

modules/team/purpose.txt

TODO