Implement Group-level View for Terraform State Registry
Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.
Implement Group-level View for Terraform State Registry
Overview
Currently, Terraform states can only be viewed and managed at the project level, requiring users to navigate between multiple projects to get a complete picture of their infrastructure. This issue proposes implementing a consolidated group-level view for the Terraform State Registry to improve management efficiency and visibility across projects.
Problem Statement
Organizations that manage infrastructure across multiple projects lack a unified view of their Terraform states. This fragmentation makes it difficult to:
- Monitor overall infrastructure health
- Identify problematic states across projects
- Efficiently manage infrastructure that spans multiple projects
- Ensure consistent state management practices
A group-level view would address these challenges by providing consolidated visibility and management capabilities.
User Stories
- As a DevOps manager, I want to see all Terraform states across my group's projects so I can understand our overall infrastructure footprint.
- As an infrastructure architect, I want to identify locked or outdated states across projects so I can proactively address potential issues.
- As a platform engineer, I want to view aggregated statistics about our Terraform states so I can report on infrastructure health to stakeholders.
- As a team lead, I want to navigate easily between group and project views so I can switch between high-level monitoring and detailed management.
- As a security analyst, I want to identify non-compliant states across projects so I can ensure infrastructure security standards are maintained.
Requirements
Functional Requirements
Group-level Dashboard
- Create a dedicated view for Terraform states at the group level
- Display states from all projects within the group (with appropriate permissions)
- Support for subgroups: option to include/exclude states from projects in subgroups
- Implement consistent UI patterns with the project-level view for familiarity
Aggregated Statistics
- Show total count of states across all projects
- Display distribution of states by status (active, locked, error)
- Visualize state usage by project (e.g., bar chart of state counts per project)
- Show recent activity timeline (state creations, modifications, locks/unlocks)
- Calculate and display resource counts across all states
Health Indicators
- Implement visual health status for each state:
- Up-to-date (recently applied)
- Outdated (not applied in X days, configurable threshold)
- Locked (with lock duration and owner)
- Error state (failed operations)
- Drift detected (if drift detection is enabled)
- Provide summary health score for the group as a whole
- Allow sorting and filtering by health status
Navigation
- Create seamless navigation between group and project-level views
- Implement breadcrumb navigation for context awareness
- Allow direct linking to specific states from the group view
- Maintain filter/sort preferences when switching between views
Non-Functional Requirements
- Performance: Dashboard should load within 5 seconds for groups with up to 50 projects
- Scalability: Solution should support large groups with 100+ projects and 1,000+ state files
- Security: Respect existing permissions model (only show states from projects user has access to)
- Usability: Interface should be intuitive and follow GitLab design patterns
Technical Considerations
- Evaluate database query performance for aggregating data across multiple projects
- Consider caching strategies for performance optimization
- Review permission model implications for cross-project viewing
- Assess impact on API endpoints and potential rate limiting issues
Implementation Approach
- Design database queries for efficient cross-project data aggregation
- Develop backend API endpoints for group-level state information
- Implement frontend components for the group dashboard
- Create navigation structure between group and project views
- Add health indicators and aggregated statistics
Success Criteria
- Users can view all Terraform states across their group's projects in a single interface
- Aggregated statistics accurately reflect the state of infrastructure across projects
- Health indicators correctly identify problematic states
- Navigation between group and project views is seamless and intuitive
Out of Scope
- Changes to the underlying Terraform state storage mechanism
- Modifications to how Terraform operations are performed
- Group-level operations on multiple states simultaneously (could be considered as a future enhancement)
Mockups
[Placeholder for UI mockups showing the group-level dashboard with aggregated statistics and health indicators]