runr_runtime (Resource)
A runtime plugin registered from a runtime.yaml manifest (docs/runtimes.md): a platform runtime for tokens with runtimes.manage, a custom runtime of the organization with runtimes.use_custom. RunR validates the manifest and builds the image of dockerfile and git versions in each region. A change of the manifest's id replaces the runtime; deleting a runtime that projects use fails.
Example Usage#
# A runtime plugin from its manifest and the files of its dockerfile version
# (examples/runtimes/q in the RunR repository): RunR builds the image in each region.
resource "runr_runtime" "q" {
manifest = file("${path.module}/runtimes/q/runtime.yaml")
files = {
for f in fileset("${path.module}/runtimes/q/interpreter", "*") :
f => file("${path.module}/runtimes/q/interpreter/${f}")
}
}
# An exec runtime on an existing image, written inline.
resource "runr_runtime" "bash" {
manifest = yamlencode({
apiVersion = "runr.sh/v1"
kind = "Runtime"
id = "bash"
name = "Bash"
extensions = ["sh"]
versions = [{ version = "5", image = "bash:5", default = true }]
run = {
mode = "exec"
input = "raw"
command = ["bash", "/app/code/{file}"]
}
})
regions = [data.runr_region.eu.id]
}
# Projects use the runtime by its id.
resource "runr_project" "script" {
name = "hello-sh"
type = "xaas"
runtime = runr_runtime.bash.id
region_id = data.runr_region.eu.id
}
Schema#
Required#
manifest(String) The manifest as YAML or JSON text, e.g.file("runtime.yaml")oryamlencode({...}).
Optional#
enabled(Boolean) Whether new projects can pick the runtime and its projects deploy.files(Map of String) Files uploaded with the runtime, name → content: the Dockerfile and build context ofdockerfileversions (flat names, at most 900 KB together).regions(List of String) Ids of the regions the runtime is offered in; unset offers it in every region.
Read-Only#
id(String) Runtime id (the manifest'sid), stored on projects asruntime.name(String) Display name.run_mode(String)http,execorpersistent.source(String)platformorcustom.versions(List of Object) Versions:version,is_default,eol_at,image(empty for versions RunR builds per region) andbuilt. (see below for nested schema)
Nested Schema for versions#
Read-Only:
built(Boolean)eol_at(String)image(String)is_default(Boolean)version(String)
Import#
Import is supported using the following syntax:
The terraform import command can be used, for example:
# <runtime id>
terraform import runr_runtime.q q