← IaC Academy

Lua and tests · 18 / 23

Package a typed Lua source

Attach a Lua file to a real script resource with the schema’s role enum.

YOUR TASK

Make this happen

3 steps
  1. Set the role to SCRIPT.

  2. Attach scripts/pricing.lua with file().

  3. Keep the supplied typed pricing function.

Read the starter files

main.cococo

script "pricing" {
  name = "academy-pricing"
  role = "WRONG"
  content = file("scripts/pricing.lua")
}

scripts/pricing.lua

exports.quote = function(quantity: number, unitPrice: number): number
  return quantity * unitPrice
end