Service

Service

The service resource represents a target that a tab in the layout can point at. A service is a web service or application running on a sandbox container or VM. It contains all the configuration that the participants proxy needs to route to the target service behind it.


resource "service" "name" {
  ...
}

Attributes

Attribute
Description

Target target required type: Reference to Container

The resource that hosts the service.

Scheme scheme required type: string

Which scheme to use to connect to the service e.g. "http", "https".

Port port required type: int

The port the service is listening on.

Title title type: string

DEPRECATED: Use the `title` field on Lab.Layout.Tab instead

Path path type: string

The path to call on the service.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefore only known at parsetime or runtime.

Attribute
Description

Meta ID meta.id string

The full ID of the resource e.g. `resource.type.name`. This is computed from the full resource path:

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting id will be
resource.container.ubuntu

Meta Type meta.type string

The type of the resource. This taken from the type label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting type will be
container

Meta Name meta.name string

The name of the resource. This taken from the name label of the resource definition.

// given the following resource
resource "container" "ubuntu" {
  ...
}

// the resulting name will be
ubuntu

Examples

Full Example

resource "service" "vault_ui" {
  title = "Vault UI"

  target = resource.container.ubuntu
  scheme = "http"
  port = 8200
  path = "/ui"
}

Last updated