diff --git a/.sample/README.md b/.sample/README.md index f50a101..c842c67 100644 --- a/.sample/README.md +++ b/.sample/README.md @@ -11,7 +11,7 @@ tags: [helper] -```hcl +```tf module "MODULE_NAME" { source = "registry.coder.com/modules/MODULE_NAME/coder" version = "1.0.0" @@ -26,7 +26,7 @@ module "MODULE_NAME" { Install the Dracula theme from [OpenVSX](https://open-vsx.org/): -```hcl +```tf module "MODULE_NAME" { source = "registry.coder.com/modules/MODULE_NAME/coder" version = "1.0.0" @@ -43,7 +43,7 @@ Enter the `.` into the extensions array and code-server will autom Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) file: -```hcl +```tf module "MODULE_NAME" { source = "registry.coder.com/modules/MODULE_NAME/coder" version = "1.0.0" @@ -59,7 +59,7 @@ module "MODULE_NAME" { Run code-server in the background, don't fetch it from GitHub: -```hcl +```tf module "MODULE_NAME" { source = "registry.coder.com/modules/MODULE_NAME/coder" version = "1.0.0" diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b45c1f3..cebf71f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,7 +19,7 @@ $ bun test -t '' You can test a module locally by updating the source as follows -```hcl +```tf module "example" { source = "git::https://github.com//.git//?ref=" } diff --git a/README.md b/README.md index 522477b..9cf14e8 100644 --- a/README.md +++ b/README.md @@ -14,10 +14,10 @@ Modules extend Templates to create reusable components for your development envi e.g. -```hcl +```tf module "code-server" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" agent_id = coder_agent.main.id } ``` diff --git a/aws-region/README.md b/aws-region/README.md index 824d7d9..01a32fa 100644 --- a/aws-region/README.md +++ b/aws-region/README.md @@ -14,9 +14,9 @@ the region closest to them. Customize the preselected parameter value: -```hcl +```tf module "aws-region" { - source = "registry.coder.com/modules/aws-region/coder" + source = "registry.coder.com/modules/aws-region/coder" version = "1.0.0" default = "us-east-1" } @@ -34,16 +34,16 @@ provider "aws" { Change the display name and icon for a region using the corresponding maps: -```hcl +```tf module "aws-region" { - source = "registry.coder.com/modules/aws-region/coder" + source = "registry.coder.com/modules/aws-region/coder" version = "1.0.0" default = "ap-south-1" custom_names = { - "ap-south-1": "Awesome Mumbai!" + "ap-south-1" : "Awesome Mumbai!" } custom_icons = { - "ap-south-1": "/emojis/1f33a.png" + "ap-south-1" : "/emojis/1f33a.png" } } @@ -58,11 +58,11 @@ provider "aws" { Hide the Asia Pacific regions Seoul and Osaka: -```hcl +```tf module "aws-region" { - source = "registry.coder.com/modules/aws-region/coder" + source = "registry.coder.com/modules/aws-region/coder" version = "1.0.0" - exclude = [ "ap-northeast-2", "ap-northeast-3" ] + exclude = ["ap-northeast-2", "ap-northeast-3"] } provider "aws" { diff --git a/azure-region/README.md b/azure-region/README.md index b22dedf..1f20cee 100644 --- a/azure-region/README.md +++ b/azure-region/README.md @@ -11,9 +11,9 @@ tags: [helper, parameter, azure, regions] This module adds a parameter with all Azure regions, allowing developers to select the region closest to them. -```hcl +```tf module "azure_region" { - source = "registry.coder.com/modules/azure-region/coder" + source = "registry.coder.com/modules/azure-region/coder" version = "1.0.0" default = "eastus" } @@ -31,15 +31,15 @@ resource "azurem_resource_group" "example" { Change the display name and icon for a region using the corresponding maps: -```hcl +```tf module "azure-region" { - source = "registry.coder.com/modules/azure-region/coder" + source = "registry.coder.com/modules/azure-region/coder" version = "1.0.0" custom_names = { - "australia": "Go Australia!" + "australia" : "Go Australia!" } custom_icons = { - "australia": "/icons/smiley.svg" + "australia" : "/icons/smiley.svg" } } @@ -54,9 +54,9 @@ resource "azurerm_resource_group" "example" { Hide all regions in Australia except australiacentral: -```hcl +```tf module "azure-region" { - source = "registry.coder.com/modules/azure-region/coder" + source = "registry.coder.com/modules/azure-region/coder" version = "1.0.0" exclude = [ "australia", diff --git a/code-server/README.md b/code-server/README.md index 9bc0417..52c031b 100644 --- a/code-server/README.md +++ b/code-server/README.md @@ -11,10 +11,10 @@ tags: [helper, ide, web] Automatically install [code-server](https://github.com/coder/code-server) in a workspace, create an app to access it via the dashboard, install extensions, and pre-configure editor settings. -```hcl +```tf module "code-server" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` @@ -25,7 +25,7 @@ module "code-server" { ### Pin Versions -```hcl +```tf module "code-server" { source = "registry.coder.com/modules/code-server/coder" version = "1.0.0" @@ -38,10 +38,10 @@ module "code-server" { Install the Dracula theme from [OpenVSX](https://open-vsx.org/): -```hcl +```tf module "code-server" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" agent_id = coder_agent.example.id extensions = [ "dracula-theme.theme-dracula" @@ -55,12 +55,12 @@ Enter the `.` into the extensions array and code-server will autom Configure VS Code's [settings.json](https://code.visualstudio.com/docs/getstarted/settings#_settingsjson) file: -```hcl +```tf module "settings" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - extensions = [ "dracula-theme.theme-dracula" ] + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + extensions = ["dracula-theme.theme-dracula"] settings = { "workbench.colorTheme" = "Dracula" } @@ -71,12 +71,12 @@ module "settings" { Just run code-server in the background, don't fetch it from GitHub: -```hcl +```tf module "settings" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - extensions = [ "dracula-theme.theme-dracula", "ms-azuretools.vscode-docker" ] + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + extensions = ["dracula-theme.theme-dracula", "ms-azuretools.vscode-docker"] } ``` @@ -84,11 +84,11 @@ module "settings" { Just run code-server in the background, don't fetch it from GitHub: -```hcl +```tf module "settings" { - source = "registry.coder.com/modules/code-server/coder" - version = "1.0.0" + source = "registry.coder.com/modules/code-server/coder" + version = "1.0.0" agent_id = coder_agent.example.id - offline = true + offline = true } ``` diff --git a/coder-login/README.md b/coder-login/README.md index 0c5f8d9..d12a41d 100644 --- a/coder-login/README.md +++ b/coder-login/README.md @@ -11,7 +11,7 @@ tags: [helper] Automatically logs the user into Coder when creating their workspace. -```hcl +```tf module "coder-login" { source = "registry.coder.com/modules/coder-login/coder" version = "1.0.0" diff --git a/dotfiles/README.md b/dotfiles/README.md index 1383c09..9ffac02 100644 --- a/dotfiles/README.md +++ b/dotfiles/README.md @@ -11,10 +11,10 @@ tags: [helper] Allow developers to optionally bring their own [dotfiles repository](https://dotfiles.github.io)! Under the hood, this module uses the [coder dotfiles](https://coder.com/docs/v2/latest/dotfiles) command. -```hcl +```tf module "dotfiles" { - source = "registry.coder.com/modules/dotfiles/coder" - version = "1.0.0" + source = "registry.coder.com/modules/dotfiles/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` diff --git a/exoscale-instance-type/README.md b/exoscale-instance-type/README.md index 4868c9f..28946a9 100644 --- a/exoscale-instance-type/README.md +++ b/exoscale-instance-type/README.md @@ -14,16 +14,16 @@ their desired virtuell machine for the workspace. Customize the preselected parameter value: -```hcl +```tf module "exoscale-instance-type" { - source = "registry.coder.com/modules/exoscale-instance-type/coder" + source = "registry.coder.com/modules/exoscale-instance-type/coder" version = "1.0.0" default = "standard.medium" } resource "exoscale_compute_instance" "instance" { - type = module.exoscale-instance-type.value - ... + type = module.exoscale-instance-type.value + # ... } resource "coder_metadata" "workspace_info" { @@ -42,22 +42,22 @@ resource "coder_metadata" "workspace_info" { Change the display name a type using the corresponding maps: -```hcl +```tf module "exoscale-instance-type" { - source = "registry.coder.com/modules/exoscale-instance-type/coder" + source = "registry.coder.com/modules/exoscale-instance-type/coder" version = "1.0.0" default = "standard.medium" custom_names = { - "standard.medium": "Mittlere Instanz" # German translation + "standard.medium" : "Mittlere Instanz" # German translation } custom_descriptions = { - "standard.medium": "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation + "standard.medium" : "4 GB Arbeitsspeicher, 2 Kerne, 10 - 400 GB Festplatte" # German translation } } resource "exoscale_compute_instance" "instance" { - type = module.exoscale-instance-type.value - ... + type = module.exoscale-instance-type.value + # ... } resource "coder_metadata" "workspace_info" { @@ -74,13 +74,13 @@ resource "coder_metadata" "workspace_info" { Show only gpu1 types -```hcl +```tf module "exoscale-instance-type" { source = "registry.coder.com/modules/exoscale-instance-type/coder" version = "1.0.0" default = "gpu.large" type_category = ["gpu"] - exclude = [ + exclude = [ "gpu2.small", "gpu2.medium", "gpu2.large", @@ -93,8 +93,8 @@ module "exoscale-instance-type" { } resource "exoscale_compute_instance" "instance" { - type = module.exoscale-instance-type.value - ... + type = module.exoscale-instance-type.value + # ... } resource "coder_metadata" "workspace_info" { diff --git a/exoscale-zone/README.md b/exoscale-zone/README.md index 360c54b..b56a858 100644 --- a/exoscale-zone/README.md +++ b/exoscale-zone/README.md @@ -14,9 +14,9 @@ the zone closest to them. Customize the preselected parameter value: -```hcl +```tf module "exoscale-zone" { - source = "registry.coder.com/modules/exoscale-zone/coder" + source = "registry.coder.com/modules/exoscale-zone/coder" version = "1.0.0" default = "ch-dk-2" } @@ -28,8 +28,8 @@ data "exoscale_compute_template" "my_template" { } resource "exoscale_compute_instance" "instance" { - zone = module.exoscale-zone.value - .... + zone = module.exoscale-zone.value + # ... } ``` @@ -41,16 +41,16 @@ resource "exoscale_compute_instance" "instance" { Change the display name and icon for a zone using the corresponding maps: -```hcl +```tf module "exoscale-zone" { - source = "registry.coder.com/modules/exoscale-zone/coder" + source = "registry.coder.com/modules/exoscale-zone/coder" version = "1.0.0" default = "at-vie-1" custom_names = { - "at-vie-1": "Home Vienna" + "at-vie-1" : "Home Vienna" } custom_icons = { - "at-vie-1": "/emojis/1f3e0.png" + "at-vie-1" : "/emojis/1f3e0.png" } } @@ -60,8 +60,8 @@ data "exoscale_compute_template" "my_template" { } resource "exoscale_compute_instance" "instance" { - zone = module.exoscale-zone.value - .... + zone = module.exoscale-zone.value + # ... } ``` @@ -71,11 +71,11 @@ resource "exoscale_compute_instance" "instance" { Hide the Switzerland zones Geneva and Zurich -```hcl +```tf module "exoscale-zone" { - source = "registry.coder.com/modules/exoscale-zone/coder" + source = "registry.coder.com/modules/exoscale-zone/coder" version = "1.0.0" - exclude = [ "ch-gva-2", "ch-dk-2" ] + exclude = ["ch-gva-2", "ch-dk-2"] } data "exoscale_compute_template" "my_template" { @@ -84,8 +84,8 @@ data "exoscale_compute_template" "my_template" { } resource "exoscale_compute_instance" "instance" { - zone = module.exoscale-zone.value - .... + zone = module.exoscale-zone.value + # ... } ``` diff --git a/filebrowser/README.md b/filebrowser/README.md index bde76f6..6dcefb5 100644 --- a/filebrowser/README.md +++ b/filebrowser/README.md @@ -11,10 +11,10 @@ tags: [helper, filebrowser] A file browser for your workspace. -```hcl +```tf module "filebrowser" { - source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.0" + source = "registry.coder.com/modules/filebrowser/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` @@ -25,22 +25,22 @@ module "filebrowser" { ### Serve a specific directory -```hcl +```tf module "filebrowser" { - source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.0" + source = "registry.coder.com/modules/filebrowser/coder" + version = "1.0.0" agent_id = coder_agent.example.id - folder = "/home/coder/project" + folder = "/home/coder/project" } ``` ### Specify location of `filebrowser.db` -```hcl +```tf module "filebrowser" { - source = "registry.coder.com/modules/filebrowser/coder" - version = "1.0.0" - agent_id = coder_agent.example.id + source = "registry.coder.com/modules/filebrowser/coder" + version = "1.0.0" + agent_id = coder_agent.example.id database_path = ".config/filebrowser.db" } ``` diff --git a/fly-region/README.md b/fly-region/README.md index 7e5040f..5fec1a3 100644 --- a/fly-region/README.md +++ b/fly-region/README.md @@ -13,9 +13,9 @@ This module adds Fly.io regions to your Coder template. Regions can be whitelist We can use the simplest format here, only adding a default selection as the `atl` region. -```hcl +```tf module "fly-region" { - source = "registry.coder.com/modules/fly-region/coder" + source = "registry.coder.com/modules/fly-region/coder" version = "1.0.0" default = "atl" } @@ -29,9 +29,9 @@ module "fly-region" { The regions argument can be used to display only the desired regions in the Coder parameter. -```hcl +```tf module "fly-region" { - source = "registry.coder.com/modules/fly-region/coder" + source = "registry.coder.com/modules/fly-region/coder" version = "1.0.0" default = "ams" regions = ["ams", "arn", "atl"] @@ -44,16 +44,16 @@ module "fly-region" { Set custom icons and names with their respective maps. -```hcl +```tf module "fly-region" { - source = "registry.coder.com/modules/fly-region/coder" + source = "registry.coder.com/modules/fly-region/coder" version = "1.0.0" default = "ams" custom_icons = { - "ams" = "/emojis/1f90e.png" + "ams" = "/emojis/1f90e.png" } custom_names = { - "ams" = "We love the Netherlands!" + "ams" = "We love the Netherlands!" } } ``` diff --git a/gcp-region/README.md b/gcp-region/README.md index a78ed41..e860ed9 100644 --- a/gcp-region/README.md +++ b/gcp-region/README.md @@ -11,7 +11,7 @@ tags: [gcp, regions, parameter, helper] This module adds Google Cloud Platform regions to your Coder template. -```hcl +```tf module "gcp_region" { source = "registry.coder.com/modules/gcp-region/coder" version = "1.0.0" @@ -31,7 +31,7 @@ resource "google_compute_instance" "example" { Note: setting `gpu_only = true` and using a default region without GPU support, the default will be set to `null`. -```hcl +```tf module "gcp_region" { source = "registry.coder.com/modules/gcp-region/coder" version = "1.0.0" @@ -47,7 +47,7 @@ resource "google_compute_instance" "example" { ### Add all zones in the Europe West region -```hcl +```tf module "gcp_region" { source = "registry.coder.com/modules/gcp-region/coder" version = "1.0.0" @@ -62,7 +62,7 @@ resource "google_compute_instance" "example" { ### Add a single zone from each region in US and Europe that laos has GPUs -```hcl +```tf module "gcp_region" { source = "registry.coder.com/modules/gcp-region/coder" version = "1.0.0" diff --git a/git-clone/README.md b/git-clone/README.md index 817a22c..a0e8e46 100644 --- a/git-clone/README.md +++ b/git-clone/README.md @@ -11,7 +11,7 @@ tags: [git, helper] This module allows you to automatically clone a repository by URL and skip if it exists in the base directory provided. -```hcl +```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" version = "1.0.0" @@ -22,7 +22,7 @@ module "git-clone" { To use with [Git Authentication](https://coder.com/docs/v2/latest/admin/git-providers), add the provider by ID to your template: -```hcl +```tf data "coder_git_auth" "github" { id = "github" } @@ -32,7 +32,7 @@ data "coder_git_auth" "github" { ### Custom Path -```hcl +```tf module "git-clone" { source = "registry.coder.com/modules/git-clone/coder" version = "1.0.0" diff --git a/git-commit-signing/README.md b/git-commit-signing/README.md index c13e1f8..05759d1 100644 --- a/git-commit-signing/README.md +++ b/git-commit-signing/README.md @@ -16,10 +16,10 @@ Please observe that using the SSH key that's part of your Coder account for comm This module has a chance of conflicting with the user's dotfiles / the personalize module if one of those has configuration directives that overwrite this module's / each other's git configuration. -```hcl +```tf module "git-commit-signing" { - source = "registry.coder.com/modules/git-commit-signing/coder" - version = "1.0.0" + source = "registry.coder.com/modules/git-commit-signing/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` diff --git a/git-config/README.md b/git-config/README.md index 6c9d696..71f09fa 100644 --- a/git-config/README.md +++ b/git-config/README.md @@ -11,10 +11,10 @@ tags: [helper, git] Runs a script that updates git credentials in the workspace to match the user's Coder credentials, optionally allowing to the developer to override the defaults. -```hcl +```tf module "git-config" { - source = "registry.coder.com/modules/git-config/coder" - version = "1.0.0" + source = "registry.coder.com/modules/git-config/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` @@ -25,11 +25,11 @@ TODO: Add screenshot ### Allow users to override both username and email -```hcl +```tf module "git-config" { - source = "registry.coder.com/modules/git-config/coder" - version = "1.0.0" - agent_id = coder_agent.example.id + source = "registry.coder.com/modules/git-config/coder" + version = "1.0.0" + agent_id = coder_agent.example.id allow_email_change = true } ``` @@ -38,13 +38,13 @@ TODO: Add screenshot ## Disallowing users from overriding both username and email -```hcl +```tf module "git-config" { - source = "registry.coder.com/modules/git-config/coder" - version = "1.0.0" - agent_id = coder_agent.example.id + source = "registry.coder.com/modules/git-config/coder" + version = "1.0.0" + agent_id = coder_agent.example.id allow_username_change = false - allow_email_change = false + allow_email_change = false } ``` diff --git a/jetbrains-gateway/README.md b/jetbrains-gateway/README.md index c6c473d..6e8031a 100644 --- a/jetbrains-gateway/README.md +++ b/jetbrains-gateway/README.md @@ -11,7 +11,7 @@ tags: [ide, jetbrains, helper, parameter] This module adds a JetBrains Gateway Button to open any workspace with a single click. -```hcl +```tf module "jetbrains_gateway" { source = "registry.coder.com/modules/jetbrains-gateway/coder" version = "1.0.0" @@ -28,14 +28,14 @@ module "jetbrains_gateway" { ### Add GoLand and WebStorm with the default set to GoLand -```hcl +```tf module "jetbrains_gateway" { - source = "registry.coder.com/modules/jetbrains-gateway/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - folder = "/home/coder/example" - jetbrains_ides = ["GO", "WS"] - default = "GO" + source = "registry.coder.com/modules/jetbrains-gateway/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + folder = "/home/coder/example" + jetbrains_ides = ["GO", "WS"] + default = "GO" } ``` diff --git a/jfrog-oauth/README.md b/jfrog-oauth/README.md index 3231e2e..d2fcde6 100644 --- a/jfrog-oauth/README.md +++ b/jfrog-oauth/README.md @@ -14,17 +14,17 @@ Install the JF CLI and authenticate package managers with Artifactory using OAut ![JFrog OAuth](../.images/jfrog-oauth.png) -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-oauth/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://example.jfrog.io" + source = "registry.coder.com/modules/jfrog-oauth/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://example.jfrog.io" username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" + "npm" : "npm", + "go" : "go", + "pypi" : "pypi" } } ``` @@ -40,15 +40,15 @@ This module is usable by JFrog self-hosted (on-premises) Artifactory as it requi Configure the Python pip package manager to fetch packages from Artifactory while mapping the Coder email to the Artifactory username. -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-oauth/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://example.jfrog.io" + source = "registry.coder.com/modules/jfrog-oauth/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://example.jfrog.io" username_field = "email" package_managers = { - "pypi": "pypi" + "pypi" : "pypi" } } ``` @@ -67,18 +67,18 @@ pip install requests The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extension) for VS Code allows you to interact with Artifactory from within the IDE. -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-oauth/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://example.jfrog.io" - username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" - configure_code_server = true # Add JFrog extension configuration for code-server + source = "registry.coder.com/modules/jfrog-oauth/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://example.jfrog.io" + username_field = "username" # If you are using GitHub to login to both Coder and Artifactory, use username_field = "username" + configure_code_server = true # Add JFrog extension configuration for code-server package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" + "npm" : "npm", + "go" : "go", + "pypi" : "pypi" } } ``` @@ -87,11 +87,11 @@ module "jfrog" { JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs). -```hcl +```tf provider "docker" { - ... + # ... registry_auth { - address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY" + address = "https://example.jfrog.io/artifactory/api/docker/REPO-KEY" username = module.jfrog.username password = module.jfrog.access_token } diff --git a/jfrog-token/README.md b/jfrog-token/README.md index 3ea0f9a..032e313 100644 --- a/jfrog-token/README.md +++ b/jfrog-token/README.md @@ -12,17 +12,17 @@ tags: [integration, jfrog] Install the JF CLI and authenticate package managers with Artifactory using Artifactory terraform provider. -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-token/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://XXXX.jfrog.io" + source = "registry.coder.com/modules/jfrog-token/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://XXXX.jfrog.io" artifactory_access_token = var.artifactory_access_token package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" + "npm" : "npm", + "go" : "go", + "pypi" : "pypi" } } ``` @@ -38,17 +38,17 @@ For detailed instructions, please see this [guide](https://coder.com/docs/v2/lat ### Configure npm, go, and pypi to use Artifactory local repositories -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-token/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://YYYY.jfrog.io" + source = "registry.coder.com/modules/jfrog-token/coder" + version = "1.0.0" + 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" + "npm" : "npm-local", + "go" : "go-local", + "pypi" : "pypi-local" } } ``` @@ -71,18 +71,18 @@ pip install requests The [JFrog extension](https://open-vsx.org/extension/JFrog/jfrog-vscode-extension) for VS Code allows you to interact with Artifactory from within the IDE. -```hcl +```tf module "jfrog" { - source = "registry.coder.com/modules/jfrog-token/coder" - version = "1.0.0" - agent_id = coder_agent.example.id - jfrog_url = "https://XXXX.jfrog.io" + source = "registry.coder.com/modules/jfrog-token/coder" + version = "1.0.0" + agent_id = coder_agent.example.id + jfrog_url = "https://XXXX.jfrog.io" artifactory_access_token = var.artifactory_access_token - configure_code_server = true # Add JFrog extension configuration for code-server + configure_code_server = true # Add JFrog extension configuration for code-server package_managers = { - "npm": "npm", - "go": "go", - "pypi": "pypi" + "npm" : "npm", + "go" : "go", + "pypi" : "pypi" } } ``` @@ -91,12 +91,12 @@ module "jfrog" { JFrog Access token is also available as a terraform output. You can use it in other terraform resources. For example, you can use it to configure an [Artifactory docker registry](https://jfrog.com/help/r/jfrog-artifactory-documentation/docker-registry) with the [docker terraform provider](https://registry.terraform.io/providers/kreuzwerker/docker/latest/docs). -```hcl +```tf provider "docker" { - ... + # ... registry_auth { - address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY" + address = "https://YYYY.jfrog.io/artifactory/api/docker/REPO-KEY" username = module.jfrog.username password = module.jfrog.access_token } diff --git a/jupyter-notebook/README.md b/jupyter-notebook/README.md index 69b6176..e25722a 100644 --- a/jupyter-notebook/README.md +++ b/jupyter-notebook/README.md @@ -13,10 +13,10 @@ A module that adds Jupyter Notebook in your Coder template. ![Jupyter Notebook](../.images/jupyter-notebook.png) -```hcl +```tf module "jupyter-notebook" { - source = "registry.coder.com/modules/jupyter-notebook/coder" - version = "1.0.0" + source = "registry.coder.com/modules/jupyter-notebook/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` diff --git a/jupyterlab/README.md b/jupyterlab/README.md index 8984da2..4ab7782 100644 --- a/jupyterlab/README.md +++ b/jupyterlab/README.md @@ -13,10 +13,10 @@ A module that adds JupyterLab in your Coder template. ![JupyterLab](../.images/jupyterlab.png) -```hcl +```tf module "jupyterlab" { - source = "registry.coder.com/modules/jupyterlab/coder" - version = "1.0.0" + source = "registry.coder.com/modules/jupyterlab/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` diff --git a/package.json b/package.json index d374122..3ccd906 100644 --- a/package.json +++ b/package.json @@ -2,17 +2,24 @@ "name": "modules", "scripts": { "test": "bun test", - "fmt": "bun x prettier --plugin prettier-plugin-sh -w **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf .sample/main.tf", - "fmt:ci": "bun x prettier --plugin prettier-plugin-sh --check **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf .sample/main.tf", + "fmt": "bun x prettier -w **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt **/*.tf .sample/main.tf", + "fmt:ci": "bun x prettier --check **/*.sh .sample/run.sh new.sh **/*.ts **/*.md *.md && terraform fmt -check **/*.tf .sample/main.tf", "lint": "bun run lint.ts" }, "devDependencies": { "bun-types": "^1.0.18", "gray-matter": "^4.0.3", "marked": "^11.1.0", - "prettier-plugin-sh": "^0.13.1" + "prettier-plugin-sh": "^0.13.1", + "prettier-plugin-terraform-formatter": "^1.2.1" }, "peerDependencies": { "typescript": "^5.3.3" + }, + "prettier": { + "plugins": [ + "prettier-plugin-sh", + "prettier-plugin-terraform-formatter" + ] } } diff --git a/personalize/README.md b/personalize/README.md index 4ddb036..c36467f 100644 --- a/personalize/README.md +++ b/personalize/README.md @@ -11,10 +11,10 @@ tags: [helper] Run a script on workspace start that allows developers to run custom commands to personalize their workspace. -```hcl +```tf module "personalize" { - source = "registry.coder.com/modules/personalize/coder" - version = "1.0.0" + source = "registry.coder.com/modules/personalize/coder" + version = "1.0.0" agent_id = coder_agent.example.id } ``` diff --git a/slackme/README.md b/slackme/README.md index 28b1f6a..a43033e 100644 --- a/slackme/README.md +++ b/slackme/README.md @@ -54,11 +54,11 @@ slackme npm run long-build 3. Restart your Coder deployment. Any Template can now import the Slack Me module, and `slackme` will be available on the `$PATH`: - ```hcl + ```tf module "slackme" { - source = "registry.coder.com/modules/slackme/coder" - version = "1.0.0" - agent_id = coder_agent.example.id + source = "registry.coder.com/modules/slackme/coder" + version = "1.0.0" + agent_id = coder_agent.example.id auth_provider_id = "slack" } ``` @@ -70,13 +70,13 @@ slackme npm run long-build - `$COMMAND` is replaced with the command the user executed. - `$DURATION` is replaced with a human-readable duration the command took to execute. -```hcl +```tf module "slackme" { - source = "registry.coder.com/modules/slackme/coder" - version = "1.0.0" - agent_id = coder_agent.example.id + source = "registry.coder.com/modules/slackme/coder" + version = "1.0.0" + agent_id = coder_agent.example.id auth_provider_id = "slack" - slack_message = <