Skip to content

Commit 59f6a62

Browse files
committed
chore: update variable IDs
1 parent 29a4aa5 commit 59f6a62

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

examples/examples.gen.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"linux",
6767
"digitalocean"
6868
],
69-
"markdown": "\n# Remote Development on DigitalOcean Droplets\n\nProvision DigitalOcean Droplets as [Coder workspaces](https://coder.com/docs/workspaces) with this example template.\n\n\u003c!-- TODO: Add screenshot --\u003e\n\n## Prerequisites\n\nTo deploy workspaces as DigitalOcean Droplets, you'll need:\n\n- DigitalOcean [personal access token (PAT)](https://docs.digitalocean.com/reference/api/create-personal-access-token)\n\n- DigitalOcean project ID (you can get your project information via the `doctl` CLI by running `doctl projects list`)\n\n\t- Remove the following sections from the `main.tf` file if you don't want to\n\t\tassociate your workspaces with a project:\n\n\t\t- `variable \"do_project_id\"`\n\t\t- `resource \"digitalocean_project_resources\" \"project\"`\n\n- **Optional:** DigitalOcean SSH key ID (obtain via the `doctl` CLI by running\n `doctl compute ssh-key list`)\n\n\t- Note that this is only required for Fedora images to work.\n\n### Authentication\n\nThis template assumes that `coderd` is run in an environment that is authenticated with Digital Ocean.\n\nObtain a [Digital Ocean Personal Access Token](https://cloud.digitalocean.com/account/api/tokens) and set the `DIGITALOCEAN_TOKEN` environment variable to the access token before starting `coderd`.\nFor other ways to authenticate [consult the Terraform provider's docs](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs).\n\n## Architecture\n\nThis template provisions the following resources:\n\n- DigitalOcean VM (ephemeral, deleted on stop)\n- Managed disk (persistent, mounted to `/home/coder`)\n\nThis 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).\n\n\u003e [!NOTE]\n\u003e This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.\n"
69+
"markdown": "\n# Remote Development on DigitalOcean Droplets\n\nProvision DigitalOcean Droplets as [Coder workspaces](https://coder.com/docs/workspaces) with this example template.\n\n\u003c!-- TODO: Add screenshot --\u003e\n\n## Prerequisites\n\nTo deploy workspaces as DigitalOcean Droplets, you'll need:\n\n- DigitalOcean [personal access token (PAT)](https://docs.digitalocean.com/reference/api/create-personal-access-token)\n\n- DigitalOcean project ID (you can get your project information via the `doctl` CLI by running `doctl projects list`)\n\n - Remove the following sections from the `main.tf` file if you don't want to\n associate your workspaces with a project:\n\n - `variable \"project_uuid\"`\n - `resource \"digitalocean_project_resources\" \"project\"`\n\n- **Optional:** DigitalOcean SSH key ID (obtain via the `doctl` CLI by running\n `doctl compute ssh-key list`)\n\n - Note that this is only required for Fedora images to work.\n\n### Authentication\n\nThis template assumes that the Coder Provisioner is run in an environment that is authenticated with Digital Ocean.\n\nObtain a [Digital Ocean Personal Access Token](https://cloud.digitalocean.com/account/api/tokens) and set the `DIGITALOCEAN_TOKEN` environment variable to the access token.\nFor other ways to authenticate [consult the Terraform provider's docs](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs).\n\n## Architecture\n\nThis template provisions the following resources:\n\n- DigitalOcean VM (ephemeral, deleted on stop)\n- Managed disk (persistent, mounted to `/home/coder`)\n\nThis 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).\n\n\u003e [!NOTE]\n\u003e This template is designed to be a starting point! Edit the Terraform to extend the template to support your use case.\n"
7070
},
7171
{
7272
"id": "docker",

examples/templates/digitalocean-linux/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ To deploy workspaces as DigitalOcean Droplets, you'll need:
2424
- Remove the following sections from the `main.tf` file if you don't want to
2525
associate your workspaces with a project:
2626

27-
- `variable "do_project_id"`
27+
- `variable "project_uuid"`
2828
- `resource "digitalocean_project_resources" "project"`
2929

3030
- **Optional:** DigitalOcean SSH key ID (obtain via the `doctl` CLI by running
@@ -34,9 +34,9 @@ To deploy workspaces as DigitalOcean Droplets, you'll need:
3434

3535
### Authentication
3636

37-
This template assumes that `coderd` is run in an environment that is authenticated with Digital Ocean.
37+
This template assumes that the Coder Provisioner is run in an environment that is authenticated with Digital Ocean.
3838

39-
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 before starting `coderd`.
39+
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.
4040
For other ways to authenticate [consult the Terraform provider's docs](https://registry.terraform.io/providers/digitalocean/digitalocean/latest/docs).
4141

4242
## Architecture

examples/templates/digitalocean-linux/main.tf

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ terraform {
1111

1212
provider "coder" {}
1313

14-
variable "do_project_id" {
14+
variable "project_uuid" {
1515
type = string
1616
description = <<-EOF
1717
DigitalOcean project ID
@@ -22,16 +22,16 @@ variable "do_project_id" {
2222

2323
validation {
2424
# make sure length of alphanumeric string is 36 (UUIDv4 size)
25-
condition = length(var.do_project_id) == 36
25+
condition = length(var.project_uuid) == 36
2626
error_message = "Invalid Digital Ocean Project ID."
2727
}
2828

2929
}
3030

31-
variable "do_admin_ssh_key" {
31+
variable "ssh_key_id" {
3232
type = number
3333
description = <<-EOF
34-
Enter admin SSH key ID (some Droplet images require an SSH key to be set):
34+
DigitalOcean SSH key ID (some Droplet images require an SSH key to be set):
3535
3636
Can be set to "0" for no key.
3737
@@ -43,7 +43,7 @@ variable "do_admin_ssh_key" {
4343
default = 0
4444

4545
validation {
46-
condition = var.do_admin_ssh_key >= 0
46+
condition = var.ssh_key_id >= 0
4747
error_message = "Invalid Digital Ocean SSH key ID, a number is required."
4848
}
4949
}
@@ -291,11 +291,11 @@ resource "digitalocean_droplet" "workspace" {
291291
coder_agent_token = coder_agent.main.token
292292
})
293293
# Required to provision Fedora.
294-
ssh_keys = var.do_admin_ssh_key > 0 ? [var.do_admin_ssh_key] : []
294+
ssh_keys = var.ssh_key_id > 0 ? [var.ssh_key_id] : []
295295
}
296296

297297
resource "digitalocean_project_resources" "project" {
298-
project = var.do_project_id
298+
project = var.project_uuid
299299
# Workaround for terraform plan when using count.
300300
resources = length(digitalocean_droplet.workspace) > 0 ? [
301301
digitalocean_volume.home_volume.urn,

0 commit comments

Comments
 (0)