You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add inactivity_timeout support to Fleet agent policy resource with duration string type and version validation (#1285)
* Initial plan
* Add inactivity_timeout support to Fleet agent policy resource
Co-authored-by: tobio <[email protected]>
* Update changelog and generate documentation for inactivity_timeout feature
Co-authored-by: tobio <[email protected]>
* Add version check for inactivity_timeout field in Fleet agent policy
- Added MinVersionInactivityTimeout constant for 8.7.0
- Added SupportsInactivityTimeout field to features struct
- Updated buildFeatures to check for inactivity timeout support
- Added version validation in toAPICreateModel and toAPIUpdateModel
- Updated test to use proper version check for inactivity_timeout
Co-authored-by: tobio <[email protected]>
* Add comprehensive tests for inactivity_timeout version validation
- Added unit tests to verify MinVersionInactivityTimeout constant
- Added comprehensive validation tests for version checking logic
- Verified version validation works for both create and update operations
- Ensured null/unset inactivity_timeout values don't trigger validation errors
Co-authored-by: tobio <[email protected]>
* Fix inactivity_timeout and supports_agentless field handling in Fleet agent policy
Co-authored-by: tobio <[email protected]>
* Convert inactivity_timeout to string duration type with seconds conversion
Co-authored-by: tobio <[email protected]>
* Update documentation for inactivity_timeout duration string support
Co-authored-by: tobio <[email protected]>
* Apply code review suggestions: improve duration conversion and simplify test helpers
Co-authored-by: tobio <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: tobio <[email protected]>
Copy file name to clipboardExpand all lines: CHANGELOG.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,6 +12,7 @@
12
12
- Support setting an explit `connector_id` in `elasticstack_kibana_action_connector`. This attribute already existed, but was being ignored by the provider. Setting the attribute will return an error in Elastic Stack v8.8 and lower since creating a connector with an explicit ID is not supported. ([1260](https://github.com/elastic/terraform-provider-elasticstack/pull/1260))
13
13
- Migrate `elasticstack_kibana_action_connector` to the Terraform plugin framework ([#1269](https://github.com/elastic/terraform-provider-elasticstack/pull/1269))
14
14
- Migrate `elasticstack_elasticsearch_security_role_mapping` resource and data source to Terraform Plugin Framework ([#1279](https://github.com/elastic/terraform-provider-elasticstack/pull/1279))
15
+
- Add support for `inactivity_timeout` in `elasticstack_fleet_agent_policy` ([#641](https://github.com/elastic/terraform-provider-elasticstack/issues/641))
-`download_source_id` (String) The identifier for the Elastic Agent binary download server.
52
52
-`fleet_server_host_id` (String) The identifier for the Fleet server host.
53
53
-`global_data_tags` (Attributes Map) User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42} (see [below for nested schema](#nestedatt--global_data_tags))
54
+
-`inactivity_timeout` (String) The inactivity timeout for the agent policy. If an agent does not report within this time period, it will be considered inactive. Supports duration strings (e.g., '30s', '2m', '1h').
54
55
-`monitor_logs` (Boolean) Enable collection of agent logs.
55
56
-`monitor_metrics` (Boolean) Enable collection of agent metrics.
56
57
-`monitoring_output_id` (String) The identifier for monitoring output.
Description: "The inactivity timeout for the agent policy. If an agent does not report within this time period, it will be considered inactive. Supports duration strings (e.g., '30s', '2m', '1h').",
103
+
Computed: true,
104
+
Optional: true,
105
+
CustomType: customtypes.DurationType{},
106
+
},
100
107
"global_data_tags": schema.MapNestedAttribute{
101
108
Description: "User-defined data tags to apply to all inputs. Values can be strings (string_value) or numbers (number_value) but not both. Example -- key1 = {string_value = value1}, key2 = {number_value = 42}",
0 commit comments