Labraboard is a state-aware Infrastructure as Code (IaC) platform specifically designed to manage Terraform configurations with ease and efficiency. Inspired by the Labrador, a versatile and intelligent working dog known for its roles as a guide, rescuer, and retriever, Labraboard embodies these qualities by becoming an indispensable tool in your infrastructure management toolkit.
- State Management: Efficiently handle Terraform states with support for InMemory storage, HTTP backend, PostgreSQL backend, and Redis queue.
- Lock Handling: Robust mechanisms to handle state locks, ensuring smooth and safe infrastructure updates.
- Custom Environment and Variables: Tailor your Terraform and OpenTofu environments with custom configurations for seamless deployments.
- Dynamic Backend Configuration: Automatically override backend configurations during plan or apply operations, simplifying the setup process.
- Project Operations: Manage projects with create, read, update, and delete functionalities, including the ability to specify Git references, set default values, and configure other essential parameters.
- Time Lease for State: Implement time-based leases to manage state longevity.
- User Configuration: Customize user settings and preferences.
Terraform is a powerful tool for managing infrastructure, but handling governance and surrounding processes can be challenging. Labraboard addresses these challenges, making it easier to run plans and apply infrastructure changes efficiently. With Labraboard, you can focus on building and deploying your infrastructure without worrying about the complexities of governance.
Labraboard - inspired by the intelligence and versatility of a Labrador, is here to be your guide in the world of infrastructure management.
if it is too fast there is a slower bit version: link
You can try by own this tool using app.rest file please bear aware that you have to change values in file http-client.env.json and add a private value ARM_CLIENT_SECRET for azure.
I enhance you to test in your terraform and your env variables :)
Swagger docs has to be updated to reflect the new endpoints.
It can be done by using command line swag init -g ./cmd/api/main.go -o ./docs
Upps here should be demo video - no worry, I will be soon! - Now check the API on https://api.labraboard.dev
git log --pretty=format:"%h%x09%an%x09%ad%x09%s"
- Reading plan
- InMemory storage
- Trigger run plan
- Override backend
- Use custom Env and variables on to terraform
- Http Backend (Get Put)
- Handle Locks on the state
- Handle Destroy
- Add PostgreSQL as backend
- Redis queue
- Project CRUD
- Add reference to git sha in aggregate and relate with plans
- Add mapping to decouple mapping between aggregates and repository
- Add and remove env variables
- Add and remove variables
- Fix handling returning changes from plan
- Add unit testing of aggregates
-
Bug fixing e2e testing(manually) - Path for parameters in git folder
- Create handlers cmd
- Time Lease for the state
- Refactor and move to use interfaces in handlers
- Implement Logging
- Logger and move init code to init function
- Integrate logger with gin - use middleware for recordId, in future userId
- Propagate context values between loggers
- Replace all print to logger
- Add every method ctx to enrich logger
- Integrate handlers to use logger
- Handle scheduled plan in TerraformPlanner
- Run plan using http backend
- Access Token for Backend http
- Clean solution to be more DDD
- Create Plan changes during run, what was happened during the time
- Apply Mechanism to handle the state
- Apply based on the Plan
- Save outputs as deployment, handle errors
- Backup before apply using ApplyOptions.Backup
- Implement retries on apply
- Correlate Project, Deployment, Plans
- Integrate with the Git
- Handle other version than version 4.0 of tf
- Handle multiple version of tf and tofu
- Policies and run on pre/post plan/apply
- Authenticate
- User configuration
- Add a web interface
- Encryption at rest
- fix end2end tests -
terraform_project_plan_test - fix bugs related passing refs instead of valu objects in array and fix mapping data from dao into aggregate
Solution uses own delivered http backend where state is kept. During running plan or apply the backend configuration is added automatically by overriding the backend.
please use your project id. Application use it identify terraform state.
terraform {
backend "http" {
address = "http://localhost:8080/api/v1/state/terraform/bee3cf56-ecd1-4434-8e18-02b0ae2950cc"
lock_address = "http://localhost:8080/api/v1/state/terraform/bee3cf56-ecd1-4434-8e18-02b0ae2950cc/lock"
unlock_address = "http://localhost:8080/api/v1/state/terraform/bee3cf56-ecd1-4434-8e18-02b0ae2950cc/lock"
}
}- Go 1.x
- Node.js and Yarn
- Docker and Docker Compose (optional)
- PostgreSQL
- Redis
The following tools will be automatically installed during development setup:
swag- Swagger documentation generatorgosec- Security scannertrivy- Container security scanner
The application can be configured using the following environment variables:
| Variable | Description | Default | Required |
|---|---|---|---|
| CONNECTION_STRING | PostgreSQL connection string | - | Yes |
| HTTP_PORT | HTTP port to serve the application | 8080 | No |
| REDIS_HOST | Redis host | localhost | No |
| REDIS_PORT | Redis port | 6379 | No |
| REDIS_PASSWORD | Redis password | eYVX7EwVmmxKPCDmwMtyKVge8oLd2t81 | No |
| REDIS_DB | Redis database number | 0 | No |
| LOG_LEVEL | Logging level | 1 | No |
| USE_PRETTY_LOGS | Use pretty logs instead of JSON | false | No |
| SERVICE_DISCOVERY | Service discovery URL | http://localhost | No |
| FRONTEND_PATH | Path to frontend files | /app/client | No |
- Clone the repository:
git clone https://github.com/PawelHaracz/labraboard.git
cd labraboard- Update Go modules:
make mod- Build the application:
make build- Run tests:
make test- Generate documentation:
make build-swaggerIf you encounter dependency issues:
- Clean the Go module cache:
go clean -modcache- Update dependencies:
make update-dependenciesThe project uses Make targets to streamline the development process. Here are the main commands:
make dev-setup- Setup development environmentmake install- Install application and dependenciesmake fmt- Format codemake lint- Run lintermake vet- Run go vetmake dependency-check- Check for outdated dependenciesmake update-dependencies- Update dependencies
make test- Run all testsmake test-unit- Run unit testsmake test-cover- Generate test coverage report
make build- Build all componentsmake build-api- Build API servermake build-handlers- Build handlersmake build-frontend- Build frontend application
make docker-build- Build Docker imagemake docker-push- Push Docker imagemake docker-compose-up- Start servicesmake docker-compose-stop- Stop services
make security-scan- Run security scans
make release-prepare- Prepare release artifactsmake release-publish- Publish release
make clean- Clean build artifactsmake clean-all- Remove all generated artifacts
For a complete list of available commands, run:
make help-
Code Style
- Follow Go standard formatting
- Run
make fmtbefore committing - Ensure code passes
make lintandmake vet
-
Testing
- Write unit tests for new features
- Maintain test coverage above 80%
- Run
make testbefore committing
-
Documentation
- Update Swagger documentation for API changes
- Keep README.md up to date
- Document new features and changes
-
Security
- Run security scans regularly
- Keep dependencies updated
- Follow security best practices
-
Release Process
- Update version in Makefile
- Create release notes
- Run full test suite
- Build and test Docker image
- Publish release
Please note that this project is currently under active development and is not considered production-ready. We are continuously working to improve and stabilize its features, but it does not yet meet all the requirements for production use.
