File tree 3 files changed +9
-0
lines changed
3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -77,5 +77,6 @@ Required:
77
77
Optional:
78
78
79
79
- ` display_name ` (String) The user-facing name of this value.
80
+ - ` timeout ` (Number) The maximum time the command is allowed to run in seconds.
80
81
81
82
Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ func agentResource() *schema.Resource {
165
165
Type : schema .TypeString ,
166
166
},
167
167
},
168
+ "timeout" : {
169
+ Type : schema .TypeInt ,
170
+ Description : "The maximum time the command is allowed to run in seconds." ,
171
+ ForceNew : true ,
172
+ Optional : true ,
173
+ },
168
174
"interval" : {
169
175
Type : schema .TypeInt ,
170
176
Description : "The interval in seconds at which to refresh this metadata item. " ,
Original file line number Diff line number Diff line change @@ -132,6 +132,7 @@ func TestAgent_Metadata(t *testing.T) {
132
132
display_name = "Process Count"
133
133
cmd = ["sh", "-c", "ps aux | wc -l"]
134
134
interval = 5
135
+ timeout = 1
135
136
}
136
137
}
137
138
` ,
@@ -153,6 +154,7 @@ func TestAgent_Metadata(t *testing.T) {
153
154
require .Equal (t , "-c" , attr ["metadata.0.cmd.1" ])
154
155
require .Equal (t , "ps aux | wc -l" , attr ["metadata.0.cmd.2" ])
155
156
require .Equal (t , "5" , attr ["metadata.0.interval" ])
157
+ require .Equal (t , "1" , attr ["metadata.0.timeout" ])
156
158
return nil
157
159
},
158
160
}},
You can’t perform that action at this time.
0 commit comments