elastic / terraform-provider-elasticstack

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

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

Open Kronusus opened 1 month ago

Kronusus commented 1 month 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 1 month 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 1 month ago

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