Skip to content

feat: Add support for shutdown_script #5171

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
WIP
  • Loading branch information
mtojek committed Nov 24, 2022
commit 153ac9e971ee1ba173b6cb0718f1ea6214bb652a
2 changes: 2 additions & 0 deletions provisioner/terraform/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ type agentAttributes struct {
StartupScript string `mapstructure:"startup_script"`
ConnectionTimeoutSeconds int32 `mapstructure:"connection_timeout"`
TroubleshootingURL string `mapstructure:"troubleshooting_url"`
ShutdownScript string `mapstructure:"shutdown_script"`
}

// A mapping of attributes on the "coder_app" resource.
Expand Down Expand Up @@ -130,6 +131,7 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
Directory: attrs.Directory,
ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds,
TroubleshootingUrl: attrs.TroubleshootingURL,
ShutdownScript: attrs.ShutdownScript,
}
switch attrs.Auth {
case "token":
Expand Down
1 change: 1 addition & 0 deletions provisioner/terraform/resources_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ func TestConvertResources(t *testing.T) {
Architecture: "amd64",
Auth: &proto.Agent_Token{},
ConnectionTimeoutSeconds: 1,
ShutdownScript: "echo bye bye",
}, {
Name: "dev3",
OperatingSystem: "windows",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ terraform {
required_providers {
coder = {
source = "coder/coder"
version = "0.6.1"
version = "0.6.5"
}
}
}
Expand All @@ -16,6 +16,7 @@ resource "coder_agent" "dev2" {
os = "darwin"
arch = "amd64"
connection_timeout = 1
shutdown_script = "echo bye bye"
}

resource "coder_agent" "dev3" {
Expand Down
1 change: 1 addition & 0 deletions provisionersdk/proto/provisioner.proto
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ message Agent {
}
int32 connection_timeout_seconds = 11;
string troubleshooting_url = 12;
string shutdown_script = 13;
}

enum AppSharingLevel {
Expand Down