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

[Feature] Export saved objects

Open tehbooom opened this issue 1 year ago • 0 comments

Is your feature request related to a problem? Please describe. Import saved objects already exists for the provider however would like to be able to export objects as well.

Describe the resource you would like to have implemented.

data "elasticstack_kibana_export_saved_objects" "dashboards" {
  space_id = "default" 
  exclude_export_details = true
  include_references_deep = true
  objects = jsonencode({
    {
      "type": "dashboard",
      "id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
    },
    {
     "type": "dashboard",
      "id": "be3733a0-9efe-11e7-acb3-3dab96693fab"
    }     
  })
}

Attributes exported :

  • object.0.content
  • object.1.content

Describe the solution you'd like This resource would be similar to the http provider

This would store the object in the state file and allow a user to use the local file provider to save to disk or reference it from another terraform state

Describe alternatives you've considered Strictly just using the http data source is an option but it would be nice to have it in the same provider

Additional context The use case I see this being used most often is when transferring saved objects between clusters that need to be fairly similar. For example, a development cluster where users have privileged access (creating dashboards and visualizations) can then export those and then get imported into a production cluster where those same users only have read access.

tehbooom avatar Jul 26 '24 14:07 tehbooom