diff --git a/docs/resources/agent.md b/docs/resources/agent.md index 8c3080d7..a064585c 100644 --- a/docs/resources/agent.md +++ b/docs/resources/agent.md @@ -47,7 +47,7 @@ resource "kubernetes_pod" "dev" { ### Optional - `auth` (String) The authentication type the agent will use. Must be one of: "token", "google-instance-identity", "aws-instance-identity", "azure-instance-identity". -- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. +- `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. A value of zero never marks the agent as timed out. - `dir` (String) The starting directory when a user creates a shell session. Defaults to $HOME. - `env` (Map of String) A mapping of environment variables to set inside the workspace. - `motd_file` (String) The path to a file within the workspace containing a message to display to users when they login via SSH. A typical value would be /etc/motd. diff --git a/provider/agent.go b/provider/agent.go index c9d7582c..0216d8dd 100644 --- a/provider/agent.go +++ b/provider/agent.go @@ -89,11 +89,12 @@ func agentResource() *schema.Resource { Computed: true, }, "connection_timeout": { - Type: schema.TypeInt, - Default: 120, - ForceNew: true, - Optional: true, - Description: "Time in seconds until the agent is marked as timed out when a connection with the server cannot be established.", + Type: schema.TypeInt, + Default: 120, + ForceNew: true, + Optional: true, + Description: "Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. A value of zero never marks the agent as timed out.", + ValidateFunc: validation.IntAtLeast(0), }, "troubleshooting_url": { Type: schema.TypeString,