Add elasticstack_kibana_default_data_view resource to manage default data view #1379
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.
Overview
This PR implements a new
elasticstack_kibana_default_data_viewresource that allows users to programmatically set the default Kibana data view, addressing the feature request in issue #XXX.Previously, users could only set the default data view manually through the Kibana UI (see screenshot below). This resource enables automated management of this setting through Terraform.
Changes
New Resource:
elasticstack_kibana_default_data_viewSchema:
data_view_id(required, string): The data view identifier to set as defaultforce(optional, bool, default: true): Update an existing default data view identifierskip_delete(optional, bool, default: false): If true, the default data view will not be unset when the resource is destroyedExample Usage:
Implementation Details
skip_deleteflagFiles Added
internal/kibana/default_data_view/- Complete resource implementation with CRUD operations, schema, models, and testsexamples/resources/elasticstack_kibana_default_data_view/resource.tf- Example configurationdocs/resources/kibana_default_data_view.md- Generated documentationTesting
✅ All acceptance tests pass:
✅ Manual end-to-end testing completed and verified all scenarios:
Related Issues
Closes #XXX
Original prompt
Fixes #603
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.