Initial Setup
First, you need to initialize Crust with your OpenAI API key:~/.crust.json with your settings.
Basic Usage
Crust provides three main commands for analyzing your Terraform infrastructure:1. Security Analysis
To analyze your infrastructure for security issues:- Run your Terraform plan
- Use OpenAI to analyze the output for security issues
- Present the findings with colorized output and emojis
2. Cost Analysis
To analyze the cost of your AWS infrastructure changes:- Run your Terraform plan
- Use AWS Pricing API to calculate costs
- Show a comparison with your current infrastructure
- Present the results in a formatted table
3. Plan Explanation
To get a clear explanation of your Terraform plan:- Run your Terraform plan
- Use OpenAI to generate a clear explanation
- Present the explanation in your configured language
- Include tips and recommendations
Running All Analyses
You can run all analyses at once with:Output Format
Crust uses XML tags for colorized output. The valid tags are:- Colors:
<red>,<green>,<blue>,<yellow>,<purple>,<cyan>,<white> - Formatting:
<bold>,<italic>,<underline>,<strikethrough>
Best Practices
- Run analyses early: Include Crust in your development workflow
- Review all findings: Pay attention to security issues and cost changes
- Use in CI/CD: Integrate Crust into your CI/CD pipeline
- Keep configuration updated: Update your OpenAI API key when needed