Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Add a new
elasticstack_kibana_streamTerraform resource backed by the mainkbapiKibana client, plus a small internal condition model and Streams API helpers, to validate the first end‑to‑end integration between Terraform and Streams.This POC focuses on group streams, base‑stream creation, and a read‑only view of ingest, without committing yet to a final public Terraform schema for all Streams features.
What this PR changes
Streams API helpers (
internal/clients/kibana_oapi/streams.go)kbapi.ClientWithResponseson top of the Kibana HTTP client.EnableStreams/DisableStreams(POST /api/streams/_enable|_disable),GetStreamJSON,PutStreamRaw,DeleteStream(with the"Expected undefined, received null"quirk handled),GetStreamIngestJSON/PutStreamIngest,GetStreamGroupJSON/PutStreamGroup.New Terraform resource:
elasticstack_kibana_stream(internal/kibana/streams)provider/plugin_framework.goviastreams.NewResource.id,name,space_id,description,type,create_if_missing.group { members, metadata, tags }– managed via/api/streams/{name}/_group.ingest { type }– computed, read‑only from/api/streams/{name}/_ingestin this POC._group, round‑tripmembers/metadata/tags, and delete viaDELETE /api/streams/{name}with quirks handled._ingestbut does not write it yet) .Internal condition expression model (
internal/kibana/streams/conditions.go)Condition,FieldComparison,And,Or) plusMarshalConditionhelper.conditions_test.goverify JSON output for simple and nested trees.Testing
Kibana's side :
Terraform side
go test ./internal/kibana/streams/...(condition model + flatten/expand helpers).main.tfmake build.terraform initterraform applycreate_if_missing = true,_groupupsert, and round‑trip ofmembers/metadata/tags.ingest.typepopulated from_ingest, no writes to_ingest).