diff --git a/docs/resources/agent.md b/docs/resources/agent.md index 1cb9c605..966008cb 100644 --- a/docs/resources/agent.md +++ b/docs/resources/agent.md @@ -50,6 +50,7 @@ resource "kubernetes_pod" "dev" { - `connection_timeout` (Number) Time in seconds until the agent is marked as timed out when a connection with the server cannot be established. - `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. - `startup_script` (String) A script to run after the agent starts. - `troubleshooting_url` (String) A URL to a document with instructions for troubleshooting problems with the agent. diff --git a/provider/agent.go b/provider/agent.go index 5bf4588b..09a68ddf 100644 --- a/provider/agent.go +++ b/provider/agent.go @@ -101,6 +101,12 @@ func agentResource() *schema.Resource { Optional: true, Description: "A URL to a document with instructions for troubleshooting problems with the agent.", }, + "motd_file": { + Type: schema.TypeString, + ForceNew: true, + Optional: true, + Description: "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_test.go b/provider/agent_test.go index 88075462..d0853066 100644 --- a/provider/agent_test.go +++ b/provider/agent_test.go @@ -32,6 +32,7 @@ func TestAgent(t *testing.T) { } startup_script = "echo test" troubleshooting_url = "https://example.com/troubleshoot" + motd_file = "/etc/motd" } `, Check: func(state *terraform.State) error { @@ -49,6 +50,7 @@ func TestAgent(t *testing.T) { "startup_script", "connection_timeout", "troubleshooting_url", + "motd_file", } { value := resource.Primary.Attributes[key] t.Logf("%q = %q", key, value)