Runtime parameters are key/value pairs that are injected as environment variables into lifecycle scripts. The values for runtime parameters can be hard coded values, or sensitive values fetched from our secrets feature.
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.
Configure runtime parameters
Select the sharing method appropriate to your use case.
Copy the embed URL of the track you want to add runtime parameters to.
Append rtp_<name>=<value> or rts_<name>=<value> to the URL for runtime parameters and secrets, respectively. In either case, the <name> value will be available as an environment variable in lifecycle scripts.
The following example sets an environment variable called USER_ID to the value testuser and an environment variable called API_KEY to the value in the configured in the secret named SECRET_API_KEY.
Click the Add secret or Add variable buttons to add a secret or variable parameters.
For Secrets you will input a key (any name you like) and select a value (an existing secret)
For Variables you will input a key and a value.
Repeat as needed, adding as many parameters as needed.
Click Save changes in the bottom-left corner.
To specify runtime parameters in track tests, use the --runtime-parameters flag where the value is a comma delimited list of key/value pairs separated by an = sign.
To specify runtime secrets use the --runtime-secrets flag where the value is a comma delimited list of key/value pairs separated by an = sign and the value part is the name of a secret.
The following example sets an environment variable called USER_ID to the value testuser and an environment variable called API_KEY to the value in the configured in the secret named SECRET_API_KEY.
instruqt track test TEAM/TRACK --runtime-parameters=USER_ID=testuser --runtime-secrets=API
If you are making use of hot start tracks, runtime parameters will 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.