spotlight_egress

The spotlight_egress resource, and the egress resource of the API: an egress that the runners of push pools send their traffic through. A spotlight_runner_pool names it by id in provision.egress. The egress itself is a spotlight egress serve process that you run; see Shared egress. Writing one needs the runners permission; see Roles and permissions.

KindEndpointTerraformAddress
egress/api/v1/resources/workspaces/{workspaceId}/egressesspotlight_egress<key>

See Resource API for the operations, headers and errors every kind shares.

Example

variable "egress_token" {
  type      = string
  sensitive = true
}

resource "spotlight_egress" "shared" {
  workspace_id  = spotlight_workspace.acme.id
  key           = "shared"
  url           = "https://egress.acme.example"
  token         = var.egress_token
  token_version = 1
}

resource "spotlight_runner_pool" "jobs" {
  workspace_id = spotlight_workspace.acme.id
  key          = "jobs"
  provision = {
    url            = "https://provision.acme.example/spotlight"
    secret         = var.provision_secret
    secret_version = 1
    egress         = spotlight_egress.shared.id
  }
}

Fields

FieldTypeDefaultDescription
keystringrequiredLowercase words joined by dashes, at most 64 characters. Immutable: an update that changes it is rejected; Terraform replaces the resource.
urlstringrequiredWhere the runners of a pool that names the egress send their traffic. An absolute http or https URL with no credentials, no query and no fragment, at most 2,048 characters.
tokenstringnoneWrite-only. The token the egress calls Spotlight with. 32 to 255 of A-Z a-z 0-9 . _ ~ -. Without it, Spotlight issues one; see Egress token.
tokenVersioninteger or nullnullAt least 0. A change must come with a new token.

In Terraform, token is write-only and needs Terraform 1.11 or later. A token Spotlight issues is not kept in the Terraform state, and the provider warns Spotlight issued the egress a token Terraform did not store.

MessageCause
is lowercase words joined by dashes, at most 64 characters, as in sharedA key of another shape.
must be an absolute https URL, as in https://egress.example.comA url that is not a URL.
must be an http or https URLA url with another scheme.
must carry no credentials. Runners send their proxy credentialA url with a user name or a password.
must be at most 2048 characters, with no query and no fragmentA url that is too long, or has a query or a fragment.
must be 32 to 255 URL-safe charactersA token of another shape.
is required whenever tokenVersion changesA tokenVersion change without a token.
can't change its key to <key>. Please replace the egress insteadAn update that changes key.

Egress token

  • An egress created without token gets one from Spotlight, returned once in the Spotlight-Egress-Token response header, never again. A retry of the create does not return it.
  • Spotlight keeps only its hash.
  • Each token is single-use. A token that another egress has is rejected with is in use by another egress. Please use a different token for each egress. A token rotated away, or used by an egress since deleted or replaced, is rejected for every egress, the egress that used it included, with was used before. Each egress token is single-use. Please use a new token.
  • After a rotation with a new tokenVersion, the old token stops working at once.

The egress process reads the token from SPOTLIGHT_EGRESS_TOKEN. Runners never get it. See Credentials.

Warnings

PathWarning
urlis not https. Runners send their proxy credential to it. A production deployment does not provision runners that use it

Delete

A delete fails with 409 in-use while a runner pool names the egress:

Egress <key> is in use. Runner pools that name it: <pool keys>. Please remove provision.egress from these pools first.

When an egress is deleted, its token stops working.

In Terraform, do not remove a spotlight_egress in the same apply as the provision.egress that names it. Terraform can delete the egress before it updates the pools, and the delete fails with 409. Remove provision.egress from the pools and apply first, then remove the egress.

On this page