iac-generator
npx machina-cli add skill a5c-ai/babysitter/iac-generator --openclawFiles (1)
SKILL.md
2.3 KB
IaC Generator Skill
Generates Infrastructure as Code from existing infrastructure, supporting Terraform, CloudFormation, and other IaC frameworks.
Purpose
Enable infrastructure codification for:
- Resource discovery
- Terraform/CloudFormation generation
- Module structuring
- Variable extraction
- State management setup
Capabilities
1. Resource Discovery
- Scan cloud accounts
- Discover existing resources
- Map relationships
- Document configurations
2. Terraform/CloudFormation Generation
- Generate HCL/YAML code
- Create resource definitions
- Handle dependencies
- Support multiple clouds
3. Module Structuring
- Organize into modules
- Create reusable components
- Design folder structure
- Handle environments
4. Variable Extraction
- Extract configurable values
- Create variable files
- Document defaults
- Handle secrets
5. State Management Setup
- Configure remote state
- Set up locking
- Handle state imports
- Manage workspaces
6. Best Practice Enforcement
- Apply naming conventions
- Tag resources
- Implement security controls
- Add monitoring
Tool Integrations
| Tool | Cloud | Integration Method |
|---|---|---|
| Terraform | Multi | CLI |
| Pulumi | Multi | CLI |
| AWS CDK | AWS | CLI |
| Former2 | AWS | CLI |
| Terraformer | Multi | CLI |
| Azure Bicep | Azure | CLI |
Output Schema
{
"generationId": "string",
"timestamp": "ISO8601",
"infrastructure": {
"resources": "number",
"modules": "number",
"variables": "number"
},
"artifacts": {
"mainTf": "string",
"moduleDir": "string",
"variablesFile": "string",
"stateConfig": "string"
},
"imports": [],
"warnings": []
}
Integration with Migration Processes
- cloud-migration: Infrastructure provisioning
- containerization: Kubernetes IaC
Related Skills
cloud-readiness-assessor: Pre-migration assessmentcontainerization-assistant: Container infrastructure
Related Agents
cloud-migration-engineer: Infrastructure deploymentinfrastructure-migration-agent: IaC migration
Source
git clone https://github.com/a5c-ai/babysitter/blob/main/plugins/babysitter/skills/babysit/process/specializations/code-migration-modernization/skills/iac-generator/SKILL.mdView on GitHub Overview
Generates infrastructure-as-code from live environments, supporting Terraform and CloudFormation. It enables resource discovery, module structuring, variable extraction, and state management setup to accelerate modernization and repeatable deployments.
How This Skill Works
The tool scans cloud accounts to discover resources and relationships, then outputs Terraform HCL or CloudFormation YAML definitions with modular structures and variable files. It also configures remote state, handles dependencies, and enforces best practices during migration.
When to Use It
- You need to codify an existing cloud environment into Terraform or CloudFormation templates
- You want to organize resources into reusable modules with a scalable folder structure
- You must extract configurable values into variables and document defaults and secrets
- You are setting up remote state with locking and workspaces across environments
- You want to enforce naming conventions, tags, and security controls during migration
Quick Start
- Step 1: Run resource discovery across target cloud accounts to map resources and relationships
- Step 2: Generate Terraform or CloudFormation code with modules and variable files
- Step 3: Configure remote state with locking and integrate into your CI CD pipeline
Best Practices
- Start with resource discovery to map dependencies before codegen
- Design modular Terraform/CFN with clear module boundaries
- Extract variables with defaults and secure secret handling guidelines
- Configure remote state with locking and workspace management early
- Apply consistent naming, tagging, and security controls across resources
Example Use Cases
- Migrate a multi account AWS setup to Terraform modules for VPC, IAM, and apps with remote state in S3 and locking in DynamoDB
- Generate CloudFormation templates from a discovered AWS infrastructure and organize into environment specific parameter sets
- Create reusable modules for networks and databases and produce environment specific variable files
- Set up state configuration and imports for an ongoing IaC migration project
- Enforce naming conventions and resource tags across migrated resources
Frequently Asked Questions
Add this skill to your agents