Enhance Terraform State Registry with Sorting, Filtering, and Search Capabilities
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Enhance Terraform State Registry with Sorting, Filtering, and Search Capabilities
Overview
As our customers manage increasingly large Terraform deployments, the need for improved navigation and organization within the Terraform State Registry has become critical. This issue proposes enhancing the registry with robust sorting, filtering, and search capabilities to enable customers to efficiently manage thousands of Terraform states.
Problem Statement
Customers with large Terraform deployments report difficulty in locating and managing specific state files in the registry. Without advanced filtering, sorting, and search capabilities, managing thousands of state files becomes time-consuming and error-prone. This creates operational inefficiencies and increases the risk of state file management errors.
User Stories
- As a DevOps engineer, I want to quickly sort state files by creation date so I can identify recently modified states.
- As a platform administrator, I want to filter state files by project so I can focus on states relevant to specific applications.
- As an infrastructure manager, I want to search for state files containing specific resource types so I can identify all infrastructure components of a certain type.
- As a team lead, I want to save common search queries so my team can consistently use the same filters when managing our states.
- As a developer, I want to filter states by lock status so I can identify locked states that might be blocking other operations.
Requirements
Functional Requirements
Sorting Capabilities
- Implement sorting by the following attributes:
- State name (alphabetical)
- Creation date
- Last modified date
- State file size
- Number of resources
- Allow toggling between ascending and descending order
- Persist sort preferences between sessions
Filtering Options
- Implement filters for:
- Project name/ID
- Group
- State status (active, locked, error)
- Environment (if applicable)
- Date ranges (created, modified)
- Allow combining multiple filters
- Provide visual indicators of active filters
Search Functionality
- Develop full-text search across state files and metadata
- Implement type-ahead suggestions
- Support for searching within state content
- Consider advanced search with regex support
- Implement search history
Saved Queries
- Allow users to save common search/filter combinations
- Enable naming and description for saved queries
- Provide options to share saved queries with team members
- Allow editing and deleting saved queries
Non-Functional Requirements
- Performance: Results should load within 3 seconds for repositories with up to 5,000 state files
- Usability: Interface should follow GitLab design patterns and be intuitive to use
- Scalability: Solution should scale to support large enterprises with 10,000+ state files
Technical Considerations
- Evaluate database indexing requirements for efficient searches
- Consider caching strategies for frequent searches
- Assess impact on API endpoints and rate limiting
- Review existing search implementations in other GitLab features for consistency
Implementation Approach
- Enhance database schema to support efficient filtering and searching
- Implement backend API endpoints for advanced queries
- Develop frontend components for filters, sort controls, and search interface
- Add saved query functionality
- Implement user preference persistence
Success Criteria
- Users can efficiently locate specific state files in registries with 1,000+ states
- All specified sorting and filtering options function correctly
- Search results are accurate and return within performance requirements
- Saved queries persist correctly between sessions