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
* fix(ml): make anomaly_detection_job import resilient
Fixes terraform import/refresh failures for elasticstack_elasticsearch_ml_anomaly_detection_job by keeping ImportState sparse (id/job_id only) and allowing analysis_config to be null during import before Read populates it.
Also ensures empty nested lists in analysis_config (e.g. categorization_filters/influencers/custom_rules) are always typed to avoid DynamicPseudoType conversion errors.
AI assistance: This change was implemented with the help of an AI coding assistant (Cursor + GPT).
* Update internal/elasticsearch/ml/anomaly_detection_job/resource.go
Co-authored-by: Toby Brain <[email protected]>
* Remove unused import in anomaly_detection_job resource file
* Add ImportState testing for anomaly_detection_job acceptance tests
This update introduces ImportState testing for the elasticstack_elasticsearch_ml_anomaly_detection_job resource, ensuring that the job can be imported correctly with the necessary configuration variables. The test verifies the import functionality and enhances the robustness of the acceptance tests.
* Extract duplicated list type handling logic into reusable helper (#1559)
* Initial plan
* Refactor: extract duplicated list type handling into reusable helper function
- Created EnsureTypedList helper in typeutils package
- Replaced three instances of duplicated logic for handling untyped zero-value lists
- Removed unused strings import from resource.go
- All three instances (CategorizationFilters, Influencers, CustomRules) now use the centralized helper
Co-authored-by: neiljbrookes <[email protected]>
---------
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: neiljbrookes <[email protected]>
* Update CHANGELOG.md to include a fix for `elasticstack_elasticsearch_ml_anomaly_detection_job` import, enhancing resilience to sparse state values.
---------
Co-authored-by: Toby Brain <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: neiljbrookes <[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
@@ -73,6 +73,7 @@ inputs = {
73
73
- Fix the enabled property being ignored in `elasticstack_kibana_alerting_rule` ([#1527](https://github.com/elastic/terraform-provider-elasticstack/pull/1527))
74
74
- Add `advanced_monitoring_options` to `elasticstack_fleet_agent_policy` to configure HTTP monitoring endpoint and diagnostics settings ([#1537](https://github.com/elastic/terraform-provider-elasticstack/pull/1537))
75
75
- Move the `input` block to an `inputs` map in `elasticstack_fleet_integration_policy` ([#1482](https://github.com/elastic/terraform-provider-elasticstack/pull/1482))
76
+
- Fix `elasticstack_elasticsearch_ml_anomaly_detection_job` import to be resilient to sparse state values
0 commit comments