Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b20adf0

Browse files
mafredriDanielleMaywood
authored andcommitted
feat: Add connection_timeout and troubleshooting_url to agent (#71)
Related: coder/coder#4678
1 parent 16cd1b4 commit b20adf0

File tree

3 files changed

+18
-0
lines changed

3 files changed

+18
-0
lines changed

docs/resources/agent.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ resource "kubernetes_pod" "dev" {
4747
### Optional
4848

4949
- `auth` (String) The authentication type the agent will use. Must be one of: "token", "google-instance-identity", "aws-instance-identity", "azure-instance-identity".
50+
- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.
5051
- `dir` (String) The starting directory when a user creates a shell session. Defaults to $HOME.
5152
- `env` (Map of String) A mapping of environment variables to set inside the workspace.
5253
- `startup_script` (String) A script to run after the agent starts.
54+
- `troubleshooting_url` (String) A URL to a document with instructions for troubleshooting problems with the agent.
5355

5456
### Read-Only
5557

provider/agent.go

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,19 @@ func agentResource() *schema.Resource {
8888
Type: schema.TypeString,
8989
Computed: true,
9090
},
91+
"connection_timeout": {
92+
Type: schema.TypeInt,
93+
Default: 120,
94+
ForceNew: true,
95+
Optional: true,
96+
Description: "Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.",
97+
},
98+
"troubleshooting_url": {
99+
Type: schema.TypeString,
100+
ForceNew: true,
101+
Optional: true,
102+
Description: "A URL to a document with instructions for troubleshooting problems with the agent.",
103+
},
91104
},
92105
}
93106
}

provider/agent_test.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ func TestAgent(t *testing.T) {
3131
hi = "test"
3232
}
3333
startup_script = "echo test"
34+
troubleshooting_url = "https://example.com/troubleshoot"
3435
}
3536
`,
3637
Check: func(state *terraform.State) error {
@@ -46,6 +47,8 @@ func TestAgent(t *testing.T) {
4647
"dir",
4748
"env.hi",
4849
"startup_script",
50+
"connection_timeout",
51+
"troubleshooting_url",
4952
} {
5053
value := resource.Primary.Attributes[key]
5154
t.Logf("%q = %q", key, value)

0 commit comments

Comments
 (0)