README Guide
Clear documentation is essential for maintaining and scaling infrastructure code. Each type of repository (modules, projects, and workspace management) requires specific documentation approaches.
Module README Structure
- Module Name and Version
- Clear name following convention
- Current version number
- Supported Terraform versions
- Description
- Purpose of the module
- Core functionality
- Use cases
- Features
- Key capabilities
- Optional features
- Default behaviors
- Usage
- Basic example
- Common configurations
- Integration patterns
- Requirements
- Provider versions
- Required permissions
- Dependencies
- Inputs
- All variables
- Type definitions
- Default values
- Required vs optional
- Outputs
- Available outputs
- Type definitions
- Usage examples
- Resources Created
- List of created resources
- Resource naming patterns
- Resource relationships
Project README Structure
- Project Overview
- Business purpose
- Architecture diagram
- Environment strategy
- Dependencies
- Required modules
- Version requirements
- External dependencies
- Deployment
- Branch strategy (dev/qa/main)
- Deployment order
- Required variables
- Configuration
- Environment differences
- Variable management
- Secret handling
- Maintenance
- Update process
- Testing strategy
- Troubleshooting
Workspace Management README Structure
- Overview
- Business unit scope
- Environment strategy
- Stack organization
- Stack Configuration
- Stack definitions
- Branch mappings
- Dependencies
- Access Control
- Team structure
- Role definitions
- Policy assignments
- Variable Management
- Environment variables
- Secret management
- Stack inheritance
- Operational Procedures
- Deployment process
- Promotion workflow
- Emergency procedures
Best Practices
- Keep Updated
- Update documentation with code changes
- Version documentation with releases
- Include changelog
- Be Specific
- Use concrete examples
- Include error scenarios
- Document known limitations
- Include Context
- Explain design decisions
- Document trade-offs
- Reference related components
- Maintain Standards
- Consistent formatting
- Clear section hierarchy
- Regular reviews
Remember: Good documentation reduces operational overhead and enables team scaling. Invest time in maintaining clear, accurate documentation.