mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
Add 6 new base templates to the template builder, covering all major cloud providers and platforms: - **scratch**: Minimal starter template with only `coder_agent` and metadata - **aws-windows**: AWS EC2 Windows instances with PowerShell user_data - **azure-linux**: Azure VMs with cloud-init and managed disk persistence - **gcp-linux**: Google Compute Engine Linux instances with persistent disk - **gcp-windows**: Google Compute Engine Windows instances - **digitalocean-linux**: DigitalOcean Linux droplets with persistent volumes Each base includes `base.json`, `main.tf.tmpl`, `README.md` (with prerequisite markers), and any static files (cloud-init configs). Tests verify all 9 bases load, render without error, and produce valid single-agent declarations. `azure-windows` is deferred; it needs to be registered in the `examples` package first. Depends on #26633 > [!NOTE] > This PR was authored by Coder Agents on behalf of @jeremyruppel. --- NB: This is very much an agent-generated PR and draws completely from base templates that exist in `examples/templates/`. The base.json files are new, so review those, but don't spend any brain tokens on the correctness of the terraform and supporting files: any issues there are issues with the upstream example template
55 lines
2.2 KiB
Markdown
55 lines
2.2 KiB
Markdown
---
|
|
display_name: DigitalOcean Droplet (Linux)
|
|
description: Provision DigitalOcean Droplets as Coder workspaces
|
|
icon: ../../../site/static/icon/do.png
|
|
maintainer_github: coder
|
|
verified: true
|
|
tags: [vm, linux, digitalocean]
|
|
---
|
|
|
|
# Remote Development on DigitalOcean Droplets
|
|
|
|
Provision DigitalOcean Droplets as [Coder workspaces](https://coder.com/docs/user-guides/workspace-management) with this example template.
|
|
|
|
<!-- prerequisites:start -->
|
|
|
|
## Prerequisites
|
|
|
|
To deploy workspaces as DigitalOcean Droplets, you'll need:
|
|
|
|
- DigitalOcean [personal access token (PAT)](https://docs.digitalocean.com/reference/api/create-personal-access-token)
|
|
|
|
- DigitalOcean project ID (you can get your project information via the `doctl` CLI by running `doctl projects list`)
|
|
|
|
- Remove the following sections from the `main.tf` file if you don't want to
|
|
associate your workspaces with a project:
|
|
|
|
- `variable "project_uuid"`
|
|
- `resource "digitalocean_project_resources" "project"`
|
|
|
|
- **Optional:** DigitalOcean SSH key ID (obtain via the `doctl` CLI by running
|
|
`doctl compute ssh-key list`)
|
|
|
|
- Note that this is only required for Fedora images to work.
|
|
|
|
### Authentication
|
|
|
|
This template assumes that the Coder Provisioner is run in an environment that is authenticated with Digital Ocean.
|
|
|
|
Obtain a [Digital Ocean Personal Access Token](https://cloud.digitalocean.com/account/api/tokens) and set the `DIGITALOCEAN_TOKEN` environment variable to the access token.
|
|
For other ways to authenticate [consult the Terraform provider's docs](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs).
|
|
|
|
<!-- prerequisites:end -->
|
|
|
|
## Architecture
|
|
|
|
This template provisions the following resources:
|
|
|
|
- DigitalOcean VM (ephemeral, deleted on stop)
|
|
- Managed disk (persistent, mounted to `/home/coder`)
|
|
|
|
This means, when the workspace restarts, any tools or files outside of the home directory are not persisted. To pre-bake tools into the workspace (e.g. `python3`), modify the VM image, or use a [startup script](https://registry.terraform.io/providers/coder/coder/latest/docs/resources/script).
|
|
|
|
> [!NOTE]
|
|
> This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.
|