Skip to content

rso_app (Resource)

A serverless app: one container image served over HTTPS, scaled by request load (Knative). Billed on the CPU and memory it actually uses.

Example Usage

# A serverless app from a public image, always keeping one instance warm.
resource "rso_app" "hello" {
  name  = "tf-example-hello"
  image = "ghcr.io/knative/helloworld-go:latest"
  port  = 8080

  env = {
    TARGET = "Terraform"
  }

  cpu_request    = "50m"
  memory_request = "64Mi"
  cpu_limit      = "250m"
  memory_limit   = "128Mi"

  min_scale = 1
  max_scale = 3
}

output "app_url" {
  value = rso_app.hello.url
}

Schema

Required

  • image (String) Container image reference, e.g. ghcr.io/acme/web:1.4.2.
  • name (String) App name, unique within the tenant; becomes part of its URL. Changing it creates a new app.

Optional

  • cpu_limit (String) CPU limit, e.g. 500m.
  • cpu_request (String) CPU request, e.g. 100m.
  • env (Map of String) Environment variables as a map of name to value.
  • image_pull_secret (String) Name of a registry credentials secret in the tenant, for private images.
  • max_scale (Number) Maximum number of instances. Unset means no explicit cap.
  • memory_limit (String) Memory limit, e.g. 256Mi.
  • memory_request (String) Memory request, e.g. 128Mi.
  • min_scale (Number) Minimum number of running instances. 0 (default) lets the app scale to zero when idle.
  • port (Number) Port the container listens on. Default 8080.

Read-Only

  • id (String) The ID of this resource.
  • url (String) Public HTTPS URL of the app.