Skip to main content

AWS Orchestrator Capabilities

This page covers what the AWS Orchestrator can do — the workflows it supports, the quality rules it enforces, and the governance model that keeps your infrastructure safe.


What it generates

Every module produced by the AWS Orchestrator is a complete, production-ready directory. The exact file set depends on the service — the planner's skill blueprint decides what's needed.

Core files (always generated)

FilePurpose
main.tfResource definitions with security best practices
variables.tfTyped, validated, documented variables — no hardcoded values
outputs.tfAll useful outputs with try() for conditional resources
versions.tfProvider and Terraform version constraints
locals.tfComputed values and tag merging
README.mdUsage example, inputs table, outputs table, requirements

Conditional files (generated when the service needs them)

FileWhen Generated
iam.tfServices requiring extensive IAM roles (EKS, Lambda, ECS)
policies.tfIAM policies, SCPs, permission boundaries
security_groups.tfServices with complex security group rules (EKS, ALB, RDS)
data.tfData sources — AMI lookups, SSM parameters, existing VPCs
templates.tfUser-data scripts, Helm values, rendered configs

Example output for an S3 bucket module:

workspace/terraform_modules/s3/
├── main.tf # S3 bucket + encryption + versioning + lifecycle
├── variables.tf # Typed variables for all configurable properties
├── outputs.tf # Bucket ARN, ID, domain name with try() guards
├── versions.tf # AWS provider >= 5.40.0
├── locals.tf # Tag merging, computed naming
├── policies.tf # Bucket policy for cross-region replication
└── README.md # Complete usage example with inputs/outputs tables

Generation quality rules

The agent enforces strict coding conventions through hardcoded prompt regulations — these are not suggestions, they are non-negotiable rules the generator must follow:

RuleImplementation
Never hardcode valuesRegions, account IDs, and credentials are always variables
Provider version locking>= x.y.z constraints in versions.tf — prevents breaking API updates
Merge taggingEvery resource gets merge({"Name" = ...}, var.tags, var.<resource>_tags)
Conditional resourcescount for simple on/off guards, for_each for collections
Safe outputstry(resource[0].id, null) for resources guarded by count
Variable documentationEvery variable description must be a non-empty string
Security enforcementCIS benchmarks, least-privilege IAM, encryption at rest, VPC flow logs
No bundlingGenerator writes the exact files declared in the skill — never bundles everything into main.tf

AWS service coverage

The AWS Orchestrator supports any service in the AWS Terraform provider. It doesn't have a hardcoded list — the planner researches each service dynamically via the Terraform Registry MCP server.

Commonly generated modules include:

CategoryServices
NetworkingVPC, Subnets, NAT Gateway, Transit Gateway, Route53
ComputeEC2, EKS, ECS, Lambda, Auto Scaling Groups
StorageS3, EFS, EBS
DatabaseRDS, DynamoDB, ElastiCache, Aurora
SecurityIAM, KMS, Security Groups, WAF
ApplicationAPI Gateway, CloudFront, ALB, NLB
MonitoringCloudWatch, SNS, SQS

Workflow: New Module

The full pipeline for generating a new Terraform module:

Step-by-step

StepAgentWhat Happens
1CoordinatorChecks if /skills/{service}-module-generator/SKILL.md exists and is current
2tf-plannerRuns 3-phase pipeline: requirements → security → execution planning → writes SKILL.md
3tf-skill-builderCreates skill files — skipped if planner already wrote them
4tf-generatorReads SKILL.md and references, writes all .tf files to virtual filesystem
5CoordinatorCalls sync_workspace to materialise files to real disk
6tf-validatorRuns terraform init -input=false, fmt -check, validate in sandbox
7CoordinatorIf INVALID: re-dispatches generator with errors → sync → validate again
8CoordinatorIf VALID: triggers Commit Gate (mandatory HITL)
9github-agentOn approval: commits files via GitHub MCP. On "keep local": reports paths
10CoordinatorTriggers Next Steps Gate (mandatory HITL): generate another, update, or done

Workflow: Update Module

The pipeline for modifying an existing module on GitHub:

StepAgentWhat Happens
1update-plannerFetches current module from GitHub, analyses structure, produces change plan
2tf-updaterFetches files via GitHub MCP, applies surgical edits (never full rewrites)
3CoordinatorCalls sync_workspace
4tf-validatorValidates the modified module
5CoordinatorIf INVALID: re-dispatches updater with errors
6CoordinatorIf VALID: triggers Commit GateNext Steps Gate

Key difference from new modules: the updater preserves existing formatting and conventions. It only touches files that need changing and tracks file SHAs for clean GitHub commits.


The skill system: how the agent avoids hallucination

The skill system is the core mechanism that prevents the generator from hallucinating provider configurations:

The generator reads the skill blueprint — not its training data — for:

  • Which .tf files to create
  • Exact resource arguments and types
  • Variable schemas with defaults and validation
  • Output definitions
  • Provider version constraints

This means the generated code uses the latest provider API, not stale patterns from the model's training cutoff.


Validation & self-healing

The validation loop is designed to catch and fix errors automatically — but with guardrails to prevent infinite loops:

Triple-check validation

terraform init -input=false -no-color
terraform fmt -check
terraform validate

Self-healing flow

  1. tf-validator runs the triple-check on generated files
  2. If errors are found → structured error details are returned (INVALID: [file:line: error])
  3. Coordinator re-dispatches tf-generator with the error context
  4. Generator fixes the issues and writes corrected files
  5. sync_workspacetf-validator runs again
  6. If it fails again after retry, the coordinator reports errors and stops — no infinite loops

Failure guards

GuardLimitBehavior
write_file failures3 attemptsGenerator stops and returns FAILED with error details
execute path errors3 attemptsValidator stops and returns INVALID: directory not found
Total write calls20 (middleware)Middleware forces stop with error message
Total tool calls60 (middleware)Middleware forces graceful termination

Human-in-the-Loop governance

Infrastructure changes are irreversible. A bad terraform apply can take down production. So the agent doesn't just generate and commit — it pauses at critical gates.

Mandatory gates (never skipped)

GateWhenWhat it asks
Commit GateAfter validation passesPush to GitHub or keep local? Which repo and branch?
Next Steps GateAfter task completionGenerate another module? Update an existing one? Done?
Destructive OpsBefore deleting modules or force-pushingExplicit human approval

Optional gates (agent's discretion)

GateWhenExample
Ambiguous RequirementsRequest is vague or has multiple valid interpretations"Create a VPC" → which region? How many AZs?
Cost-Sensitive DecisionsArchitecture choice significantly affects cloud costsNAT gateway per AZ vs. shared, dedicated vs. shared tenancy

Self-improving policies

The HITL policy lives in /memories/hitl-policies.md. The coordinator reads it at the start of every session. If it discovers a new situation that should require human input, it updates the file — so the system gets smarter over time.