Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Infrastructure as Code validation and security checking for Terraform, Kubernetes, and Helm deployments. Performs comprehensive security analysis, cost estimation, compliance validation, and best practices enforcement.
| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-03 | ✗→✓ | ▲ Improved | 36% | 0% |
| case-04 | ✗→✓ | ▲ Improved | 248% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 148% | 0% |
| case-06 | ✗→✓ | ▲ Improved | 165% | 0% |
| case-07 | ✗→✓ | ▲ Improved | 181% | 0% |
The IaC Deployment Validator skill provides comprehensive validation and security analysis for Infrastructure as Code deployments. It supports Terraform, Kubernetes manifests, and Helm charts, ensuring deployments meet security standards, compliance requirements, and best practices.
bash# Validate Terraform plan skill invoke iac-deployment-validator validate-terraform --plan-file terraform.plan --framework CIS # Validate with cost analysis skill invoke iac-deployment-validator validate-terraform --plan-file terraform.plan --check-cost --provider aws # Comprehensive validation skill invoke iac-deployment-validator validate-terraform --plan-file terraform.plan \ --check-security --check-cost --check-compliance --framework NIST
bash# Validate Kubernetes manifests skill invoke iac-deployment-validator validate-k8s --manifest-path k8s/ --namespace production # Security-focused validation skill invoke iac-deployment-validator validate-k8s --manifest-path deployment.yaml \ --check-security --check-resources --check-best-practices # Validate specific manifest skill invoke iac-deployment-validator validate-k8s --manifest-path pod.yaml \ --security-only
bash# Validate Helm chart skill invoke iac-deployment-validator validate-helm --chart-path ./chart --release-name myapp # Dry-run validation skill invoke iac-deployment-validator validate-helm --chart-path ./chart \ --values-file values-prod.yaml --dry-run --namespace production # Security validation skill invoke iac-deployment-validator validate-helm --chart-path ./chart \ --check-security --values-file values.yaml
bash# Estimate deployment costs skill invoke iac-deployment-validator estimate-cost --iac-type terraform \ --config-path ./ --provider aws --region us-east-1 # Multi-cloud cost comparison skill invoke iac-deployment-validator estimate-cost --iac-type terraform \ --config-path ./ --compare-providers aws,azure,gcp # Cost optimization analysis skill invoke iac-deployment-validator estimate-cost --iac-type terraform \ --config-path ./ --optimization-recommendations
bash# Check against security policies skill invoke iac-deployment-validator check-security --iac-path ./ \ --policy-set CIS --severity-threshold medium # Custom policy validation skill invoke iac-deployment-validator check-security --iac-path ./ \ --policy-set custom --custom-policy-path ./policies/ # Compliance validation skill invoke iac-deployment-validator check-security --iac-path ./ \ --policy-set NIST --generate-report
bash# Generate deployment report skill invoke iac-deployment-validator report --iac-path ./ \ --format PDF --include-recommendations --include-cost-analysis # Executive summary report skill invoke iac-deployment-validator report --iac-path ./ \ --format HTML --executive-summary --compliance-framework CIS # Technical analysis report skill invoke iac-deployment-validator report --iac-path ./ \ --format JSON --technical-analysis --security-analysis
bash# Cloud Provider Credentials AWS_ACCESS_KEY_ID=your_access_key AWS_SECRET_ACCESS_KEY=your_secret_key AWS_DEFAULT_REGION=us-east-1 AZURE_CLIENT_ID=your_client_id AZURE_CLIENT_SECRET=your_client_secret AZURE_TENANT_ID=your_tenant_id AZURE_SUBSCRIPTION_ID=your_subscription_id GOOGLE_APPLICATION_CREDENTIALS=/path/to/service-account.json GCP_PROJECT_ID=your_project_id # Cost Estimation API INFRACOST_API_KEY=your_infracost_api_key PRICING_API_KEY=your_pricing_api_key
yaml# .claude/skills/iac-deployment-validator/config.yaml validation_rules: terraform: security: - check_unencrypted_storage - check_open_security_groups - check_iam_privileges - check_logging_configuration compliance: - CIS_AWS_Controls - NIST_800_53 - SOC2_Controls cost: - resource_sizing - instance_types - storage_optimization - data_transfer_costs kubernetes: security: - check_security_contexts - check_privileged_containers - check_secrets_management - check_network_policies best_practices: - check_resource_limits - check_health_checks - check_image_tags - check_namespace_usage helm: security: - check_template_security - check_values_security - check_chart_integrity structure: - check_required_files - check_chart_metadata - check_template_syntax cost_estimation: providers: aws: pricing_api: https://pricing.us-east-1.amazonaws.com regions: [us-east-1, us-west-2, eu-west-1] azure: pricing_api: https://prices.azure.com regions: [eastus, westus2, westeurope] gcp: pricing_api: https://cloudbilling.googleapis.com regions: [us-central1, us-east1, europe-west1] reporting: formats: - JSON - HTML - PDF sections: - executive_summary - technical_analysis - security_analysis - cost_analysis - recommendations templates: executive: templates/executive-report.html technical: templates/technical-report.html security: templates/security-report.html notification: slack: webhook_url: https://hooks.slack.com/services/... channel: #iac-validation username: IaC Validator email: smtp_server: smtp.company.com smtp_port: 587 from_address: iac-validator@company.com recipients: - devops@company.com - security@company.com
This skill integrates with the iac-validator MCP server for enhanced capabilities:
validate_terraform_plan: Validate Terraform plans for security, cost, and compliancevalidate_kubernetes_manifests: Validate K8s manifests for best practices and securityvalidate_helm_chart: Validate Helm charts for security and best practicesestimate_deployment_costs: Estimate costs for infrastructure deploymentcheck_security_policies: Check IaC against security policies and standardsgenerate_deployment_report: Generate comprehensive deployment validation reportjavascript// Using the MCP server directly const terraformValidation = await mcp.call('validate_terraform_plan', { plan_file: 'terraform.plan', check_security: true, check_cost: true, check_compliance: true, compliance_framework: 'CIS' }); const k8sValidation = await mcp.call('validate_kubernetes_manifests', { manifest_path: 'k8s/', namespace: 'production', check_security: true, check_resources: true, check_best_practices: true });
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ IaC Parsers │ │ Validation Engine│ │ Reporting │
│ │ │ │ │ │
│ • Terraform │───▶│ • Security Rules │───▶│ • PDF Generator │
│ • Kubernetes │ │ • Compliance │ │ • HTML Generator │
│ • Helm │ │ • Cost Analysis │ │ • JSON Export │
│ • YAML/JSON │ │ • Best Practices │ │ • Email Sender │
└─────────────────┘ └──────────────────┘ └─────────────────┘
│ │ │
▼ ▼ ▼
┌─────────────────┐ ┌──────────────────┐ ┌─────────────────┐
│ Cost Estimator │ │ Policy Engine │ │ Notification │
│ │ │ │ │ │
│ • Cloud APIs │ │ • Rule Evaluation│ │ • Slack Webhook │
│ • Pricing Data │ │ • Policy Matching│ │ • Email SMTP │
│ • Optimization │ │ • Scoring │ │ • Teams Channel │
│ • Budget Track │ │ • Exceptions │ │ • PagerDuty │
└─────────────────┘ └──────────────────┘ └─────────────────┘hcl # ❌ Bad - Unencrypted EBS volume resource "aws_ebs_volume" "example" { size = 100 # encrypted = false # Missing encryption }
# ✅ Good - Encrypted EBS volume resource "aws_ebs_volume" "example" { size = 100 encrypted = true }
hcl # ❌ Bad - Open to world resource "aws_security_group" "example" { ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = "0.0.0.0/0"] # Too open } }
# ✅ Good - Restricted access resource "aws_security_group" "example" { ingress { from_port = 22 to_port = 22 protocol = "tcp" cidr_blocks = "10.0.0.0/8"] # Restricted } }
yaml # ❌ Bad - No security context apiVersion: v1 kind: Pod spec: containers:
image: nginx # Missing security context
# ✅ Good - With security context apiVersion: v1 kind: Pod spec: securityContext: runAsNonRoot: true runAsUser: 1000 fsGroup: 2000 containers:
image: nginx securityContext: allowPrivilegeEscalation: false readOnlyRootFilesystem: true
yaml # ❌ Bad - No resource limits apiVersion: v1 kind: Pod spec: containers:
image: nginx # Missing resources section
# ✅ Good - With resource limits apiVersion: v1 kind: Pod spec: containers:
image: nginx resources: requests: memory: "64Mi" cpu: "250m" limits: memory: "128Mi" cpu: "500m"
The cost estimation uses a multi-factor approach:
The skill validates against multiple compliance frameworks:
Terraform Plan Parsing Errors
bash# Check Terraform version compatibility skill invoke iac-deployment-validator check-terraform-version # Validate plan file format skill invoke iac-deployment-validator validate-plan-format --plan-file terraform.plan # Debug parsing issues export IAC_VALIDATOR_DEBUG=true skill invoke iac-deployment-validator validate-terraform --plan-file terraform.plan --debug
Kubernetes Manifest Validation Failures
bash# Check YAML syntax skill invoke iac-deployment-validator validate-yaml --manifest-path deployment.yaml # Verify K8s API version compatibility skill invoke iac-deployment-validator check-api-version --manifest-path deployment.yaml # Test resource validation skill invoke iac-deployment-validator test-resource --manifest-path deployment.yaml
Cost Estimation Issues
bash# Check pricing API connectivity skill invoke iac-deployment-validator test-pricing-api --provider aws # Verify cost calculation skill invoke iac-deployment-validator debug-cost --config-path ./ --verbose # Update pricing data skill invoke iac-deployment-validator update-pricing --provider aws
bash# Enable comprehensive debugging export IAC_VALIDATOR_DEBUG=true export IAC_VALIDATOR_TRACE=true skill invoke iac-deployment-validator validate-terraform --plan-file terraform.plan \ --debug --trace --verbose
yaml# .github/workflows/iac-validation.yml name: IaC Validation on: [push, pull_request] jobs: validate-terraform: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup Terraform uses: hashicorp/setup-terraform@v1 - name: Terraform Plan run: terraform plan -out=tf.plan - name: Validate IaC run: | skill invoke iac-deployment-validator validate-terraform \ --plan-file tf.plan \ --check-security --check-cost --check-compliance \ --framework CIS - name: Upload Validation Report uses: actions/upload-artifact@v2 with: name: iac-validation-report path: validation-report.pdf validate-kubernetes: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Validate Kubernetes Manifests run: | skill invoke iac-deployment-validator validate-k8s \ --manifest-path k8s/ \ --check-security --check-resources --check-best-practices
bash#!/bin/sh # .git/hooks/pre-commit echo "Running IaC validation..." # Validate Terraform files if find . -name "*.tf" -print -quit | grep -q .; then terraform plan -out=tf.plan skill invoke iac-deployment-validator validate-terraform \ --plan-file tf.plan \ --severity-threshold high rm tf.plan fi # Validate Kubernetes manifests if find . -name "*.yaml" -o -name "*.yml" -print -quit | grep -q .; then skill invoke iac-deployment-validator validate-k8s \ --manifest-path . \ --severity-threshold medium fi echo "IaC validation passed!"
json// .vscode/settings.json { "iac-validator.autoValidate": true, "iac-validator.severityThreshold": "medium", "iac-validator.frameworks": ["CIS", "NIST"], "iac-validator.costEstimation": true, "iac-validator.notificationChannels": ["slack"] }
/docs/iac-deployment-validator.md/examples/iac-validation/#iac-validation Slack channelThis skill is licensed under the MIT License. See LICENSE file for details.
Other measured skills in the registry, with their headline benchmark lift.