Support advanced settings in fleet policy#1545
Merged
dimuon merged 27 commits intoelastic:mainfrom Dec 15, 2025
Merged
Conversation
…lts. Change MonitoringRuntimeExperimental type from Bool to String.
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for configuring advanced settings in Fleet agent policies, enabling control over agent logging, resource limits, and download behavior. The implementation follows the established pattern for advanced monitoring options and includes comprehensive version validation.
Key changes:
- Introduces
advanced_settingsattribute to the agent policy resource with 10 configurable fields - Implements version checking to ensure the feature is only used with Elasticsearch 8.17.0+
- Updates the API conversion logic to align with the behavior for advanced monitoring options (sending default values to allow resets)
Reviewed changes
Copilot reviewed 19 out of 19 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| internal/fleet/agent_policy/schema.go | Defines the advanced_settings schema with logging, CPU limit, and download configuration fields; adds UseStateForUnknown plan modifiers to existing attributes |
| internal/fleet/agent_policy/models.go | Implements advancedSettingsModel struct, API conversion methods, and populates state from API responses |
| internal/fleet/agent_policy/resource.go | Adds minimum version constant (8.17.0) and feature detection for advanced settings support |
| internal/fleet/agent_policy/models_test.go | Contains unit tests for advanced settings conversion and updates existing tests to validate sending default values |
| internal/fleet/agent_policy/version_test.go | Validates version checking behavior for advanced settings in create and update operations |
| internal/fleet/agent_policy/acc_test.go | Provides end-to-end acceptance tests covering creation, updates, removal, and default value scenarios |
| internal/fleet/agent_policy/testdata/* | Terraform configuration files for acceptance test scenarios |
| docs/resources/fleet_agent_policy.md | Documents the new advanced_settings attribute and its nested fields |
| CHANGELOG.md | Records the feature addition |
…tack into fleet-policy-advanced-settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #1116
Plus some follow-up fixes for #984