Skip to content

Commit 031b5d0

Browse files
committed
added external auth link, make gen
1 parent a6be242 commit 031b5d0

File tree

4 files changed

+97
-6
lines changed

4 files changed

+97
-6
lines changed

docs/data-sources/external_auth.md

+16-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,28 @@
33
page_title: "coder_external_auth Data Source - terraform-provider-coder"
44
subcategory: ""
55
description: |-
6-
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services in a workspace. (e.g. gcloud, gh, docker, etc)
6+
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services https://coder.com/docs/admin/external-auth in a workspace. (e.g. Google Cloud, Github, Docker, etc.)
77
---
88

99
# coder_external_auth (Data Source)
1010

11-
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services in a workspace. (e.g. gcloud, gh, docker, etc)
11+
Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to [pre-authenticate external services](https://coder.com/docs/admin/external-auth) in a workspace. (e.g. Google Cloud, Github, Docker, etc.)
1212

13+
## Example Usage
1314

15+
```terraform
16+
provider "coder" {}
17+
18+
19+
data "coder_external_auth" "github" {
20+
id = "github"
21+
}
22+
23+
data "coder_external_auth" "azure-identity" {
24+
id = "azure-identiy"
25+
optional = true
26+
}
27+
```
1428

1529
<!-- schema generated by tfplugindocs -->
1630
## Schema

docs/resources/env.md

+23-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,29 @@ description: |-
1010

1111
Use this resource to set an environment variable in a workspace. Note that this resource cannot be used to overwrite existing environment variables set on the "coder_agent" resource.
1212

13-
13+
## Example Usage
14+
15+
```terraform
16+
data "coder_workspace" "me" {}
17+
18+
resource "coder_agent" "dev" {
19+
os = "linux"
20+
arch = "amd64"
21+
dir = "/workspace"
22+
}
23+
24+
resource "coder_env" "welcome_message" {
25+
agent_id = coder_agent.dev.id
26+
name = "WELCOME_MESSAGE"
27+
value = "Welcome to your Coder workspace!"
28+
}
29+
30+
resource "coder_env" "internal_api_url" {
31+
agent_id = coder_agent.dev.id
32+
name = "INTERNAL_API_URL"
33+
value = "https://api.internal.company.com/v1"
34+
}
35+
```
1436

1537
<!-- schema generated by tfplugindocs -->
1638
## Schema

docs/resources/script.md

+57-2
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,69 @@
33
page_title: "coder_script Resource - terraform-provider-coder"
44
subcategory: ""
55
description: |-
6-
Use this resource to run a script from an agent.
6+
Use this resource to run a script from an agent. When multiple scripts are assigned to the same agent, they are executed in parallel.
77
---
88

99
# coder_script (Resource)
1010

11-
Use this resource to run a script from an agent.
11+
Use this resource to run a script from an agent. When multiple scripts are assigned to the same agent, they are executed in parallel.
1212

13+
## Example Usage
1314

15+
```terraform
16+
data "coder_workspace" "me" {}
17+
18+
resource "coder_agent" "dev" {
19+
os = "linux"
20+
arch = "amd64"
21+
dir = "/workspace"
22+
}
23+
24+
resource "coder_script" "dotfiles" {
25+
agent_id = coder_agent.dev.agent_id
26+
display_name = "Dotfiles"
27+
icon = "/icon/dotfiles.svg"
28+
run_on_start = true
29+
script = templatefile("~/get_dotfiles.sh", {
30+
DOTFILES_URI : var.dotfiles_uri,
31+
DOTFILES_USER : var.dotfiles_user
32+
})
33+
}
34+
35+
resource "coder_script" "code-server" {
36+
agent_id = coder_agent.dev.agent_id
37+
display_name = "code-server"
38+
icon = "/icon/code.svg"
39+
run_on_start = true
40+
start_blocks_login = true
41+
script = templatefile("./install-code-server.sh", {
42+
LOG_PATH : "/tmp/code-server.log"
43+
})
44+
}
45+
46+
resource "coder_script" "nightly_sleep_reminder" {
47+
agent_id = coder_agent.dev.agent_id
48+
display_name = "Nightly update"
49+
icon = "/icon/database.svg"
50+
cron = "0 22 * * *"
51+
script = <<EOF
52+
#!/bin/sh
53+
echo "Running nightly update"
54+
sudo apt-get install
55+
EOF
56+
}
57+
58+
resource "coder_script" "shutdown" {
59+
agent_id = coder_agent.dev.id
60+
display_name = "Stop daemon server"
61+
run_on_stop = true
62+
icon = "/icons/memory.svg"
63+
script = <<EOF
64+
#!/bin/sh
65+
kill $(lsof -i :3002 -t) >/tmp/pid.log 2>&1 &
66+
EOF
67+
}
68+
```
1469

1570
<!-- schema generated by tfplugindocs -->
1671
## Schema

provider/externalauth.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ func externalAuthDataSource() *schema.Resource {
1515
return &schema.Resource{
1616
SchemaVersion: 1,
1717

18-
Description: "Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to pre-authenticate external services in a workspace. (e.g. gcloud, gh, docker, etc)",
18+
Description: "Use this data source to require users to authenticate with an external service prior to workspace creation. This can be used to [pre-authenticate external services](https://coder.com/docs/admin/external-auth) in a workspace. (e.g. Google Cloud, Github, Docker, etc.)",
1919
ReadContext: func(ctx context.Context, rd *schema.ResourceData, i interface{}) diag.Diagnostics {
2020
id, ok := rd.Get("id").(string)
2121
if !ok || id == "" {

0 commit comments

Comments
 (0)