Secrets and variables

It is sometimes the case that tracks needs to be configured differently depending on a particular audience or implementation. To facilitate this, you can add Runtime Parameters when starting tracks.

Runtime parameters are key/value pairs that are injected as environment variables into lifecycle scripts for containers and virtual machines. The values for runtime parameters can be hard coded values, or sensitive values fetched from our secrets feature.

Currently, runtime parameters can only be configured on track invites. In a future release, we will add runtime parameters to other track start mechanisms, such as the instruqt track test command, embeds and hot start.

Runtime parameters are only injected during lifecycle script executions and are by default not stored in / accessible via containers or virtual machines.

Runtime parameters specified when starting a track via the API will override the values configured on an invite if there are duplicate keys. * If you are making use of hot start pools to prestart tracks runtime parameters not be available in the sandbox setup script. Tracks that need to be hot started and make use of runtime parameters should do setup in the first challenges setup script.

How to configure runtime parameters

Add runtime parameters to a track invite via the UI

  1. Start by creating an invite or having an existing invite ready to edit, instruction on how to create an invite can be found in the track invites guide.

  2. If you would like to make use of secrets to inject sensitive credentials into your track ensure you have a secret available by following the secrets guide.

  3. Once you have an invite and secret to work with navigate to the edit page of the invite you would like to configure.

  4. Below the Add content section, click +Runtime parameters. ↳ Instruqt shows the Runtime Parameters section.

  5. Click the Add secret or Add variable buttons to add a secret or variable parameters

    • For both options you can define the Key of the parameter, which will be the name of the environment variable in the scripts

    • For Secrets you can select the secret that will be used

    • For Variables you can enter any value

  6. To add another parameter, repeat step 5 above.

  7. Save your invite by clicking the save changes button at the bottom of the page

  8. You are now able to make use of the environment variables defined on the invite in you tracks lifecycle scripts. For more information of lifecycle scripts have a look at the guide.

Last updated