terraform-provider-elasticstack icon indicating copy to clipboard operation
terraform-provider-elasticstack copied to clipboard

[Feature] [terraform] Elastic Defend integration configuration

Open 3kt opened this issue 1 year ago • 4 comments

Is your feature request related to a problem? Please describe. Using elasticstack_fleet_integration_policy works well for standard TCP / logs integration, as showcased in the documentation, but for the Elastic Defend integration no custom configuration can be applied because of its structure.

Describe the resource you would like to have implemented. We'd need some extension of the capabilities of the /api/fleet/package_policies/[integration ID] endpoint. We basically need an extension from the capabilities of https://github.com/elastic/terraform-provider-elasticstack/blob/main/internal/fleet/integration_policy_resource.go to support customization for Elastic Defend integration.

Describe the solution you'd like I'd like to be able to customize the Elastic Defend integration with the elasticstack_fleet_integration_policy resource, the same way the UI offers: image

Describe alternatives you've considered There is currently no workaround with pure Terraform, as the API endpoint are simply not instrumented in the provider.

Additional context Looking at what Kibana does when saving the integration through the UI, the custom settings of the Defend Integration look like this:

{
  "version": "WzU0NTAsMV0=",
  "name": "Defend integration",
  "namespace": "default",
  "description": "A sample integration policy",
  "package": {
    "name": "endpoint",
    "title": "Elastic Defend",
    "version": "8.13.0"
  },
  "enabled": true,
  "policy_id": "85ea0949-8d7b-4da0-bf2c-bbff166bbb72",
  "vars": {},
  "inputs": [
    {
      "type": "endpoint",
      "enabled": true,
      "config": {
        "integration_config": {},
        "artifact_manifest": {[some stuff]},
        "policy": {[some other stuff]}
      },
      "streams": []
    }
  ]
}

We don't currently have support for artifact_manifest and policy, but only the streams bit which is unused by the Defend integration.

3kt avatar Apr 05 '24 11:04 3kt

@andrewkroh would you be able to help route this request. I believe your team developed the terraform provider. TIA

cc: @cmacknz

nimarezainia avatar May 13 '24 01:05 nimarezainia

Looking at the API^1 in Kibana, config is listed as an object so it would make sense for the elasticstack_fleet_integration_policy^2 resource to support config_json as a parameter for the input blocks.

The API doesn't have a description for config and apart from this one use-case for Endpoint, I have never seen it. So we need someone from Fleet to describe it for the Terraform documentation.

Adding it to the code here is probably not a big task.

andrewkroh avatar May 13 '24 01:05 andrewkroh

Any plans to implement this in the near term? @henurah

ryanturner-cd avatar Oct 11 '24 13:10 ryanturner-cd

Any plans to implement this in the near term? @henurah

Unfortunately at the moment there's no target delivery of this enhancement

nimarezainia avatar Oct 14 '24 02:10 nimarezainia

+1, we would like to see this as well.

Oddly avatar Jan 20 '25 12:01 Oddly

+1, we were part of the original request and are still very much interested.

msecpim avatar Jan 20 '25 14:01 msecpim

+1 this would help if with reducing manual work

sbaas-hcs avatar Jan 23 '25 10:01 sbaas-hcs

+1 from me too

msecrbl avatar Jan 23 '25 13:01 msecrbl

+1 would be awesome to have this.

msecdsu avatar Jan 23 '25 13:01 msecdsu

+1 would help a lot

msecjmu avatar Jan 23 '25 14:01 msecjmu

+1, this would be a very helpful feature.

msecdst avatar Jan 27 '25 07:01 msecdst

+1 would be nice to have this

msecrve avatar Jan 28 '25 07:01 msecrve

+1 absolutely necessary in big automated environments

icefish-creativ avatar Aug 13 '25 13:08 icefish-creativ

Same issue applies if you want to add an Elastic APM integration policy, which is a rather crucial component, so please priorities this enhancement.

aleks-ivk avatar Nov 05 '25 16:11 aleks-ivk