Skip to content

Latest commit

 

History

History
559 lines (437 loc) · 14.8 KB

File metadata and controls

559 lines (437 loc) · 14.8 KB

Terraform to Azure Pricing Mapping Reference

Complete Resource Mapping Table

This document lists all Terraform resources currently supported by the PricingCalculator MCP Server for Microsoft Azure and their exact mapping to Microsoft Azure Pricing API.

Supported Resources Summary

# Terraform Resource Azure Service Status
1 azurerm_linux_virtual_machine Virtual Machines ✅ Full support + Discovery
2 azurerm_windows_virtual_machine Virtual Machines ✅ Full support + Discovery
3 azurerm_virtual_machine Virtual Machines ✅ Full support + Discovery
4 azurerm_kubernetes_cluster Virtual Machines (nodes) ✅ Full support + Discovery
5 azurerm_storage_account Storage ✅ Full support
6 azurerm_public_ip Virtual Network ✅ Full support
7 azurerm_mysql_server Azure Database for MySQL ✅ Full support
8 azurerm_postgresql_server Azure Database for PostgreSQL ✅ Full support
9 azurerm_mssql_database SQL Database ✅ Full support
10 azurerm_cosmosdb_account Azure Cosmos DB ✅ Basic support
11 azurerm_app_service_plan Azure App Service ✅ Full support

Total: 11 resource types supported


Detailed Mapping Reference

1. Linux Virtual Machine

Property Value
Terraform Resource azurerm_linux_virtual_machine
Azure Service Name Virtual Machines
Terraform Field (SKU) size
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern Linux
Quantity Extraction 1 (single VM)
Default SKU Standard_D2s_v3
Discovery Tool discoverVmOptions

Example Terraform:

resource "azurerm_linux_virtual_machine" "vm" {
  name     = "myvm"
  location = "eastus"
  size     = "Standard_D2s_v3"  # ← Extracted as SKU
  # ...
}

SKU Examples: Standard_D2s_v3, Standard_E4s_v3, Standard_F2s_v2

Documentation: virtual-machines.md


2. Windows Virtual Machine

Property Value
Terraform Resource azurerm_windows_virtual_machine
Azure Service Name Virtual Machines
Terraform Field (SKU) size
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern Windows
Quantity Extraction 1 (single VM)
Default SKU Standard_D2s_v3
Discovery Tool discoverVmOptions

Example Terraform:

resource "azurerm_windows_virtual_machine" "vm" {
  name     = "myvm"
  location = "eastus"
  size     = "Standard_D4s_v3"  # ← Extracted as SKU
  # ...
}

SKU Examples: Standard_D2s_v3, Standard_E4s_v3, Standard_B2s

Documentation: virtual-machines.md


3. Virtual Machine (Legacy)

Property Value
Terraform Resource azurerm_virtual_machine
Azure Service Name Virtual Machines
Terraform Field (SKU) vm_size
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern (not specified)
Quantity Extraction 1 (single VM)
Default SKU Standard_D2s_v3
Discovery Tool discoverVmOptions

Example Terraform:

resource "azurerm_virtual_machine" "vm" {
  name     = "myvm"
  location = "eastus"
  vm_size  = "Standard_D2s_v3"  # ← Extracted as SKU (note: vm_size, not size)
  # ...
}

Note: This is the legacy Terraform resource. Prefer azurerm_linux_virtual_machine or azurerm_windows_virtual_machine.

Documentation: virtual-machines.md


4. Kubernetes Cluster (AKS)

Property Value
Terraform Resource azurerm_kubernetes_cluster
Azure Service Name Virtual Machines
Terraform Field (SKU) default_node_pool.vm_size
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern (not specified)
Quantity Extraction default_node_pool.node_count (default: 3)
Default SKU Standard_D2s_v3
Discovery Tool discoverVmOptions

Example Terraform:

resource "azurerm_kubernetes_cluster" "aks" {
  name     = "myaks"
  location = "eastus"
  
  default_node_pool {
    name       = "default"
    node_count = 3          # ← Extracted as quantity
    vm_size    = "Standard_D4s_v3"  # ← Extracted as SKU
  }
  # ...
}

Important:

  • Cost = VM price × node_count
  • Only default_node_pool is currently considered
  • Additional node pools are not yet calculated

Documentation: virtual-machines.md


5. Storage Account

Property Value
Terraform Resource azurerm_storage_account
Azure Service Name Storage
Terraform Field (SKU) account_tier + account_replication_type
SKU Field Type skuName
Unit of Measure 1 GB/Month
Product Name Pattern (not specified)
Quantity Extraction 1 (per GB)
Default SKU Standard LRS
Discovery Tool ❌ None (planned)

Example Terraform:

resource "azurerm_storage_account" "storage" {
  name                     = "mystorage"
  location                 = "eastus"
  account_tier             = "Standard"  # ← Combined
  account_replication_type = "LRS"       # ← to form "Standard LRS"
  # ...
}

SKU Format: <tier> <replication>

SKU Examples:

  • Standard LRS (Standard Locally Redundant Storage)
  • Standard GRS (Standard Geo-Redundant Storage)
  • Premium LRS (Premium Locally Redundant Storage)

Documentation: storage.md


6. Public IP Address

Property Value
Terraform Resource azurerm_public_ip
Azure Service Name Virtual Network
Terraform Field (SKU) allocation_method
SKU Field Type skuName
Unit of Measure 1/Month
Product Name Pattern (not specified)
Quantity Extraction 1 (single IP)
Default SKU IP Addresses - Static
Discovery Tool ❌ None

Example Terraform:

resource "azurerm_public_ip" "ip" {
  name              = "myip"
  location          = "eastus"
  allocation_method = "Static"  # ← Extracted as "IP Addresses - Static"
  # ...
}

SKU Format: IP Addresses - <allocation_method>

SKU Examples:

  • IP Addresses - Static
  • IP Addresses - Dynamic

Documentation: other-resources.md


7. MySQL Server

Property Value
Terraform Resource azurerm_mysql_server
Azure Service Name Azure Database for MySQL
Terraform Field (SKU) sku_name
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern (not specified)
Quantity Extraction 1 (single server)
Default SKU GP_Gen5_2
Discovery Tool ❌ None (planned)

Example Terraform:

resource "azurerm_mysql_server" "db" {
  name     = "mydb"
  location = "eastus"
  sku_name = "GP_Gen5_2"  # ← Extracted as SKU
  # ...
}

SKU Format: <Tier>_Gen<Hardware>_<vCores>

SKU Examples:

  • B_Gen5_1 (Basic, 1 vCore)
  • GP_Gen5_2 (General Purpose, 2 vCores)
  • MO_Gen5_4 (Memory Optimized, 4 vCores)

Documentation: databases.md


8. PostgreSQL Server

Property Value
Terraform Resource azurerm_postgresql_server
Azure Service Name Azure Database for PostgreSQL
Terraform Field (SKU) sku_name
SKU Field Type armSkuName
Unit of Measure 1 Hour
Product Name Pattern (not specified)
Quantity Extraction 1 (single server)
Default SKU GP_Gen5_2
Discovery Tool ❌ None (planned)

Example Terraform:

resource "azurerm_postgresql_server" "db" {
  name     = "mydb"
  location = "westeurope"
  sku_name = "GP_Gen5_4"  # ← Extracted as SKU
  # ...
}

SKU Format: <Tier>_Gen<Hardware>_<vCores> (same as MySQL)

SKU Examples:

  • B_Gen5_1 (Basic, 1 vCore)
  • GP_Gen5_2 (General Purpose, 2 vCores)
  • MO_Gen5_8 (Memory Optimized, 8 vCores)

Documentation: databases.md


9. SQL Database

Property Value
Terraform Resource azurerm_mssql_database
Azure Service Name SQL Database
Terraform Field (SKU) sku_name
SKU Field Type skuName
Unit of Measure (varies by SKU)
Product Name Pattern (not specified)
Quantity Extraction 1 (single database)
Default SKU S0
Discovery Tool ❌ None (planned)

Example Terraform:

resource "azurerm_mssql_database" "db" {
  name      = "mydb"
  server_id = azurerm_mssql_server.server.id
  sku_name  = "S0"  # ← Extracted as SKU
  # ...
}

SKU Format:

  • DTU Model: S0, S1, S2, P1, P2, etc.
  • vCore Model: GP_Gen5_2, BC_Gen5_4, etc.

SKU Examples:

  • DTU: Basic, S0, S1, P1, P2
  • vCore: GP_Gen5_2, BC_Gen5_4, HS_Gen5_2

Documentation: databases.md


10. Cosmos DB Account

Property Value
Terraform Resource azurerm_cosmosdb_account
Azure Service Name Azure Cosmos DB
Terraform Field (SKU) (always "Standard")
SKU Field Type skuName
Unit of Measure (complex: RU/s + storage)
Product Name Pattern (not specified)
Quantity Extraction 1 (single account)
Default SKU Standard
Discovery Tool ❌ None

Example Terraform:

resource "azurerm_cosmosdb_account" "db" {
  name                = "mycosmosdb"
  location            = "eastus"
  offer_type          = "Standard"  # ← Always "Standard"
  # ...
}

Important: Cosmos DB pricing is complex:

  • Base account cost
  • Throughput (RU/s)
  • Storage (GB/Month)
  • Multi-region replication

Current implementation provides basic cost estimation only.

Documentation: storage.md


11. App Service Plan

Property Value
Terraform Resource azurerm_app_service_plan
Azure Service Name Azure App Service
Terraform Field (SKU) sku.size
SKU Field Type skuName
Unit of Measure 1 Hour
Product Name Pattern (not specified)
Quantity Extraction 1 (single plan)
Default SKU B1
Discovery Tool ❌ None (planned)

Example Terraform:

resource "azurerm_app_service_plan" "plan" {
  name     = "myplan"
  location = "eastus"
  
  sku {
    tier = "Standard"
    size = "S1"  # ← Extracted as SKU
  }
  # ...
}

SKU Format: <Tier><Number>[Version]

SKU Examples:

  • Basic: B1, B2, B3
  • Standard: S1, S2, S3
  • Premium: P1V2, P2V2, P3V2, P1V3, P2V3

Documentation: other-resources.md


Code Reference

All mappings are defined in:

src/terraform/ResourceMapper.ts

The main mapping object is:

export const TERRAFORM_TO_AZURE_MAPPINGS: Record<string, ResourceMapping>

Discovery Tool Status

Resource Type Has Discovery Tool? Priority
Virtual Machines discoverVmOptions -
Storage Account ❌ Planned High
Public IP ❌ Not planned Low
MySQL ❌ Planned Medium
PostgreSQL ❌ Planned Medium
SQL Database ❌ Planned Medium
Cosmos DB ❌ Not planned Low
App Service Plan ❌ Planned Medium
Kubernetes (AKS) ✅ Uses VM discovery -

Unsupported Resources

The following Azure resources are not currently supported:

Compute

  • azurerm_container_group
  • azurerm_batch_account
  • azurerm_virtual_machine_scale_set
  • azurerm_function_app

Networking

  • azurerm_application_gateway
  • azurerm_firewall
  • azurerm_vpn_gateway
  • azurerm_express_route_circuit

Data & Analytics

  • azurerm_databricks_workspace
  • azurerm_synapse_workspace
  • azurerm_data_factory
  • azurerm_stream_analytics_job

Storage

  • azurerm_managed_disk
  • azurerm_netapp_account

Other

  • azurerm_cognitive_account
  • azurerm_search_service
  • azurerm_signalr_service
  • azurerm_redis_cache

To add support for a new resource type, see: Adding New Resources


Usage Examples

Check if Resource is Supported

import { ResourceMapper } from './terraform/ResourceMapper.js';

const isSupported = ResourceMapper.isSupported('azurerm_linux_virtual_machine');
// true

const notSupported = ResourceMapper.isSupported('azurerm_redis_cache');
// false

Get All Supported Types

const supportedTypes = ResourceMapper.getSupportedTypes();
// [
//   'azurerm_linux_virtual_machine',
//   'azurerm_windows_virtual_machine',
//   ...
// ]

Map Terraform to Azure Filter

const config = {
  size: 'Standard_D2s_v3',
  location: 'eastus'
};

const result = ResourceMapper.mapToAzureFilter('azurerm_linux_virtual_machine', config);
// {
//   filter: {
//     serviceName: 'Virtual Machines',
//     armRegionName: 'eastus',
//     armSkuName: 'Standard_D2s_v3',
//     unitOfMeasure: '1 Hour',
//     productName: 'Linux'
//   },
//   quantity: 1
// }

Verification Checklist

Use this checklist to verify a resource is fully documented:

  • Resource listed in this mapping reference
  • Mapping exists in ResourceMapper.ts
  • Documented in relevant doc file (vm/storage/databases/other)
  • Example Terraform config provided
  • SKU format explained
  • Default SKU specified
  • Discovery tool status indicated
  • Unit of measure documented

See Also


Last Updated: 2026-02-28
Total Supported Resources: 11


Legal Notice

Microsoft, Azure, Terraform, and GitHub are trademarks of their respective owners.

This is an independent open-source project and is not affiliated with, endorsed by, or sponsored by Microsoft Corporation, HashiCorp, Inc., or GitHub, Inc.

This tool is designed to work with Microsoft Azure services and the Terraform infrastructure-as-code tool.