Infrastructure as Code Review
Review Infrastructure as Code (IaC) for best practices, security, and maintainability.
Loading...
Review Infrastructure as Code (IaC) for best practices, security, and maintainability.
A code review is a systematic examination of source code intended to identify bugs, improve code quality, ensure adherence to coding standards, and share knowledge among team members. It's a collaborative process where developers review each other's code before it's merged into the main codebase. Code reviews help catch errors early, maintain consistency, and improve overall software quality.
Infrastructure as Code Review provides practical benefits for engineering teams, including improved efficiency, better code quality, and streamlined workflows. The key advantages include:
# Infrastructure as Code Review ## Problem Context DevOps/SRE engineers write Infrastructure as Code (IaC) that needs to be reviewed for correctness, security, and best practices. Effective reviews prevent production issues and ensure maintainability. ## Solution Pattern: Template Pattern The Template Pattern provides a structured review checklist for IaC, ensuring all critical aspects are evaluated. ## Prompt Template Act as a DevOps/SRE engineer reviewing Infrastructure as Code. Review: **IaC to Review:** - Tool: [Terraform, CloudFormation, Pulumi, etc.] - Infrastructure: [What's being provisioned?] - Code Files: [IaC code to review] **Review Checklist:** 1. **Code Quality** - Is code well-organized and modular? - Are resources properly named? - Is there reusable code (modules/functions)? - Are variables and outputs clear? 2. **Security Review** - Are secrets and sensitive data handled securely? - Are IAM roles and permissions least-privilege? - Are network security groups configured correctly? - Are encryption settings appropriate? - Are public endpoints avoided when possible? 3. **Best Practices** - Are resource tags applied consistently? - Is state management handled correctly? - Are environment-specific configurations separated? - Are DRY principles followed? 4. **Reliability** - Are health checks configured? - Are auto-scaling policies appropriate? - Are backup and disaster recovery configured? - Are resource limits and quotas considered? 5. **Cost Optimization** - Are resources appropriately sized? - Are unused resources cleaned up? - Are cost-effective instance types selected? - Are monitoring and alerting configured? 6. **Documentation** - Is README documentation clear? - Are deployment instructions documented? - Are dependencies and prerequisites listed? - Are troubleshooting guides included? 7. **Testing** - Are there tests for IaC? - Is linting/validation automated? - Are changes tested before applying? Provide comprehensive feedback with specific recommendations. --- *This prompt is part of the Engify.ai research-based prompt library. Customize it for your specific context and needs.*
Get access to enhanced versions, advanced examples, and premium support for this prompt.
Loading revision history...