Agent skill
iac-skill
Infrastructure as Code with Terraform, Ansible, and CloudFormation.
Install this agent skill to your Project
npx add-skill https://github.com/pluginagentmarketplace/custom-plugin-devops/tree/main/skills/iac
SKILL.md
Infrastructure as Code Skill
Overview
Master IaC with Terraform, Ansible, and CloudFormation for automated infrastructure.
Parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
| tool | string | No | terraform | IaC tool |
| operation | string | Yes | - | Operation type |
Core Topics
MANDATORY
- Terraform HCL syntax and providers
- State management and locking
- Modules and workspaces
- Ansible playbooks and roles
- Inventory management
OPTIONAL
- CloudFormation templates
- Pulumi and CDK
- Testing IaC (terratest)
- Secret management
ADVANCED
- Custom providers
- Complex module design
- Multi-cloud strategies
- Drift detection
Quick Reference
# Terraform
terraform init
terraform plan -out=plan.tfplan
terraform apply plan.tfplan
terraform destroy
terraform fmt -recursive
terraform validate
terraform state list
terraform import aws_instance.web i-123
# State Management
terraform state mv old new
terraform state rm resource
terraform force-unlock LOCK_ID
# Ansible
ansible-playbook -i inventory playbook.yml
ansible-playbook playbook.yml --check --diff
ansible-playbook playbook.yml --tags nginx
ansible all -m ping -i inventory
ansible-vault encrypt secrets.yml
Troubleshooting
Common Failures
| Symptom | Root Cause | Solution |
|---|---|---|
| State lock | Concurrent ops | Wait or force-unlock |
| Resource exists | Drift | Import or delete |
| Provider auth | Credentials | Check AWS_PROFILE |
| Cycle error | Dependencies | Restructure |
Debug Checklist
- Validate:
terraform validate - Check state:
terraform state list - Debug:
TF_LOG=DEBUG terraform plan - Verify credentials
Recovery Procedures
Corrupted State
- Restore from S3 versioning
- Or import:
terraform importfor each resource
Resources
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
gitops
GitOps practices with ArgoCD, FluxCD, and declarative infrastructure management
version-control
Git version control, branching strategies, GitHub/GitLab workflows, and collaborative development
containers-skill
Docker and Kubernetes - containerization, orchestration, and production deployment.
scripting
DevOps scripting with Bash, Python, and Go for automation, tooling, and infrastructure management
monitoring-skill
Monitoring and observability with Prometheus, Grafana, ELK Stack, and distributed tracing.
serverless
Serverless computing with AWS Lambda, Azure Functions, Google Cloud Functions, and edge computing
Didn't find tool you were looking for?