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

Skip to content

Commit 7579146

Browse files
committed
Assign values from terraform resources
1 parent bbfd0bf commit 7579146

File tree

1 file changed

+19
-15
lines changed

1 file changed

+19
-15
lines changed

provisioner/terraform/resources.go

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@ import (
1414

1515
// A mapping of attributes on the "coder_agent" resource.
1616
type agentAttributes struct {
17-
Auth string `mapstructure:"auth"`
18-
OperatingSystem string `mapstructure:"os"`
19-
Architecture string `mapstructure:"arch"`
20-
Directory string `mapstructure:"dir"`
21-
ID string `mapstructure:"id"`
22-
Token string `mapstructure:"token"`
23-
Env map[string]string `mapstructure:"env"`
24-
StartupScript string `mapstructure:"startup_script"`
17+
Auth string `mapstructure:"auth"`
18+
OperatingSystem string `mapstructure:"os"`
19+
Architecture string `mapstructure:"arch"`
20+
Directory string `mapstructure:"dir"`
21+
ID string `mapstructure:"id"`
22+
Token string `mapstructure:"token"`
23+
Env map[string]string `mapstructure:"env"`
24+
StartupScript string `mapstructure:"startup_script"`
25+
ConnectionTimeoutSeconds int32 `mapstructure:"connection_timeout"`
26+
TroubleshootingURL string `mapstructure:"troubleshooting_url"`
2527
}
2628

2729
// A mapping of attributes on the "coder_app" resource.
@@ -118,13 +120,15 @@ func ConvertResources(module *tfjson.StateModule, rawGraph string) ([]*proto.Res
118120
return nil, xerrors.Errorf("decode agent attributes: %w", err)
119121
}
120122
agent := &proto.Agent{
121-
Name: tfResource.Name,
122-
Id: attrs.ID,
123-
Env: attrs.Env,
124-
StartupScript: attrs.StartupScript,
125-
OperatingSystem: attrs.OperatingSystem,
126-
Architecture: attrs.Architecture,
127-
Directory: attrs.Directory,
123+
Name: tfResource.Name,
124+
Id: attrs.ID,
125+
Env: attrs.Env,
126+
StartupScript: attrs.StartupScript,
127+
OperatingSystem: attrs.OperatingSystem,
128+
Architecture: attrs.Architecture,
129+
Directory: attrs.Directory,
130+
ConnectionTimeoutSeconds: attrs.ConnectionTimeoutSeconds,
131+
TroubleshootingUrl: attrs.TroubleshootingURL,
128132
}
129133
switch attrs.Auth {
130134
case "token":

0 commit comments

Comments
 (0)