Skip to content

Commit 34a1954

Browse files
mtojekmafredri
authored andcommitted
WIP
1 parent a56df46 commit 34a1954

File tree

5 files changed

+190
-175
lines changed

5 files changed

+190
-175
lines changed

provisioner/terraform/resources.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ type agentAttributes struct {
2929
MOTDFile string `mapstructure:"motd_file"`
3030
LoginBeforeReady bool `mapstructure:"login_before_ready"`
3131
StartupScriptTimeoutSeconds int32 `mapstructure:"startup_script_timeout"`
32+
ShutdownScript string `mapstructure:"shutdown_script"`
3233
}
3334

3435
// A mapping of attributes on the "coder_app" resource.
@@ -142,6 +143,7 @@ func ConvertResourcesAndParameters(modules []*tfjson.StateModule, rawGraph strin
142143
MotdFile: attrs.MOTDFile,
143144
LoginBeforeReady: loginBeforeReady,
144145
StartupScriptTimeoutSeconds: attrs.StartupScriptTimeoutSeconds,
146+
ShutdownScript: attrs.ShutdownScript,
145147
}
146148
switch attrs.Auth {
147149
case "token":

provisioner/terraform/resources_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ func TestConvertResources(t *testing.T) {
120120
MotdFile: "/etc/motd",
121121
LoginBeforeReady: true,
122122
StartupScriptTimeoutSeconds: 30,
123+
ShutdownScript: "echo bye bye",
123124
}, {
124125
Name: "dev3",
125126
OperatingSystem: "windows",

provisioner/terraform/testdata/multiple-agents/multiple-agents.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ resource "coder_agent" "dev2" {
1919
motd_file = "/etc/motd"
2020
startup_script_timeout = 30
2121
login_before_ready = true
22+
shutdown_script = "echo bye bye"
2223
}
2324

2425
resource "coder_agent" "dev3" {

0 commit comments

Comments
 (0)