Instruqt Labs (beta)
  • Instruqt
  • Getting started
    • Setting up Version Control
    • Install Instruqt CLI
    • Creating your first lab
    • Configuration basics
    • Exploring the lab configuration
    • Adding your first chapter
    • Configuring sandboxes
    • Adding quizzes
    • Adding tasks and gating content
    • Finishing up
  • Documentation
    • Writing Lab Content
      • Project Structure
      • Markdown and Components
    • Integrations
      • Version Control
    • Lab reference
      • Content
        • Lab
        • Page
        • Activities
          • Task
          • Quiz
            • Multiple Choice
            • Single Choice
            • Text Answer
            • Numeric Answer
        • Layout
        • Tabs
          • Terminal
          • Service
          • Editor
          • External Website
          • Note
      • Sandbox
        • Containers
          • Container
          • Sidecar Container
        • Kubernetes
          • Cluster
          • Config
          • Helm
        • Nomad
          • Cluster
          • Job
        • Networking
          • Network
          • Ingress
        • Cloud Accounts
          • AWS
          • Azure
          • Google Cloud
        • Terraform
        • Template
        • Exec
        • Copy
        • Certificates
          • Root
          • Leaf
        • Random
          • Number
          • ID
          • UUID
          • Password
          • Creature
      • Functions
    • Tools
      • Instruqt CLI
    • Glossary
Powered by GitBook
On this page
  • Lab
  • Settings
  • TimeLimit
  • Idle
  • Controls
  • Layout
  • Tab
  • Instructions
  • Content
  • Chapter
  • Page
  • Examples
Edit on GitHub
Export as PDF
  1. Documentation
  2. Lab reference
  3. Content

Lab

Lab

The lab resource provides the metadata about the lab and some of its configuration. This is the equivalent of what is currently called a "track".


resource "lab" "name" {
 ...
}

Attributes

Attribute
Description

Title title required type: string

The title of the lab.

Description description required type: string

A description of the lab.

Tags tags type: []string

Tags that describe the lab.

Settings that configure the lab.

A layout that can be used within the lab. This block can be specified multiple times on a lab resource, to allow using multiple layouts throughout a lab.

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.

DefaultLayout default_layout type: string

The default layout is determined by the first layout that has the `default` field set to `true`. In the case that no layout has a default set, the first layout defined on the lab will be set as the default.


Settings

Settings that configure the lab.


resource "lab" "name" {
  settings {
    ...
  }
}

Attributes

Attribute
Description

Theme theme type: string default: modern_dark

The theme used to style the lab.

Configure the timelimit settings.

Configure the idle timeout settings.

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


TimeLimit

Configure the timelimit settings.


resource "lab" "name" {
  settings {
    timelimit {
      ...
    }
  }
}

Attributes

Attribute
Description

Duration duration type: int default: 15

The maximum duration of the lab in minutes.

Extend extend type: int default: 0

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

ShowTimer show_timer type: bool default: true

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Idle

Configure the idle timeout settings.


resource "lab" "name" {
  settings {
    idle {
      ...
    }
  }
}

Attributes

Attribute
Description

Enabled enabled type: bool default: true

Whether or not idle timeout is enabled.

Timeout timeout type: int default: 5

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

ShowWarning show_warning type: bool default: true

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Controls

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


resource "lab" "name" {
  settings {
    controls {
      ...
    }
  }
}

Attributes

Attribute
Description

ShowStop show_stop type: bool default: true

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

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Layout

A layout that can be used within the lab. Layouts define what panels and tabs are visible and how they are arranged.


resource "lab" "name" {
  layout "name" {
    ...
  }
}

Attributes

Attribute
Description

Name name required type: string

The name of the layout, that can be used by chapters and pages to switch to.

A reference to the layout that defines the panels.

Default default type: bool

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

The tabs that are used within the layout.

The instructional content that is displayed in the layout.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Tab

A tab that is used within the layout and points at a tab target e.g. Terminal, Service, Editor, etc.


resource "lab" "name" {
  layout "name" {
    tab "name" {
      ...
    }
  }
}

Attributes

Attribute
Description

Name name required type: string

The Name of the tab.

Panel panel required type: string

The name of the panel of the layout that the tab is displayed in.

The target resource of the tab that is shown when the tab is active.

Title title type: string

The title of the tab.

Active active type: bool

Whether or not the tab is active.

Visible visible type: bool

Whether or not the tab is visible.

Closeable closeable type: bool

Whether or not the tab is closeable.

Movable movable type: bool

Whether or not the tab is movable.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Instructions

The instructional content that is displayed in the layout.


resource "lab" "name" {
  layout "name" {
    instructions {
      ...
    }
  }
}

Attributes

Attribute
Description

Panel panel required type: string

The panel of the layout that the instructions are displayed in.

Title title type: string

The title of the instructions tab.

Active active type: bool

Whether or not the tab is active.

Visible visible type: bool

Whether or not the tab is visible.

Closeable closeable type: bool

Whether or not the tab is closeable.

Movable movable type: bool

Whether or not the tab is movable.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Content

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


resource "lab" "main" {
  content {
    ...
  }
}

Attributes

Attribute
Description

Title title type: string

The title of the content tab.

The chapters that are part of the content.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Chapter

A chapter within the content.


resource "lab" "name" {
  content {
    chapter "name" {
      ...
    }
  }
}

Attributes

Attribute
Description

Slug slug required type: string

The slug of the chapter.

Title title required type: string

The title of the chapter.

LayoutName layout_name type: string

The default layout for all pages in the chapter.

The pages that are part of the chapter.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.


Page

A page within a chapter that is part of the content.


resource "lab" "name" {
  content {
    chapter "name" {
      page "name" {
        ...
      }
    }
  }
}

Attributes

Attribute
Description

Slug slug required type: string

The slug of the page.

A reference to the resource of the page that contains the content.

Title title type: string

The title of the page. This overrides the title of the page source.

LayoutName layout_name type: string

The layout to use for the page. When switching to that page, the layout will then change to the selected layout.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Examples

Full Example

resource "lab" "minimal" {
  title = "Minimal"
  description = "This is a minimal example lab."

  settings {
    idle {
      enabled = false
    }
  }

  layout "minimal" {
    default = true
    reference = resource.layout.minimal

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

    instructions {
      panel = "instructions"
    }
  }

  layout "instructions_only" {
    reference = resource.layout.minimal

    instructions {
      panel = "instructions"
    }
  }

  content {
    chapter "introduction" {
      title = "Introduction"
      layout_name = "minimal"
      
      page "first" {
        layout_name = "instructions_only"
        reference = resource.page.first
      }

      page "second" {
        reference = resource.page.second
      }
    }

    chapter "imported" {
      title = "Imported"

      page "first" {
        reference = module.chapter.output.pages.first
      }

      page "second" {
        reference = module.chapter.output.pages.second
      }
    }
  }
}
PreviousContentNextPage

Last updated 1 month ago

Settings settings type: block

Layouts layout type: []block

Content content type: block

TimeLimit timelimit type: block

Idle idle type: block

Controls controls type: block

Reference reference required type: Reference to

Tabs tab type: []block

Instructions instructions type: block

Target target required type: Reference to , , , ,

Chapters chapter type: []block

Pages page type: []block

Reference reference required type: Reference to

title = "My Lab"
description = <<-EOF
The description of my lab.
EOF
description = file("instructions/description.md")
tags = ["something", "else"]
settings {
  timeout {
    ...
  }

  idle {
    ...
  }

  controls {
    ...
  }
}
layout "single_panel" {
  reference = resource.layout.single
}
content {
  chapter "first_chapter" {
    ...
  }
}
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container
// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu
default_layout = "single_panel"
theme = "original"
timelimit {
  duration = 30
}
idle {
  enabled = false
}
controls {
  show_stop = true
}
duration = 15
extend = 5
show_timer = true
enabled = true
timeout = 5
show_warning = true
show_stop = true
reference = resource.layout.two_panels
default = true
tab "terminal" {
  panel = "left_panel"
  target = resource.terminal.ubuntu
}
instructions {
  panel = "right_panel"
}
tab "name" {
  ...
}
panel = "left_panel"
target = resource.terminal.ubuntu
title = "Ubuntu"
active = true
visible = true
closeable = true
movable = true
panel = "left_panel"
title = "Assignment"
active = true
visible = true
closeable = true
movable = true
title = "Instructions"
chapter "first_chapter" {
  page "first_page" {
    reference = resource.page.first
  }
}
chapter "slug" {
  ...
}
title = "Introduction"
layout_name = "single_panel"
page "getting_started" {
  reference = resource.page.getting_started
}
page "slug" {
  ...
}
reference = resource.page.getting_started
title = "Getting Started"
layout_name = "single_panel"
Layout
Terminal
Service
Editor
ExternalWebsite
Note
Page
Settings
Layout
Content
TimeLimit
Idle
Controls
Tab
Instructions
Chapter
Page