Skip to content

rso_ingress_route (Resource)

A public HTTP(S) route at the edge: requests matching a rule are sent to an rso_external_service. The API has no update, so every change replaces the route.

Example Usage

resource "rso_ingress_route" "web" {
  name = "web"

  routes = [{
    match = "Host(`app.example.com`)"
    services = [{
      external_service = rso_external_service.web.name
      port             = 80
    }]
  }]
}

# Plain HTTP on :80, no certificate.
resource "rso_ingress_route" "web_http" {
  name         = "web-http"
  certificate  = "none"
  entry_points = ["http"]

  routes = [{
    match = "Host(`app.example.com`)"
    services = [{
      external_service = rso_external_service.web.name
      port             = 80
    }]
  }]
}

Schema

Required

  • name (String) Route name, unique within the tenant.
  • routes (Attributes List) Rules of the route. A request is sent to the services of the rule it matches. (see below for nested schema)

Optional

  • certificate (String) How the certificate is obtained: dns (default; validated through DNS, the domain must be a zone the platform manages), http (validated over HTTP, works with any DNS provider) or none for a route without a certificate.
  • entry_points (List of String) Listeners of the route: https (port 443, default) and/or http (port 80).

Read-Only

  • id (String) The ID of this resource.

Nested Schema for routes

Required:

  • match (String) Match rule, e.g. Host(`app.example.com`) or Host(`app.example.com`) && PathPrefix(`/api`).
  • services (Attributes List) Backends for the rule. (see below for nested schema)

Optional:

  • middlewares (List of String) Names of rso_middleware resources applied to the rule, in order.

Nested Schema for routes.services

Required:

  • external_service (String) Name of the rso_external_service to send traffic to.
  • port (Number) Port of the external service.

Optional:

  • scheme (String) http or https towards the backend.
  • servers_transport (String) Name of the transport settings to use towards the backend, when it needs other than the defaults.

Import

Import is supported using the following syntax:

# Import an existing ingress route by name.
terraform import rso_ingress_route.web web