pull/122/head
Muhammad Atif Ali 2 years ago
parent 5b2f3bd599
commit c67575b301

@ -13,7 +13,8 @@ tags: [helper]
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME"
version = "1.0.0"
} }
``` ```
@ -27,11 +28,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ agent_id = coder_agent.example.id
"dracula-theme.theme-dracula" extensions = [
] "dracula-theme.theme-dracula"
]
} }
``` ```
@ -43,12 +45,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula" ] agent_id = coder_agent.example.id
settings = { extensions = [ "dracula-theme.theme-dracula" ]
"workbench.colorTheme" = "Dracula" settings = {
} "workbench.colorTheme" = "Dracula"
}
} }
``` ```
@ -58,8 +61,9 @@ Run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "MODULE_NAME" { module "MODULE_NAME" {
source = "https://registry.coder.com/modules/MODULE_NAME" source = "registry.coder.com/modules/MODULE_NAME"
agent_id = coder_agent.example.id version = "1.0.0"
offline = true agent_id = coder_agent.example.id
offline = true
} }
``` ```

@ -20,7 +20,10 @@ $ bun test -t '<module>'
You can test a module locally by updating the source as follows You can test a module locally by updating the source as follows
```hcl ```hcl
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>" module "example" {
source = "git::https://github.com/<USERNAME>/<REPO>.git//<MODULE-NAME>?ref=<BRANCH-NAME>"
version = "1.0.0"
}
``` ```
> **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR. > **Note:** This is the responsibility of the module author to implement tests for their module. and test the module locally before submitting a PR.

@ -16,8 +16,9 @@ e.g.
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.main.id version = "1.0.0"
agent_id = coder_agent.main.id
} }
``` ```

@ -16,12 +16,13 @@ Customize the preselected parameter value:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region"
default = "us-east-1" version = "1.0.0"
default = "us-east-1"
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```
@ -35,18 +36,19 @@ Change the display name and icon for a region using the corresponding maps:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region"
default = "ap-south-1" version = "1.0.0"
custom_names = { default = "ap-south-1"
"ap-south-1": "Awesome Mumbai!" custom_names = {
} "ap-south-1": "Awesome Mumbai!"
custom_icons = { }
"ap-south-1": "/emojis/1f33a.png" custom_icons = {
} "ap-south-1": "/emojis/1f33a.png"
}
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```
@ -58,12 +60,13 @@ Hide the Asia Pacific regions Seoul and Osaka:
```hcl ```hcl
module "aws-region" { module "aws-region" {
source = "https://registry.coder.com/modules/aws-region" source = "registry.coder.com/modules/aws-region"
exclude = [ "ap-northeast-2", "ap-northeast-3" ] version = "1.0.0"
exclude = [ "ap-northeast-2", "ap-northeast-3" ]
} }
provider "aws" { provider "aws" {
region = module.aws_region.value region = module.aws_region.value
} }
``` ```

@ -13,12 +13,13 @@ This module adds a parameter with all Azure regions, allowing developers to sele
```hcl ```hcl
module "azure_region" { module "azure_region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region"
default = "eastus" version = "1.0.0"
default = "eastus"
} }
resource "azurem_resource_group" "example" { resource "azurem_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```
@ -32,17 +33,18 @@ Change the display name and icon for a region using the corresponding maps:
```hcl ```hcl
module "azure-region" { module "azure-region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region"
custom_names = { version = "1.0.0"
"australia": "Go Australia!" custom_names = {
} "australia": "Go Australia!"
custom_icons = { }
"australia": "/icons/smiley.svg" custom_icons = {
} "australia": "/icons/smiley.svg"
}
} }
resource "azurerm_resource_group" "example" { resource "azurerm_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```
@ -54,17 +56,18 @@ Hide all regions in Australia except australiacentral:
```hcl ```hcl
module "azure-region" { module "azure-region" {
source = "https://registry.coder.com/modules/azure-region" source = "registry.coder.com/modules/azure-region"
exclude = [ version = "1.0.0"
"australia", exclude = [
"australiacentral2", "australia",
"australiaeast", "australiacentral2",
"australiasoutheast" "australiaeast",
] "australiasoutheast"
]
} }
resource "azurerm_resource_group" "example" { resource "azurerm_resource_group" "example" {
location = module.azure_region.value location = module.azure_region.value
} }
``` ```

@ -13,8 +13,9 @@ Automatically install [code-server](https://github.com/coder/code-server) in a w
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```
@ -38,11 +39,12 @@ Install the Dracula theme from [OpenVSX](https://open-vsx.org/):
```hcl ```hcl
module "code-server" { module "code-server" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ agent_id = coder_agent.example.id
"dracula-theme.theme-dracula" extensions = [
] "dracula-theme.theme-dracula"
]
} }
``` ```
@ -54,12 +56,13 @@ Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarte
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula" ] agent_id = coder_agent.example.id
settings = { extensions = [ "dracula-theme.theme-dracula" ]
"workbench.colorTheme" = "Dracula" settings = {
} "workbench.colorTheme" = "Dracula"
}
} }
``` ```
@ -69,9 +72,10 @@ Just run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id version = "1.0.0"
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ] agent_id = coder_agent.example.id
extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ]
} }
``` ```
@ -81,8 +85,9 @@ Just run code-server in the background, don't fetch it from GitHub:
```hcl ```hcl
module "settings" { module "settings" {
source = "https://registry.coder.com/modules/code-server" source = "registry.coder.com/modules/code-server"
agent_id = coder_agent.example.id version = "1.0.0"
offline = true agent_id = coder_agent.example.id
offline = true
} }
``` ```

@ -13,8 +13,8 @@ Automatically logs the user into Coder when creating their workspace.
```hcl ```hcl
module "coder-login" { module "coder-login" {
source = "https://registry.coder.com/modules/coder-login" source = "https://registry.coder.com/modules/coder-login"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```

@ -13,7 +13,8 @@ Allow developers to optionally bring their own [dotfiles repository](https://dot
```hcl ```hcl
module "dotfiles" { module "dotfiles" {
source = "https://registry.coder.com/modules/dotfiles" source = "registry.coder.com/modules/dotfiles"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```

@ -16,8 +16,9 @@ Customize the preselected parameter value:
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "registry.coder.com/modules/exoscale-instance-type"
default = "standard.medium" version = "1.0.0"
default = "standard.medium"
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {
@ -43,14 +44,15 @@ Change the display name a type using the corresponding maps:
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "registry.coder.com/modules/exoscale-instance-type"
default = "standard.medium" version = "1.0.0"
custom_names = { default = "standard.medium"
"standard.medium": "Mittlere Instanz" # German translation custom_names = {
} "standard.medium": "Mittlere Instanz" # German translation
custom_descriptions = { }
"standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation custom_descriptions = {
} "standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation
}
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {
@ -74,19 +76,19 @@ Show only gpu1 types
```hcl ```hcl
module "exoscale-instance-type" { module "exoscale-instance-type" {
source = "https://registry.coder.com/modules/exoscale-instance-type" source = "https://registry.coder.com/modules/exoscale-instance-type"
default = "gpu.large" default = "gpu.large"
type_category = ["gpu"] type_category = ["gpu"]
exclude = [ exclude = [
"gpu2.small", "gpu2.small",
"gpu2.medium", "gpu2.medium",
"gpu2.large", "gpu2.large",
"gpu2.huge", "gpu2.huge",
"gpu3.small", "gpu3.small",
"gpu3.medium", "gpu3.medium",
"gpu3.large", "gpu3.large",
"gpu3.huge" "gpu3.huge"
] ]
} }
resource "exoscale_compute_instance" "instance" { resource "exoscale_compute_instance" "instance" {

@ -16,8 +16,9 @@ Customize the preselected parameter value:
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone"
default = "ch-dk-2" version = "1.0.0"
default = "ch-dk-2"
} }
@ -42,14 +43,15 @@ Change the display name and icon for a zone using the corresponding maps:
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone"
default = "at-vie-1" version = "1.0.0"
custom_names = { default = "at-vie-1"
"at-vie-1": "Home Vienna" custom_names = {
} "at-vie-1": "Home Vienna"
custom_icons = { }
"at-vie-1": "/emojis/1f3e0.png" custom_icons = {
} "at-vie-1": "/emojis/1f3e0.png"
}
} }
data "exoscale_compute_template" "my_template" { data "exoscale_compute_template" "my_template" {
@ -71,8 +73,9 @@ Hide the Switzerland zones Geneva and Zurich
```hcl ```hcl
module "exoscale-zone" { module "exoscale-zone" {
source = "https://registry.coder.com/modules/exoscale-zone" source = "registry.coder.com/modules/exoscale-zone"
exclude = [ "ch-gva-2", "ch-dk-2" ] version = "1.0.0"
exclude = [ "ch-gva-2", "ch-dk-2" ]
} }
data "exoscale_compute_template" "my_template" { data "exoscale_compute_template" "my_template" {

@ -13,8 +13,9 @@ A file browser for your workspace.
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```
@ -26,9 +27,10 @@ module "filebrowser" {
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser"
agent_id = coder_agent.example.id version = "1.0.0"
folder = "/home/coder/project" agent_id = coder_agent.example.id
folder = "/home/coder/project"
} }
``` ```
@ -36,8 +38,9 @@ module "filebrowser" {
```hcl ```hcl
module "filebrowser" { module "filebrowser" {
source = "https://registry.coder.com/modules/filebrowser" source = "registry.coder.com/modules/filebrowser"
agent_id = coder_agent.example.id version = "1.0.0"
database_path = ".config/filebrowser.db" agent_id = coder_agent.example.id
database_path = ".config/filebrowser.db"
} }
``` ```

@ -15,8 +15,9 @@ We can use the simplest format here, only adding a default selection as the `atl
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region"
default = "atl" version = "1.0.0"
default = "atl"
} }
``` ```
@ -30,9 +31,10 @@ The regions argument can be used to display only the desired regions in the Code
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region"
default = "ams" version = "1.0.0"
regions = ["ams", "arn", "atl"] default = "ams"
regions = ["ams", "arn", "atl"]
} }
``` ```
@ -44,14 +46,15 @@ Set custom icons and names with their respective maps.
```hcl ```hcl
module "fly-region" { module "fly-region" {
source = "https://registry.coder.com/modules/fly-region" source = "registry.coder.com/modules/fly-region"
default = "ams" version = "1.0.0"
custom_icons = { default = "ams"
"ams" = "/emojis/1f90e.png" custom_icons = {
} "ams" = "/emojis/1f90e.png"
custom_names = { }
"ams" = "We love the Netherlands!" custom_names = {
} "ams" = "We love the Netherlands!"
}
} }
``` ```

@ -13,12 +13,12 @@ This module adds Google Cloud Platform regions to your Coder template.
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "https://registry.coder.com/modules/gcp-region"
regions = ["us", "europe"] regions = ["us", "europe"]
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@ -32,14 +32,14 @@ Note: setting `gpu_only = true` and using a default region without GPU support,
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "https://registry.coder.com/modules/gcp-region"
default = ["us-west1-a"] default = ["us-west1-a"]
regions = ["us-west1"] regions = ["us-west1"]
gpu_only = false gpu_only = false
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@ -47,13 +47,13 @@ resource "google_compute_instance" "example" {
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "https://registry.coder.com/modules/gcp-region"
regions = ["europe-west"] regions = ["europe-west"]
single_zone_per_region = false single_zone_per_region = false
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```
@ -61,13 +61,13 @@ resource "google_compute_instance" "example" {
```hcl ```hcl
module "gcp_region" { module "gcp_region" {
source = "https://registry.coder.com/modules/gcp-region" source = "https://registry.coder.com/modules/gcp-region"
regions = ["us", "europe"] regions = ["us", "europe"]
gpu_only = true gpu_only = true
single_zone_per_region = true single_zone_per_region = true
} }
resource "google_compute_instance" "example" { resource "google_compute_instance" "example" {
zone = module.gcp_region.value zone = module.gcp_region.value
} }
``` ```

@ -13,9 +13,9 @@ This module allows you to automatically clone a repository by URL and skip if it
```hcl ```hcl
module "git-clone" { module "git-clone" {
source = "https://registry.coder.com/modules/git-clone" source = "https://registry.coder.com/modules/git-clone"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
} }
``` ```
@ -23,7 +23,7 @@ To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-prov
```hcl ```hcl
data "coder_git_auth" "github" { data "coder_git_auth" "github" {
id = "github" id = "github"
} }
``` ```
@ -33,9 +33,9 @@ data "coder_git_auth" "github" {
```hcl ```hcl
module "git-clone" { module "git-clone" {
source = "https://registry.coder.com/modules/git-clone" source = "https://registry.coder.com/modules/git-clone"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
url = "https://github.com/coder/coder" url = "https://github.com/coder/coder"
path = "~/projects/coder/coder" path = "~/projects/coder/coder"
} }
``` ```

@ -18,7 +18,8 @@ This module has a chance of conflicting with the user's dotfiles / the personali
```hcl ```hcl
module "git-commit-signing" { module "git-commit-signing" {
source = "https://registry.coder.com/modules/git-commit-signing" source = "registry.coder.com/modules/git-commit-signing"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

@ -13,7 +13,8 @@ Runs a script that updates git credentials in the workspace to match the user's
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -26,7 +27,8 @@ TODO: Add screenshot
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
allow_email_change = true allow_email_change = true
} }
@ -38,7 +40,8 @@ TODO: Add screenshot
```hcl ```hcl
module "git-config" { module "git-config" {
source = "https://registry.coder.com/modules/git-config" source = "registry.coder.com/modules/git-config"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
allow_username_change = false allow_username_change = false
allow_email_change = false allow_email_change = false

@ -18,7 +18,8 @@ Install the JF CLI and authenticate package managers with Artifactory using OAut
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://jfrog.example.com"
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"
@ -45,17 +46,17 @@ To set this up,
artifactory: artifactory:
enabled: true enabled: true
frontend: frontend:
extraEnvironmentVariables: extraEnvironmentVariables:
- name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION - name: JF_FRONTEND_FEATURETOGGLER_ACCESSINTEGRATION
value: "true" value: "true"
access: access:
accessConfig: accessConfig:
integrations-enabled: true integrations-enabled: true
integration-templates: integration-templates:
- id: "1" - id: "1"
name: "CODER" name: "CODER"
redirect-uri: "https://CODER_URL/external-auth/jfrog/callback" redirect-uri: "https://CODER_URL/external-auth/jfrog/callback"
scope: "applied-permissions/user" scope: "applied-permissions/user"
``` ```
> Note > Note
@ -85,7 +86,8 @@ Configure the Python pip package manager to fetch packages from Artifactory whil
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://jfrog.example.com"
auth_method = "oauth" auth_method = "oauth"
@ -112,7 +114,8 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-oauth" source = "registry.coder.com/modules/jfrog-oauth"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://jfrog.example.com" jfrog_url = "https://jfrog.example.com"
username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username"

@ -14,7 +14,8 @@ Install the JF CLI and authenticate package managers with Artifactory using Arti
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io" jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token artifactory_access_token = var.artifactory_access_token
@ -46,7 +47,8 @@ variable "artifactory_access_token" {
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://YYYY.jfrog.io" jfrog_url = "https://YYYY.jfrog.io"
artifactory_access_token = var.artifactory_access_token # An admin access token artifactory_access_token = var.artifactory_access_token # An admin access token
@ -78,7 +80,8 @@ The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extensio
```hcl ```hcl
module "jfrog" { module "jfrog" {
source = "https://registry.coder.com/modules/jfrog-token" source = "registry.coder.com/modules/jfrog-token"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
jfrog_url = "https://XXXX.jfrog.io" jfrog_url = "https://XXXX.jfrog.io"
artifactory_access_token = var.artifactory_access_token artifactory_access_token = var.artifactory_access_token

@ -15,7 +15,8 @@ A module that adds Jupyter Notebook in your Coder template.
```hcl ```hcl
module "jupyter-notebook" { module "jupyter-notebook" {
source = "https://registry.coder.com/modules/jupyter-notebook" source = "registry.coder.com/modules/jupyter-notebook"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

@ -15,7 +15,8 @@ A module that adds JupyterLab in your Coder template.
```hcl ```hcl
module "jupyterlab" { module "jupyterlab" {
source = "https://registry.coder.com/modules/jupyterlab" source = "registry.coder.com/modules/jupyterlab"
agent_id = coder_agent.example.id version = "1.0.0"
agent_id = coder_agent.example.id
} }
``` ```

@ -13,7 +13,8 @@ Run a script on workspace start that allows developers to run custom commands to
```hcl ```hcl
module "personalize" { module "personalize" {
source = "https://registry.coder.com/modules/personalize" source = "registry.coder.com/modules/personalize"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```

@ -12,55 +12,56 @@ tags: [helper]
Add the `slackme` command to your workspace that DMs you on Slack when your command finishes running. Add the `slackme` command to your workspace that DMs you on Slack when your command finishes running.
```bash ```bash
$ slackme npm run long-build slackme npm run long-build
``` ```
## Setup ## Setup
1. Navigate to [Create a Slack App](https://api.slack.com/apps?new_app=1) and select "From an app manifest". Select a workspace and paste in the following manifest, adjusting the redirect URL to your Coder deployment: 1. Navigate to [Create a Slack App](https://api.slack.com/apps?new_app=1) and select "From an app manifest". Select a workspace and paste in the following manifest, adjusting the redirect URL to your Coder deployment:
```json ```json
{ {
"display_information": { "display_information": {
"name": "Command Notify", "name": "Command Notify",
"description": "Notify developers when commands finish running inside Coder!", "description": "Notify developers when commands finish running inside Coder!",
"background_color": "#1b1b1c" "background_color": "#1b1b1c"
}, },
"features": { "features": {
"bot_user": { "bot_user": {
"display_name": "Command Notify" "display_name": "Command Notify"
} }
}, },
"oauth_config": { "oauth_config": {
"redirect_urls": [ "redirect_urls": [
"https://<your coder deployment>/external-auth/slack/callback" "https://<your coder deployment>/external-auth/slack/callback"
], ],
"scopes": { "scopes": {
"bot": ["chat:write"] "bot": ["chat:write"]
} }
} }
} }
``` ```
2. In the "Basic Information" tab on the left after creating your app, scroll down to the "App Credentials" section. Set the following environment variables in your Coder deployment: 2. In the "Basic Information" tab on the left after creating your app, scroll down to the "App Credentials" section. Set the following environment variables in your Coder deployment:
```env ```env
CODER_EXTERNAL_AUTH_1_TYPE=slack CODER_EXTERNAL_AUTH_1_TYPE=slack
CODER_EXTERNAL_AUTH_1_SCOPES="chat:write" CODER_EXTERNAL_AUTH_1_SCOPES="chat:write"
CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="Slack Me" CODER_EXTERNAL_AUTH_1_DISPLAY_NAME="Slack Me"
CODER_EXTERNAL_AUTH_1_CLIENT_ID="<your client id> CODER_EXTERNAL_AUTH_1_CLIENT_ID="<your client id>
CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="<your client secret>" CODER_EXTERNAL_AUTH_1_CLIENT_SECRET="<your client secret>"
``` ```
3. Restart your Coder deployment. Any Template can now import the Slack Me module, and `slackme` will be available on the `$PATH`: 3. Restart your Coder deployment. Any Template can now import the Slack Me module, and `slackme` will be available on the `$PATH`:
```hcl ```hcl
module "slackme" { module "slackme" {
source = "https://registry.coder.com/modules/slackme" source = "registry.coder.com/modules/slackme"
agent_id = coder_agent.example.id version = "1.0.0"
auth_provider_id = "slack" agent_id = coder_agent.example.id
} auth_provider_id = "slack"
``` }
```
## Examples ## Examples
@ -71,7 +72,8 @@ $ slackme npm run long-build
```hcl ```hcl
module "slackme" { module "slackme" {
source = "https://registry.coder.com/modules/slackme" source = "registry.coder.com/modules/slackme"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
auth_provider_id = "slack" auth_provider_id = "slack"
slack_message = <<EOF slack_message = <<EOF

@ -13,9 +13,9 @@ This module lets you authenticate with [Hashicorp Vault](https://www.vaultprojec
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault-github" source = "https://registry.coder.com/modules/vault-github"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com" vault_addr = "https://vault.example.com"
} }
``` ```
@ -43,10 +43,10 @@ To configure the Vault module, you must set up a Vault GitHub auth method. See t
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "https://registry.coder.com/modules/vault"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com" vault_addr = "https://vault.example.com"
coder_github_auth_id = "my-github-auth-id" coder_github_auth_id = "my-github-auth-id"
} }
``` ```
@ -54,11 +54,11 @@ module "vault" {
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "https://registry.coder.com/modules/vault"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com" vault_addr = "https://vault.example.com"
coder_github_auth_id = "my-github-auth-id" coder_github_auth_id = "my-github-auth-id"
vault_github_auth_path = "my-github-auth-path" vault_github_auth_path = "my-github-auth-path"
} }
``` ```
@ -66,9 +66,9 @@ module "vault" {
```hcl ```hcl
module "vault" { module "vault" {
source = "https://registry.coder.com/modules/vault" source = "https://registry.coder.com/modules/vault"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
vault_addr = "https://vault.example.com" vault_addr = "https://vault.example.com"
vault_cli_version = "1.15.0" vault_cli_version = "1.15.0"
} }
``` ```

@ -15,7 +15,8 @@ Uses the [Coder Remote VS Code Extension](https://github.com/coder/vscode-coder)
```hcl ```hcl
module "vscode" { module "vscode" {
source = "https://registry.coder.com/modules/vscode-desktop" source = "registry.coder.com/modules/vscode-desktop"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
} }
``` ```
@ -26,7 +27,8 @@ module "vscode" {
```hcl ```hcl
module "vscode" { module "vscode" {
source = "https://registry.coder.com/modules/vscode-desktop" source = "registry.coder.com/modules/vscode-desktop"
version = "1.0.0"
agent_id = coder_agent.example.id agent_id = coder_agent.example.id
folder = "/home/coder/project" folder = "/home/coder/project"
} }

Loading…
Cancel
Save