elastic / terraform-provider-elasticstack

Terraform provider for Elastic Stack
https://registry.terraform.io/providers/elastic/elasticstack/latest/docs
Apache License 2.0
170 stars 92 forks source link

System integration not added although "sys_monitoring" is set to true [Bug] #676

Closed Kronusus closed 1 month ago

Kronusus commented 3 months ago

Describe the bug I'm trying to create and configure an elastic agent policy according to the current documenation: // Definition of agent policy resource "elasticstack_fleet_agent_policy" "test_policy" { name = "Test Policy" namespace = "default" description = "Test Agent Policy" sys_monitoring = true monitor_logs = true monitor_metrics = true }

According to the documentation, I would expect that the system integration is automatically added to my created "test_policy", since I set sys_monitoring to true.

When I execute terraform apply, this also runs without an error. However, the created configuration doesn't contain the systems integration.

To Reproduce Steps to reproduce the behavior:

  1. After the necessary base set-up of the elasticstack provider, try to create an agent policy according to the code above.

Expected behavior Created agent policy should contain system integration.

Versions (please complete the following information):

thanks for any assistance on this behaviour.

RainrainWu commented 3 months ago

It seems like the sys_monitoring has to be passed via URL param, which is not quite aligned with the current implementation based on the request body.

https://www.elastic.co/guide/en/fleet/current/fleet-api-docs.html#create-agent-policy-api

I would like to take this issue and try to propose a workaround these days via request editor functions and see if it is feasible 😃 , what do u think?

Kronusus commented 3 months ago

I have not enough insides but to me it sounds good :)