Docs docs

The docs resource allows you to embed documentation and guides into your blueprints. The docs are authored in markdown and can be enriched using React components and html.

Once the docs resource is created, the content will be available at http://<resource-name>.docs.local.jmpd.in:3000.

Properties

  • Name
    network
    Type
    (network: {})
    Required
    required
    Readonly
    Description

    The network to attach the docs to.

  • Name
    port
    Type
    (port: {})
    Required
    Readonly
    Description

    The port to expose the docs on.

  • Name
    image
    Type
    (image: {})
    Required
    Readonly
    Description

    The Docker image to use for the docs container.

  • Name
    content
    Type
    ([]book: [])
    Required
    required
    Readonly
    Description

    A list of books to include in the docs.

    content = [
      resource.book.introduction,
      module.course.output.book
    ]
    
  • Name
    logo
    Type
    (logo: {})
    Required
    Readonly
    Description

    Override the default logo with a custom one.

  • Name
    assets
    Type
    (string: "")
    Required
    Readonly
    Description

    The path on the host to an assets folder that will be available at the `/assets' path of the docs.

  • Name
    fqdn
    Type
    (string: "")
    Required
    Readonly
    readonly
    Description

    The name of the resulting docs container.


network_attachment

Network attachment defines a network to which the container is attached.

  • Name
    id
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    ID of the network to attach the container to, specified in reference format. e.g. to attach to a network called cloud

    network {
      id = "network.cloud"
    }
    
  • Name
    ip_address
    Type
    (string: "")
    Required
    Readonly
    Description

    Static IP address to assign container for the network, the ip address must be within range defined by the network subnet. If this parameter is omitted an IP address will be automatically assigned.

  • Name
    aliases
    Type
    ([]string: [])
    Required
    Readonly
    Description

    Aliases allow alternate names to specified for the container. Aliases can be used to reference a container across the network, the container will respond to ping and other network resolution using the primary assigned name [name].container.shipyard.run and the aliases.

    network {
      name    = "network.cloud"
      aliases = [
        "alt1.container.local.jmpd.in", 
        "alt2.container.local.jmpd.in"
      ]
    }
    
  • Name
    name
    Type
    (string: "")
    Required
    Readonly
    readonly
    Description

    Name will equal the name of the network as created by jumppad.

  • Name
    assigned_address
    Type
    (string: "")
    Required
    Readonly
    readonly
    Description

    assigned_address will equal the assigned IP address for the network. This will equal ip_address if set; otherwise, this is the automatically assigned ip_address.


image

Image defines a Docker image used when creating this container. An Image can be stored in a public or a private repository.

  • Name
    name
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    Name of the image to use when creating the container, can either be the full canonical name or short name for Docker official images. e.g. consul:v1.6.1 or docker.io/consul:v1.6.1.

  • Name
    username
    Type
    (string: "")
    Required
    Readonly
    Description

    Username to use when connecting to a private image repository

  • Name
    password
    Type
    (string: "")
    Required
    Readonly
    Description

    Password to use when connecting to a private image repository, for both username and password interpolated environment variables can be used in place of static values.

    image {
      name = "myregistry.io/myimage:latest"
      username = env("REGISTRY_USERNAME")
      password = env("REGISTRY_PASSWORD")
    }
    

port

A port stanza defines host to container communications

  • Name
    local
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The local port in the container.

  • Name
    host
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The host port to map the local port to.

  • Name
    protocol
    Type
    (string: "")
    Required
    Readonly
    Description

    The protocol to use when exposing the port, can be "tcp", or "udp".

  • Name
    open_in_browser
    Type
    (string: /)
    Required
    Readonly
    Description

    Should a browser window be automatically opened when this resource is created. Browser windows will open at the path specified by this property.


Logo

Logo defines a logo image to use in the docs.

  • Name
    url
    Type
    (string: "")
    Required
    required
    Readonly
    Description

    The url to the logo image.

  • Name
    width
    Type
    (int: )
    Required
    required
    Readonly
    Description

    The width of the logo image in pixels.

  • Name
    height
    Type
    (int: )
    Required
    required
    Readonly
    Description

    The height of the logo image in pixels.


Examples

resource "docs" "docs" {
  network {
    id = resource.network.main.meta.id
  }

  image {
    name = "ghcr.io/jumppad-labs/docs:v0.4.0"
  }

  logo {
    url = "https://mycompany.com/logo.png"
    width = 32
    height = 32
  }

  content = [
    module.course.output.book
  ]

 assets = "${dir()}/assets"
}