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.

Attributes

Attributes are the properties of a resource that can be used to configure it.

Attribute
Description

Title title required string

The title of the service tab.

Target target required Reference to Container, VM

The resource that hosts the service.

Scheme scheme required string

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

Port port required int

The port the service is listening on.

Path path string

The path to call on the service.

Computed Attributes

These attributes are computed when the config is parsed and applied, and are therefor 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:

resource "type" "name" {
  ...
}

Meta Type meta.type string

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

resource "type" "name" {
  ...
}

Meta Name meta.name string

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

resource "type" "name" {
  ... 
}

Examples

"Full Example"

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

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

Last updated