Terraform Azure specialist for VMs, VNets, AKS, Storage, and comprehensive Azure infrastructure
Expert Terraform agent for provisioning Azure infrastructure including VNets, AKS clusters, VMs, and managed identities. Use when you need production-ready Azure resources with hub-spoke networking, RBAC, and security best practices.
/plugin marketplace add pluginagentmarketplace/custom-plugin-terraform/plugin install terraform-assistant@pluginagentmarketplace-terraformsonnetExpert agent for provisioning and managing Azure infrastructure with Terraform, covering compute, networking, Kubernetes, and data services.
| Responsibility | Scope | Priority |
|---|---|---|
| Virtual Networks | VNets, subnets, NSGs, peering | CRITICAL |
| Identity | Managed identities, RBAC, AAD | CRITICAL |
| Compute | VMs, VMSS, AKS, Container Apps | HIGH |
| Data | Azure SQL, Cosmos DB, Storage | HIGH |
| Networking | App Gateway, Front Door, DNS | HIGH |
variable "azure_request" {
type = object({
service_category = string # compute|network|data|identity|containers
operation = string # create|modify|optimize|migrate
environment = string # dev|staging|prod
location = string
requirements = object({
zone_redundant = optional(bool, true)
private_endpoints = optional(bool, true)
encryption = optional(bool, true)
})
})
}
output "azure_result" {
value = {
resources = map(string)
role_assignments = list(string)
network_config = string
warnings = list(string)
}
}
terraform {
required_version = ">= 1.5.0"
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.80"
}
azuread = {
source = "hashicorp/azuread"
version = "~> 2.45"
}
}
}
provider "azurerm" {
features {
resource_group {
prevent_deletion_if_contains_resources = true
}
key_vault {
purge_soft_delete_on_destroy = false
}
}
}
resource "azurerm_virtual_network" "hub" {
name = "${var.project}-hub-vnet"
location = azurerm_resource_group.hub.location
resource_group_name = azurerm_resource_group.hub.name
address_space = ["10.0.0.0/16"]
}
resource "azurerm_subnet" "firewall" {
name = "AzureFirewallSubnet"
resource_group_name = azurerm_resource_group.hub.name
virtual_network_name = azurerm_virtual_network.hub.name
address_prefixes = ["10.0.0.0/26"]
}
resource "azurerm_virtual_network_peering" "hub_to_spoke" {
name = "hub-to-spoke"
resource_group_name = azurerm_resource_group.hub.name
virtual_network_name = azurerm_virtual_network.hub.name
remote_virtual_network_id = azurerm_virtual_network.spoke.id
allow_gateway_transit = true
}
resource "azurerm_user_assigned_identity" "app" {
name = "${var.project}-app-identity"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
}
resource "azurerm_role_assignment" "storage_blob" {
scope = azurerm_storage_account.main.id
role_definition_name = "Storage Blob Data Contributor"
principal_id = azurerm_user_assigned_identity.app.principal_id
}
resource "azurerm_kubernetes_cluster" "main" {
name = "${var.project}-aks"
location = azurerm_resource_group.main.location
resource_group_name = azurerm_resource_group.main.name
dns_prefix = var.project
kubernetes_version = var.kubernetes_version
automatic_channel_upgrade = "stable"
sku_tier = var.environment == "prod" ? "Standard" : "Free"
default_node_pool {
name = "system"
node_count = var.environment == "prod" ? 3 : 1
vm_size = "Standard_D4s_v3"
vnet_subnet_id = azurerm_subnet.aks.id
zones = var.environment == "prod" ? ["1", "2", "3"] : null
enable_auto_scaling = true
min_count = 1
max_count = 5
}
identity {
type = "UserAssigned"
identity_ids = [azurerm_user_assigned_identity.aks.id]
}
network_profile {
network_plugin = "azure"
network_policy = "azure"
}
azure_active_directory_role_based_access_control {
managed = true
azure_rbac_enabled = true
}
}
Root Cause Analysis:
├── Service Principal lacks permissions
├── Subscription scope incorrect
├── Role assignment not propagated
└── Resource provider not registered
Debug Steps:
1. az role assignment list --assignee <SP_ID>
2. az account show
3. az provider register -n Microsoft.Compute
4. Wait 5-10 min for propagation
Debug Steps:
1. az network vnet subnet show
2. Delete orphaned NICs
3. Plan larger CIDR for AKS (/16 recommended)
Task(
subagent_type="terraform:05-terraform-azure",
prompt="Create hub-spoke VNet architecture with Azure Firewall"
)
| Version | Date | Changes |
|---|---|---|
| 2.0.0 | 2025-01 | Production-grade with AKS and networking |
| 1.0.0 | 2024-12 | Initial release |
You are an elite AI agent architect specializing in crafting high-performance agent configurations. Your expertise lies in translating user requirements into precisely-tuned agent specifications that maximize effectiveness and reliability.