# Coder

Give Sandcovery your Coder deployment's access URL, a session token, and a template that takes cpu and memory parameters.

[Coder](https://coder.com/) is a self-hosted platform for cloud development environments, and Sandcovery runs each sandbox as a Coder workspace on a deployment you host. Sandcovery creates the workspace from a template you name, runs commands and file transfers through its workspace agent's terminal, and deletes the workspace with the sandbox.

- **Access URL**: your deployment's https address, such as `https://coder.example.com`, with no login, query, or fragment. Sandcovery sends your token only to this URL.
- **Session token**: an API token for a user who can create and delete workspaces from the template. Sandcovery sends it in the `Coder-Session-Token` header.
- **Template**: a template on your deployment, which Sandcovery lists once you enter the token.

## What the template needs

The template must run a Coder agent and take two parameters, named `cpu` and `memory`, that Sandcovery sets to a sandbox's vCPUs and GiB of memory. Coder's [Kubernetes starter template](https://github.com/coder/coder/blob/v2.38.10/examples/templates/kubernetes/main.tf) does, with the options 2, 4, 6, and 8 for each.

| Option | Support |
| --- | --- |
| Size | `1x2`, `2x4`, `4x8`, and `8x16`, each only where the template's `cpu` and `memory` options list it |
| Disk, image, and environment | Whatever the template sets |
| Egress | `allow_all`, within your template's own network |
| Lifetime | Until the sandbox's TTL |
| Pause and resume | No |
| Region | Where your template puts the workspace |

Snapshots, port previews, custom images, idle timeouts, disk sizes, egress limits, region choice, sandbox environment values, and GPUs are not available on this provider. A create that asks for one, or for a size the template's options do not list, routes to another provider.

Sandcovery waits up to 50 seconds for a new workspace's build to run and its agent to connect, and deletes the workspace and tries the next provider when they do not, or at once when the build fails or the agent reports an error. A template that builds slowly, such as one that pulls a large image, needs a faster build than that.
