Towards Reliable Agentic Infrastructure Provisioning with LLMs
Abstract
Kubernetes (K8s) is widely used to orchestrate containerized workloads, yet provisioning reliable and maintainable clusters requires substantial DevOps and cloud-infrastructure expertise. This paper presents an LLM-based Infrastructure-as-Code workflow for Amazon Elastic Kubernetes Service (EKS) that combines retrieval-augmented generation (RAG) with a bounded validation-and-repair loop. The workflow retrieves contextual examples from a curated Terraform knowledge base, generates infrastructure configurations, validates them, and returns recoverable errors to the model for correction. We evaluate the approach through two complementary studies. First, an exploratory infrastructure-provisioning benchmark assesses six commercial LLMs across five prompt variants using the complete retrieval-and-repair workflow to provision AWS EKS infrastructure. Second, a controlled 2 × 2 ablation independently enables and disables retrieval and iterative repair for three representative models. This ablation includes five prompt variants and three repetitions per model-condition combination, totaling 180 plan-only executions. Under the complete workflow, Terraform plan success reached 100% for Claude Opus 4.5, 93.3% for GPT-4.1, and 100% for Gemini 3.1 Pro, compared with one-shot baseline rates of 86.7%, 0%, and 46.7%, respectively. The results show that retrieval and repair have model-dependent effects, while their combination achieved the highest or joint-highest plan success for all reevaluated models.