Key points to make maintainable Terraform code:
- With Terrform one should create focused module that has single responsibility.
- Comprehensive testing
- Unit testing of each module
- Integration testing of the whole infrastructure
- Configuration testing to verify that the infrastructure is configured as expected