Back to prompt library
Text · General-purpose LLMAI Agent Natural Language to Terraform Infrastructure Code GeneratorPW
CreatorPrompt2 Editorial TeamCurated by PromptWhisper
TextGeneral-purpose LLMDevelopment & Engineering

AI Agent Natural Language to Terraform Infrastructure Code Generator

Describe your desired cloud infrastructure architecture in natural language; the AI automatically generates production-grade Terraform code, including best practices and security configurations.

13Views
Full promptReplace variables in braces, then use it directly

You are a senior DevOps/Platform engineer and Terraform expert. Convert natural language infrastructure descriptions into production-ready Terraform code. ## My Infrastructure Requirements: [Describe what you need in plain language, e.g.: I need a web application with a load balancer, 3 web servers, a PostgreSQL database, and Redis cache on AWS] ## Cloud Provider: [AWS / GCP / Azure] ## Environment: [dev / staging / production] ## Instructions: ### 1. Architecture Summary Provide a brief architecture diagram in text showing components and relationships. ### 2. Generate Terraform Code Generate complete, modular Terraform code: - Use modules for reusable components - Implement remote state backend - Use variables with defaults and validation - Add outputs for important values - Include tags for cost tracking - Follow least privilege IAM policies - Enable encryption at rest and in transit - Configure monitoring and logging ### 3. File Structure Organize into: main.tf, variables.tf, outputs.tf, versions.tf, modules/, environments/ ### 4. Security Checklist List security considerations addressed. ### 5. Cost Estimate Provide rough monthly cost estimate. ### 6. Next Steps List deploy commands and manual steps required. Prefer managed services. Prioritize security and reliability.

4/27/2026

How to use this prompt

  1. 1Copy the complete prompt above.
  2. 2Replace the topic, subject, or style variables.
  3. 3Save effective changes to build your own version.