-
Notifications
You must be signed in to change notification settings - Fork 123
[Feature] Introduce elasticsearch alias resource with atomic write index management and nested attributes #1343
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
Copilot
wants to merge
16
commits into
main
Choose a base branch
from
copilot/fix-7855e918-4f89-4206-9e30-02dc9febbc48
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
91ab7d6
Initial plan
Copilot 5bf740c
Implement core alias resource structure and API functions
Copilot 7f5a743
Fix null value handling and data stream alias test passing
Copilot 8bb4289
Alias resource acceptance tests now passing
Copilot 5c90036
Complete alias resource implementation with linting and documentation
Copilot efbb995
Major schema redesign and improved acceptance tests
Copilot c95cd5c
Final fixes: correct test configurations and linting cleanup
Copilot dbf477e
Fix acceptance tests with variable declarations and direct index creaβ¦
Copilot dd27d0a
Fix linting issues: remove unused constants and fix staticcheck warnings
Copilot 0bec889
Convert schema from blocks to nested attributes
Copilot 8a64b68
Address all PR feedback: refactor models, clean API functions, improvβ¦
Copilot 858e669
Tidy up
tobio 92ee168
Support externally managed aliases in the index resource
tobio cdead36
Merge branch 'main' into copilot/fix-7855e918-4f89-4206-9e30-02dc9febβ¦
tobio d99bf83
Merge branch 'main' into copilot/fix-7855e918-4f89-4206-9e30-02dc9febβ¦
tobio 5bc6cb2
Merge remote-tracking branch 'origin/main' into copilot/fix-7855e918-β¦
tobio File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| # generated by https://github.com/hashicorp/terraform-plugin-docs | ||
| page_title: "elasticstack_elasticsearch_index_alias Resource - terraform-provider-elasticstack" | ||
| subcategory: "Index" | ||
| description: |- | ||
| Manages an Elasticsearch alias. See the alias documentation https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html for more details. | ||
| --- | ||
|
|
||
| # elasticstack_elasticsearch_index_alias (Resource) | ||
|
|
||
| Manages an Elasticsearch alias. See the [alias documentation](https://www.elastic.co/guide/en/elasticsearch/reference/current/indices-aliases.html) for more details. | ||
|
|
||
|
|
||
|
|
||
| <!-- schema generated by tfplugindocs --> | ||
| ## Schema | ||
|
|
||
| ### Required | ||
|
|
||
| - `name` (String) The alias name. | ||
|
|
||
| ### Optional | ||
|
|
||
| - `read_indices` (Attributes Set) Set of read indices for the alias. (see [below for nested schema](#nestedatt--read_indices)) | ||
| - `write_index` (Attributes) The write index for the alias. Only one write index is allowed per alias. (see [below for nested schema](#nestedatt--write_index)) | ||
|
|
||
| ### Read-Only | ||
|
|
||
| - `id` (String) Generated ID of the alias resource. | ||
|
|
||
| <a id="nestedatt--read_indices"></a> | ||
| ### Nested Schema for `read_indices` | ||
|
|
||
| Required: | ||
|
|
||
| - `name` (String) Name of the read index. | ||
|
|
||
| Optional: | ||
|
|
||
| - `filter` (String) Query used to limit documents the alias can access. | ||
| - `index_routing` (String) Value used to route indexing operations to a specific shard. | ||
| - `is_hidden` (Boolean) If true, the alias is hidden. | ||
| - `routing` (String) Value used to route indexing and search operations to a specific shard. | ||
| - `search_routing` (String) Value used to route search operations to a specific shard. | ||
|
|
||
|
|
||
| <a id="nestedatt--write_index"></a> | ||
| ### Nested Schema for `write_index` | ||
|
|
||
| Required: | ||
|
|
||
| - `name` (String) Name of the write index. | ||
|
|
||
| Optional: | ||
|
|
||
| - `filter` (String) Query used to limit documents the alias can access. | ||
| - `index_routing` (String) Value used to route indexing operations to a specific shard. | ||
| - `is_hidden` (Boolean) If true, the alias is hidden. | ||
| - `routing` (String) Value used to route indexing and search operations to a specific shard. | ||
| - `search_routing` (String) Value used to route search operations to a specific shard. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The condition
if action.IsHiddenwill cause the field to be omitted whenIsHiddenisfalse, which could result in inconsistent behavior. If the API requires explicitfalsevalues to unset hidden status, this should beaddDetails["is_hidden"] = action.IsHiddenwithout the condition. If the API interprets absence asfalse, this should be documented with a comment.