diff --git a/aws-region/README.md b/aws-region/README.md index 1051cc6..8c766c7 100644 --- a/aws-region/README.md +++ b/aws-region/README.md @@ -14,10 +14,6 @@ the region closest to them. ![AWS Regions](../.images/aws-region.png) -## Examples - -### Default Region - Customize the preselected parameter value: ```hcl @@ -31,6 +27,8 @@ provider "aws" { } ``` +## Examples + ### Customize Regions Change the display name and icon for a region: diff --git a/azure-region/README.md b/azure-region/README.md index cb14303..235f58e 100644 --- a/azure-region/README.md +++ b/azure-region/README.md @@ -11,10 +11,6 @@ tags: [helper, parameter, azure, regions] This module adds a parameter with all Azure regions, allowing developers to select the region closest to them. -## Examples - -### Default region - ```hcl module "azure_region" { source = "https://registry.coder.com/modules/azure-region" @@ -26,6 +22,8 @@ resource "azurem_resource_group" "example" { } ``` +## Examples + ### Customize existing regions Change the display name for a region: diff --git a/fly-region/README.md b/fly-region/README.md index f6ec1e5..cea64f3 100644 --- a/fly-region/README.md +++ b/fly-region/README.md @@ -4,17 +4,13 @@ description: A parameter with human region names and icons icon: ../.icons/fly.svg maintainer_github: coder verified: true -tags: [helper, parameter, fly] +tags: [helper, parameter, fly.io, regions] --- # Fly.io Region This module adds Fly.io regions to your Coder template. Regions can be whitelisted using the `regions` argument and given custom names and custom icons with their respective map arguments (`custom_names`, `custom_icons`). -## Examples - -### Using default settings - We can use the simplest format here, only adding a default selection as the `atl` region. ```hcl @@ -26,6 +22,8 @@ module "fly-region" { ![Fly.io Default](../.images/flyio-basic.png) +## Examples + ### Using region whitelist The regions argument can be used to display only the desired regions in the Coder parameter. diff --git a/gcp-region/README.md b/gcp-region/README.md index cfa1370..0ca76e1 100644 --- a/gcp-region/README.md +++ b/gcp-region/README.md @@ -11,38 +11,61 @@ tags: [gcp, regions, parameter, helper] This module adds Google Cloud Platform regions to your Coder template. +```hcl +module "gcp_region" { + source = "https://registry.coder.com/modules/gcp-region" + regions = ["us", "europe"] +} + +resource "google_compute_instance" "example" { + zone = module.gcp_region.value +} +``` + ![GCP Regions](../.images/gcp-regions.png) ## Examples -1. Add only GPU zones in the US West 1 region: - - ```hcl - module "gcp_region" { - source = "https://registry.coder.com/modules/gcp-region" - default = ["us-west1-a"] - regions = ["us-west1"] - gpu_only = false - } - ``` - -2. Add all zones in the Europe West region: - - ```hcl - module "gcp_region" { - source = "https://registry.coder.com/modules/gcp-region" - regions = ["europe-west"] - single_zone_per_region = false - } - ``` - -3. Add a single zone from each region in US and Europe that laos has GPUs - - ```hcl - module "gcp_region" { - source = "https://registry.coder.com/modules/gcp-region" - regions = ["us", "europe"] - gpu_only = true - single_zone_per_region = true - } - ``` +### Add only GPU zones in the US West 1 region + +```hcl +module "gcp_region" { + source = "https://registry.coder.com/modules/gcp-region" + default = ["us-west1-a"] + regions = ["us-west1"] + gpu_only = false +} + +resource "google_compute_instance" "example" { + zone = module.gcp_region.value +} +``` + +### Add all zones in the Europe West region + +```hcl +module "gcp_region" { + source = "https://registry.coder.com/modules/gcp-region" + regions = ["europe-west"] + single_zone_per_region = false +} + +resource "google_compute_instance" "example" { + zone = module.gcp_region.value +} +``` + +### Add a single zone from each region in US and Europe that laos has GPUs + +```hcl +module "gcp_region" { + source = "https://registry.coder.com/modules/gcp-region" + regions = ["us", "europe"] + gpu_only = true + single_zone_per_region = true +} + +resource "google_compute_instance" "example" { + zone = module.gcp_region.value +} +``` diff --git a/git-clone/README.md b/git-clone/README.md index 40ed231..53e566b 100644 --- a/git-clone/README.md +++ b/git-clone/README.md @@ -13,8 +13,9 @@ This module allows you to automatically clone a repository by URL and skip if it ```hcl module "git-clone" { - source = "https://registry.coder.com/modules/git-clone" - url = "https://github.com/coder/coder" + source = "https://registry.coder.com/modules/git-clone" + agent_id = coder_agent.example.id + url = "https://github.com/coder/coder" } ``` @@ -32,8 +33,9 @@ data "coder_git_auth" "github" { ```hcl module "git-clone" { - source = "https://registry.coder.com/modules/git-clone" - url = "https://github.com/coder/coder" - path = "~/projects/coder/coder" + source = "https://registry.coder.com/modules/git-clone" + agent_id = coder_agent.example.id + url = "https://github.com/coder/coder" + path = "~/projects/coder/coder" } ``` diff --git a/jfrog/README.md b/jfrog/README.md index cba9e06..9ae7cce 100644 --- a/jfrog/README.md +++ b/jfrog/README.md @@ -12,12 +12,6 @@ tags: [integration] Install the JF CLI and authenticate package managers with Artifactory. -![JFrog](../.images/jfrog.png) - -## Examples - -### Configure npm, go, and pypi to use Artifactory - ```hcl module "jfrog" { source = "https://registry.coder.com/modules/jfrog" @@ -25,15 +19,13 @@ module "jfrog" { jfrog_url = "https://YYYY.jfrog.io" artifactory_access_token = var.artifactory_access_token # An admin access token package_managers = { - "npm": "npm-local", - "go": "go-local", - "pypi": "pypi-local" + "npm": "npm-remote", + "go": "go-remote", + "pypi": "pypi-remote" } } ``` -## Authentication - Get a JFrog access token from your Artifactory instance. The token must have admin permissions. It is recommended to store the token in a secret terraform variable. ```hcl @@ -42,3 +34,23 @@ variable "artifactory_access_token" { sensitive = true } ``` + +![JFrog](../.images/jfrog.png) + +## Examples + +### Configure npm, go, and pypi to use Artifactory local repositories + +```hcl +module "jfrog" { + source = "https://registry.coder.com/modules/jfrog" + agent_id = coder_agent.example.id + jfrog_url = "https://YYYY.jfrog.io" + artifactory_access_token = var.artifactory_access_token # An admin access token + package_managers = { + "npm": "npm-local", + "go": "go-local", + "pypi": "pypi-local" + } +} +``` diff --git a/vscode-server/README.md b/vscode-server/README.md deleted file mode 100644 index dfbec39..0000000 --- a/vscode-server/README.md +++ /dev/null @@ -1,38 +0,0 @@ ---- -display_name: vscode-server -description: VS Code Web - Visual Studio Code in the browser -icon: ../.icons/code.svg -maintainer_github: coder -verified: true -tags: [helper, ide, vscode, web] ---- - -# VS Code Web - -Automatically install [Visual Studio Code Server](https://code.visualstudio.com/docs/remote/vscode-server) in a workspace using the [VS Code CLIs](https://code.visualstudio.com/docs/editor/command-line) and create an app to access it via the dashboard. - -![VS Code Server with GitHub Copilot and live-share](../.images/vscode-server.gif) - -## Examples - -1. Install VS Code Server with default settings: - - ```hcl - module "vscode-web" { - source = "https://registry.coder.com/modules/vscode-server" - agent_id = coder_agent.example.id - accept_license = true - } - ``` - -2. Install VS Code Server to a custom folder: - - ```hcl - module "vscode-web" { - source = "https://registry.coder.com/modules/vscode-server" - agent_id = coder_agent.example.id - install_dir = "/home/coder/.vscode-server" - folder = "/home/coder" - accept_license = true - } - ``` diff --git a/vscode-web/README.md b/vscode-web/README.md new file mode 100644 index 0000000..4dcfb8d --- /dev/null +++ b/vscode-web/README.md @@ -0,0 +1,36 @@ +--- +display_name: VS Code Web +description: VS Code Web - Visual Studio Code in the browser +icon: ../.icons/code.svg +maintainer_github: coder +verified: true +tags: [helper, ide, vscode, web] +--- + +# VS Code Web + +Automatically install [Visual Studio Code Server](https://code.visualstudio.com/docs/remote/vscode-server) in a workspace using the [VS Code CLI](https://code.visualstudio.com/docs/editor/command-line) and create an app to access it via the dashboard. + +```hcl +module "vscode-web" { + source = "https://registry.coder.com/modules/vscode-server" + agent_id = coder_agent.example.id + accept_license = true +} +``` + +![VS Code Server with GitHub Copilot and live-share](../.images/vscode-server.gif) + +## Examples + +### Install VS Code Server to a custom folder + +```hcl +module "vscode-web" { + source = "https://registry.coder.com/modules/vscode-server" + agent_id = coder_agent.example.id + install_dir = "/home/coder/.vscode-server" + folder = "/home/coder" + accept_license = true +} +``` diff --git a/vscode-server/main.tf b/vscode-web/main.tf similarity index 88% rename from vscode-server/main.tf rename to vscode-web/main.tf index bd86703..ef72c52 100644 --- a/vscode-server/main.tf +++ b/vscode-web/main.tf @@ -22,14 +22,14 @@ variable "port" { variable "folder" { type = string - description = "The folder to open in vscode-server." + description = "The folder to open in vscode-web." default = "" } variable "log_path" { type = string description = "The path to log." - default = "/tmp/vscode-server.log" + default = "/tmp/vscode-web.log" } variable "install_dir" { @@ -48,7 +48,7 @@ variable "accept_license" { } } -resource "coder_script" "vscode-server" { +resource "coder_script" "vscode-web" { agent_id = var.agent_id display_name = "VS Code Web" icon = "/icon/code.svg" @@ -60,9 +60,9 @@ resource "coder_script" "vscode-server" { run_on_start = true } -resource "coder_app" "vscode-server" { +resource "coder_app" "vscode-web" { agent_id = var.agent_id - slug = "vscode-server" + slug = "vscode-web" display_name = "VS Code Web" url = var.folder == "" ? "http://localhost:${var.port}" : "http://localhost:${var.port}?folder=${var.folder}" icon = "/icon/code.svg" diff --git a/vscode-server/run.sh b/vscode-web/run.sh similarity index 100% rename from vscode-server/run.sh rename to vscode-web/run.sh