provider "azurerm" {
features {}
}
resource "azurerm_resource_group" "rg" {
name = "rg-bank-rag-dev-centralus"
location = "Central US"
}
# App Service / Web App (Frontend)
resource "azurerm_service_plan" "app_plan" {
name = "plan-rag-dev"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
os_type = "Linux"
sku_name = "B1"
}
resource "azurerm_linux_web_app" "webapp" {
name = "app-bank-rag-dev"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
service_plan_id = azurerm_service_plan.app_plan.id
site_config {}
}
# Azure AI Search & OpenAI
resource "azurerm_search_service" "search" {
name = "srch-bank-rag-dev"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
sku = "basic"
}
resource "azurerm_cognitive_account" "openai" {
name = "oai-bank-rag-dev"
location = azurerm_resource_group.rg.location
resource_group_name = azurerm_resource_group.rg.name
kind = "OpenAI"
sku_name = "S0"
}
# Databases (SQL & PostgreSQL Flexible)
resource "azurerm_postgresql_flexible_server" "pgsql" {
name = "psql-bank-rag-dev"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
version = "14"
sku_name = "B_Standard_B1ms"
}
Estimated non-production running costs for the RAG Data Governance setup:
| Resource | Tier / SKU | Est. Usage | Estimated Cost (USD) |
|---|---|---|---|
| Azure Web App | B1 (Basic Linux) | 730 hours (1 instance) | $13.14 |
| Azure AI Studio / ML | Basic Workspace | Compute Instances (Scale-to-0) | $5.00 |
| Azure AI Search | Basic Tier | 1 Search Unit | $73.73 |
| Azure OpenAI | S0 / Pay-As-You-Go | ~1M Tokens (GPT-4o / Embeddings) | $20.00 |
| Azure SQL Database | Basic (5 DTU) | 730 hours | $4.99 |
| Azure PostgreSQL | Flexible Server (B1ms) | 730 hours + 32GB Storage | $15.20 |
* Prices are approximate based on public Azure pricing for Central US region. Bandwidth and exact token consumption will vary.