Skip to main content

Terraform Code Generation

Terraform Code Generation helps turn cloud infrastructure intent into reviewable Terraform changes.

What it does

  • Inspects connected cloud resources when access is available.
  • Generates Terraform files from your request.
  • Opens a pull request in your infrastructure repository when VCS is configured.
  • Keeps humans in the review and merge path.

Requirements

  • DevOps Genie Agent deployed and live.
  • Connected cloud account for the resources you want to inspect.
  • VCS authentication.
  • vcs.infrastructureRepoUrl configured in the agent Helm values.
  • Optional vcs.infrastructureRepoPath when Terraform lives in a subdirectory.

Configuration

vcs:
provider: github
infrastructureRepoUrl: "https://github.com/example-org/infrastructure.git"
infrastructureRepoPath: "terraform/"

Store VCS secrets through Kubernetes Secrets or your external secret manager. See Configure VCS Access.

Example prompt

Generate Terraform for my production S3 buckets and open a pull request.

Review expectations

Generated Terraform should be reviewed before merge. Existing resources may still require your team to handle Terraform state import and environment-specific module conventions.

Troubleshooting

If this capability is not ready, check Integrations > Capabilities and see Capability Readiness.