High-Quality Prompt for Terraform Project Generation.

 

Beautiful, High-Quality Prompt for Terraform Project Generation

before executing this prompt in visual studio code copilot / or any IDE, ensure 
1. we have MCP Server for terraform and filesystem mcp server is already installed.  

extend if you want to update for number of resources.. 

Create a complete Terraform project with the following requirements:

📁 1. Folder Structure

  • Create a root folder named terraform-rak in C:\drive.

  • Inside this folder, create separate .tf files for each module or resource.

📄 2. Core Terraform Files

  1. variables.tf

    • Define all variables required by the project.

  2. variables_development.tfvars

    • Store all variable values for the development environment.

  3. backend.tf

    • Configure a remote backend using an Azure Storage Account.

    • Ensure the Terraform state file is stored in a storage container.

🌐 3. Azure Resources (Each in Its Own File Using Azure Verified Modules)

🔹 Resource Group

🔹 Virtual Network

  • File: vnet.tf

  • Create a virtual network.

  • use Azure verified modules

  • - VNet with 10.0.0.0/16 address space

      - Main subnet (10.0.1.0/24) with Container Apps delegation

      - Private endpoint subnet (10.0.2.0/24)

🔹 Subnet

🔹 Network Security Group (NSG)

🔹 NSG Rules

  • File: network_security_rules.tf

  • Create security rules and:

    • Associate them with the NSG.

    • Associate the NSG with the subnet.

    • Use Azure Verified Modules

🔹 Route Table

  • File: route_table.tf

  • Create a route table with:

    • A route to the internet

    • A route to a virtual appliance (ASA firewall IP address)

    • Use Azure Verified Modules

🔹 Azure Container Apps Environment (CAE)

🔹 Container App

  • File: container_app.tf

  • Deploy a Container App and store its configuration here.

  • Use Azure Verified Modules

  • enable system-assigned identity.

🔹 Azure Container Registry

  • File: container_registry.tf

  • Create an Azure Container Registry.

  • use Azure verified moduled 

  • ensure RBAC and ABACs are configured

  • create private endpoint

  •   - Azure Container Registry (Premium SKU)

      - Container Apps Environment with VNet integration

      - Container App with auto-scaling (1-10 replicas)

      - Health probes (liveness and readiness)

      - RBAC integration between Container Apps and ACR

🔍 4. Diagnostics & Monitoring


Additional Requirements


Final Output Expectation

Generate:

  • A complete folder structure

  • Individual .tf files with correct module references and dependencies

  • A working Terraform configuration ready to run with:

No comments:

Post a Comment