Terraform Modules
The Kubiya Control Plane Provider includes pre-built Terraform modules to help you quickly deploy common infrastructure patterns. These modules encapsulate best practices and reduce boilerplate code.Available Modules
engineering-org Module
A comprehensive module for creating a complete engineering organization setup. This module creates and manages all necessary resources for running AI agents in your organization. Module Source:kubiya/control-plane//modules/engineering-org
engineering-org Module
Overview
Theengineering-org module provides a complete infrastructure-as-code solution for setting up your AI agent organization. It creates all necessary resources including environments, projects, teams, agents, skills, policies, worker queues, and jobs.
Features
- Flexible Configuration: Use maps to create multiple instances of each resource type
- Sensible Defaults: Ready-to-use configuration for quick setup
- Easy Extension: Add or modify resources by updating variable maps
- Complete Setup: Creates all resources for a production-ready organization
- Automatic Dependencies: Handles relationships between resources automatically
- Resource References: Reference resources by name for easy relationship management
Resources Created
This module can create:| Resource Type | Description |
|---|---|
| Environments | Isolated execution environments for agents and workers |
| Projects | Organizational units for grouping related work |
| Teams | Groups of agents working together with shared configuration |
| Agents | AI-powered automation agents with custom LLM configurations |
| Skills | Reusable capabilities (shell, filesystem, docker) for agents |
| Policies | OPA Rego policies for governance and security |
| Worker Queues | Task queues for managing worker distribution |
| Jobs | Scheduled, webhook-triggered, or manual tasks |
Usage
Minimal Example (Using Defaults)
The simplest way to use the module is with all defaults:- 1 production environment
- 1 platform project
- 1 devops team
- 2 agents (deployer, monitor)
- 2 skills (shell, filesystem)
- 1 security policy
- 1 default worker queue
- 1 daily health check job
Custom Configuration Example
Customize the module by providing your own variable maps:Module Inputs
environments
Map of environments to create. Type:projects
Map of projects to create. Type:teams
Map of teams to create. Type:agents
Map of agents to create. Type:skills
Map of skills to create. Type:policies
Map of policies to create. Type:worker_queues
Map of worker queues to create. Type:jobs
Map of jobs to create. Type:Module Outputs
Resource Collections
environments- Map of created environments with full detailsprojects- Map of created projects with full detailsteams- Map of created teams with full detailsagents- Map of created agents with full detailsskills- Map of created skills with full detailspolicies- Map of created policies with full detailsworker_queues- Map of created worker queues with full detailsjobs- Map of created jobs with full details
ID Maps
environment_ids- Map of environment names to IDsproject_ids- Map of project names to IDsteam_ids- Map of team names to IDsagent_ids- Map of agent names to IDsskill_ids- Map of skill names to IDspolicy_ids- Map of policy names to IDsworker_queue_ids- Map of worker queue names to IDsjob_ids- Map of job names to IDs
Special Outputs
job_webhook_urls- Map of webhook job names to webhook URLs (sensitive)worker_queue_task_names- Map of queue names to task queue names for worker registrationsummary- Count of all created resources
Resource Relationships
The module automatically handles dependencies between resources:Team Assignment
Agents can reference teams using theteam_name field:
Environment References
Worker queues reference environments, and jobs can reference environments:Entity References
Jobs reference agents or teams:Best Practices
1. Start with Defaults
Begin with the default configuration and customize incrementally:2. Use Meaningful Resource Names
Map keys become part of resource names, so use clear, descriptive names:3. Organize by Environment
Create separate environments for different stages:4. Group Agents by Team
Organize agents into teams based on their function:5. Implement Policies Early
Define governance policies from the start:6. Create Dedicated Worker Queues
Use separate queues for different priorities:Advanced Patterns
Multi-Environment Setup
Create a complete multi-environment infrastructure:Module Composition
Combine multiple module instances:Troubleshooting
Resource Already Exists
If you see “resource already exists” errors:Dependency Errors
If you see dependency errors, verify resource names match:JSON Encoding
Always usejsonencode() for configuration fields:
Next Steps
- Resources Documentation - Detailed resource reference
- Examples - Complete end-to-end examples
- Provider Configuration - Provider setup
- Data Sources - Query existing resources