Skip to content

Commit 3eec79a

Browse files
committed
applied Atif's suggestions
1 parent 56b222f commit 3eec79a

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

docs/faqs.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,13 +409,13 @@ enter the docker socket as a Terraform variable.
409409
An example use case is the user should decide if they want a browser-based IDE
410410
like code-server when creating the workspace.
411411

412-
1. Create a `coder_parameter` as a `bool` to ask the user if they want the
412+
1. Add a `coder_parameter` with type `bool` to ask the user if they want the
413413
code-server IDE
414414

415415
```hcl
416416
data "coder_parameter" "code_server" {
417-
name = "code-server (optional)"
418-
description = "Use VS Code in a browser"
417+
name = "Do you want code-server in your workspace?"
418+
description = "Use VS Code in a browser."
419419
type = "bool"
420420
default = false
421421
mutable = true
@@ -425,10 +425,10 @@ data "coder_parameter" "code_server" {
425425
```
426426

427427
2. Add conditional logic to the `startup_script` to install and start
428-
code-server if the `bool` is true
428+
code-server depending on the value of the added `coder_parameter`
429429

430430
```sh
431-
# install and code-server, VS Code in a browser
431+
# install and start code-server, VS Code in a browser
432432
433433
if [ ${data.coder_parameter.code_server.value} = true ]; then
434434
echo "🧑🏼‍💻 Downloading and installing the latest code-server IDE..."
@@ -437,13 +437,15 @@ if [ ${data.coder_parameter.code_server.value} = true ]; then
437437
fi
438438
```
439439

440-
3. Add a Terraform meta-argument `count` in the `coder_app` resource so it will
441-
only create the resource if the `coder_parameter` is true
440+
3. Add a Terraform meta-argument
441+
[`count`](https://developer.hashicorp.com/terraform/language/meta-arguments/count)
442+
in the `coder_app` resource so it will only create the resource if the
443+
`coder_parameter` is `true`
442444

443445
```hcl
444446
# code-server
445447
resource "coder_app" "code-server" {
446-
count = data.coder_parameter.code_server.value ? 1 : 0
448+
count = data.coder_parameter.code_server.value ? 1 : 0
447449
agent_id = coder_agent.coder.id
448450
slug = "code-server"
449451
display_name = "code-server"

0 commit comments

Comments
 (0)