Lab

The lab resource provides the metadata about the lab and some of its configuration. This is the reusable part of what is currently called a “track” today.

Properties

FieldTypeDescription

title

string

The title of the lab.

description

string

A description of the lab.

tags

[]string

Tags that describe the lab.

settings

block: Settings

Settings that configure the lab.

layout

block: Layout

The layouts that can be used within the lab. This block can be specified multiple times on a lab resource.

content

block: Content

The instructional content of the lab that is presented to the end-user.

Settings

Settings that configure the lab.

FieldTypeDescription

timelimit

block: Timelimit Settings

Configure the timelimit settings.

idle

block: Idle Settings

Configure the idle timeout settings.

controls

block: Controls Settings

Configure the controls that are presented to the end-user.

Timelimit Settings

Configure the timelimit settings.

FieldTypeDescription

duration

number

The maximum duration of the lab in minutes.

extend

number

How long the lab can be extended in minutes once the timelimit is hit. Set to 0 to disable extending.

show_timer

boolean

Whether or not to show the timelimit timer to the end-user.

Idle Settings

Configure the idle timeout settings.

FieldTypeDescription

timeout

number

The inactivity duration in minutes after which an end user will be timed out.

show_warning

boolean

Whether or not to show an idle timeout warning to the end user.

Controls Settings

Configure the controls that are presented to the end-user.

FieldTypeDescription

show_stop

boolean

Whether or not to show the stop lab button to the end-user.

Layout

The layouts that can be used within the lab.

FieldTypeDescription

default

boolean

Whether or not the layout of the default one to use when the lab does not have any instructional content.

source

ref: Layout

Content

The instructional content of the lab that is presented to the end-user.

FieldTypeDescription

Examples

Minimal Example

Full Example

resource "lab" "example" {
  title = "Example Lab"
  description = "This is an example lab."
  tags = ["example", "lab"] 
  
  settings {
    theme = "modern_dark"

    timelimit {
      duration = 60
      extend = 10
      show_timer = true
    }

    idle {
      timeout = 5
      show_warning = true
    }

    controls {
      show_stop = true
    }
  }

  layout "minimal" {
     default = true

    source = resource.layouts.minimal

    instructions {
      panel = "instructions"
    }
  }

  layout "original" {
    source = module.layouts.output.original

    tab "shell" {
      panel = "sandbox"
      target = resource.terminal.shell
    }

    tab "addendum" {
      panel = "sandbox"
      target = resource.note.addendum
    }
    
    tab "docs" {
      panel = "sandbox"
      target = resource.external_website.docs
    }

    tab "editor" {
      panel = "sandbox"
      target = resource.editor.code
    }

    instructions {
      panel = "instructions"
    }
  }

  content {
    chapter "introduction" {
      title = "Introduction"
      source = resource.chapter.introduction
      layout = "minimal"
    }

    chapter "installation" {
      title = "Installation"
      source = resource.chapter.installation
      layout = "original"
    }

    chapter "workflow" {
      title = "Workflow"
      source = resource.chapter.workflow
      layout = "original"
    }

    chapter "providers" {
      title = "Providers"
      source = resource.chapter.providers
      layout = "original"
    }

    chapter "state" {
      title = "State"
      source = resource.chapter.state
      layout = "original"
    }

    chapter "summary" {
      title = "Summary"
      source = resource.chapter.summary
      layout = "minimal"
    }
  }
}

Last updated