README
ΒΆ
Ship CLI Example Terraform Scenarios
This directory contains comprehensive Terraform examples designed to test Ship CLI's MCP server tools with Claude Code. Each scenario represents different infrastructure patterns with varying complexity levels and intentional issues for testing security scanning tools.
ποΈ Available Scenarios
1. aws-web-app - Production Web Application
- Architecture: VPC, ALB, Auto Scaling, RDS, S3
- Complexity: High
- Purpose: Test comprehensive infrastructure analysis
- Features: Multi-tier architecture, proper security practices
- Cost: ~$30-50/month
2. serverless-api - Serverless REST API
- Architecture: Lambda, API Gateway, DynamoDB, S3
- Complexity: Medium
- Purpose: Test serverless security and cost analysis
- Features: Pay-per-use model, event-driven architecture
- Cost: ~$5-15/month
3. security-hardened - Security-Focused Infrastructure
- Architecture: KMS, VPC Flow Logs, CloudWatch, IAM
- Complexity: High
- Purpose: Test security scanning with intentional vulnerabilities
- Features: Encryption, logging, monitoring, intentional security issues
- Cost: ~$25-40/month
4. cost-optimized - Budget-Conscious Setup
- Architecture: Spot Fleet, Intelligent Tiering, Lifecycle Policies
- Complexity: Medium
- Purpose: Test cost analysis and optimization recommendations
- Features: Spot instances, storage optimization, cost inefficiencies
- Cost: ~$10-20/month
5. multi-cloud-setup - Multi-Cloud Deployment
- Architecture: AWS + Azure + GCP resources
- Complexity: High
- Purpose: Test multi-cloud analysis capabilities
- Features: Cross-cloud networking, provider comparison
- Cost: Varies by provider
6. kubernetes-cluster - Container Orchestration
- Architecture: EKS, Node Groups, ALB Ingress
- Complexity: High
- Purpose: Test Kubernetes security and networking
- Features: Container security, network policies
- Cost: ~$70-100/month
7. data-pipeline - Data Processing Infrastructure
- Architecture: Kinesis, Lambda, Redshift, S3
- Complexity: Medium
- Purpose: Test data pipeline security and compliance
- Features: Stream processing, data warehousing
- Cost: ~$50-80/month
8. compliance-ready - Regulatory Compliance
- Architecture: Config Rules, CloudTrail, GuardDuty
- Complexity: High
- Purpose: Test compliance scanning (SOC2, HIPAA, etc.)
- Features: Audit logging, compliance controls
- Cost: ~$40-60/month
π Testing with Ship CLI MCP Server
Prerequisites
- Configure Claude Code MCP: Copy
.mcp.jsonto your Claude Code config - Set OpenAI API Key: Replace placeholder in
.mcp.json - AWS Credentials: Ensure AWS CLI is configured
Available MCP Tools
Once configured, Claude Code will have access to these Ship CLI tools:
π§ Terraform Analysis Tools
terraform_lint- Syntax and best practices checkingterraform_checkov_scan- Security policy complianceterraform_security_scan- Alternative security scanningterraform_cost_analysis- Infrastructure cost analysisterraform_generate_docs- Documentation generationterraform_generate_diagram- Infrastructure visualization
π€ AI-Powered Investigation
ai_investigate- Natural language infrastructure queries
βοΈ Cloud Operations
cloudship_push- Upload artifacts for AI analysis
Example Claude Code Conversations
Security Analysis
"Please analyze the security-hardened example for vulnerabilities using the terraform security scanning tools"
Cost Optimization
"Review the cost-optimized example and identify opportunities for further cost savings"
Documentation Generation
"Generate comprehensive documentation for the aws-web-app example"
AI Investigation
"Use ai_investigate to show me all S3 buckets in my AWS account and check which ones have public access"
π Example Structure
Each example includes:
main.tf- Primary infrastructure definitionvariables.tf- Input variables with defaultsoutputs.tf- Output values for integrationREADME.md- Detailed usage instructions- Supporting files - User data scripts, configs, etc.
π§ͺ Testing Scenarios
Security Testing
- Run security scans on
security-hardened/- should find intentional issues - Compare results between
terraform_checkov_scanandterraform_security_scan - Verify fixes - remediate issues and re-scan
Cost Analysis Testing
- Analyze costs for
cost-optimized/- should identify inefficiencies - Compare scenarios - web-app vs serverless-api cost profiles
- Optimization recommendations - ask AI for cost reduction strategies
Documentation Testing
- Generate docs for complex scenarios like
aws-web-app - Verify completeness - ensure all resources are documented
- Format testing - try different output formats (markdown, table)
Multi-Tool Workflows
- Full pipeline: lint β security scan β cost analysis β docs
- Push results to Cloudship using
--pushflag - AI analysis of existing infrastructure with
ai_investigate
β οΈ Important Notes
Security Warnings
- Never deploy these examples to production without review
- Intentional vulnerabilities exist in some examples for testing
- Review all security settings before any real deployment
Cost Management
- Monitor costs if deploying to AWS
- Use terraform destroy when testing is complete
- Set billing alerts for safety
MCP Configuration
- .mcp.json is gitignored - contains personal credentials
- Replace placeholder values with real API keys
- Test connectivity before extensive use
π― Best Practices
- Start simple - test with
serverless-apifirst - Use plan files - generate with
terraform plan -out=tf.plan - Test incrementally - one tool at a time initially
- Compare outputs - manual vs MCP tool results
- Document findings - note any tool limitations or issues
π§ Troubleshooting
Common Issues
- MCP server connection - check .mcp.json configuration
- AWS credentials - ensure proper AWS CLI setup
- Tool timeouts - adjust timeout values in tool calls
- Permission errors - verify IAM permissions for analysis
Getting Help
- Check tool outputs - most tools provide detailed error messages
- Test individual tools - isolate issues by testing one tool at a time
- Review logs - Ship CLI provides detailed logging with
--log-level debug
These examples provide comprehensive testing scenarios for the Ship CLI MCP server integration with Claude Code. Each scenario tests different aspects of infrastructure analysis, security scanning, cost optimization, and documentation generation. π
Documentation
ΒΆ
There is no documentation for this package.
Click to show internal directories.
Click to hide internal directories.