File tree Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Expand file tree Collapse file tree 3 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -77,5 +77,6 @@ Required:
7777Optional:
7878
7979- ` display_name ` (String) The user-facing name of this value.
80+ - ` timeout ` (Number) The maximum time the command is allowed to run in seconds.
8081
8182
Original file line number Diff line number Diff line change @@ -165,6 +165,12 @@ func agentResource() *schema.Resource {
165165 Type : schema .TypeString ,
166166 },
167167 },
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+ },
168174 "interval" : {
169175 Type : schema .TypeInt ,
170176 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) {
132132 display_name = "Process Count"
133133 cmd = ["sh", "-c", "ps aux | wc -l"]
134134 interval = 5
135+ timeout = 1
135136 }
136137 }
137138 ` ,
@@ -153,6 +154,7 @@ func TestAgent_Metadata(t *testing.T) {
153154 require .Equal (t , "-c" , attr ["metadata.0.cmd.1" ])
154155 require .Equal (t , "ps aux | wc -l" , attr ["metadata.0.cmd.2" ])
155156 require .Equal (t , "5" , attr ["metadata.0.interval" ])
157+ require .Equal (t , "1" , attr ["metadata.0.timeout" ])
156158 return nil
157159 },
158160 }},
You can’t perform that action at this time.
0 commit comments