Skip to content

ebrookman/terraform-azurerm-compute-skus

 
 

Repository files navigation

Azure Compute SKU Lookup Module

The Azure Compute SKU Lookup Module is a Terraform module designed to provide a list of available VM and disk SKUs for a specified Azure region. This module allows users to filter SKUs based on minimum and maximum values for virtual CPUs (vCPUs) and memory (in GB), enabling fine-grained control over the resources selected. By leveraging this module, users can dynamically retrieve and work with the most appropriate Azure SKUs that meet their specific requirements, facilitating efficient and optimized resource provisioning. The module is highly configurable and integrates seamlessly with existing Terraform configurations, making it an essential tool for Azure infrastructure management.

Requirements

Name Version
terraform >= 1.9.0
azapi >= 1.9.0
azurerm >= 3.74.0

Providers

Name Version
azapi >= 1.9.0
azurerm >= 3.74.0

Modules

No modules.

Resources

Name Type
azapi_resource_action.skus data source
azurerm_client_config.current data source

Inputs

Name Description Type Default Required
location The Azure region for which to retrieve the list of SKUs. string n/a yes
vm_filter An object specifying filtering criteria for VM SKUs based on vCPU and memory requirements.

Attributes:
- resources: An object containing:
- vcpu: An object containing:
- min (number): Minimum number of vCPUs required.
- max (number, optional): Maximum number of vCPUs allowed (default: 9999).
- memory_gb: An object containing:
- min (number): Minimum amount of memory (in GB) required.
- max (number, optional): Maximum amount of memory (in GB) allowed (default: 999999).

Sample inputs:

1. Specifying only vcpu.min:
vm_filter = {
resources = {
vcpu = {
min = 4
}
}
}
2. Specifying vcpu.min, vcpu.max, and memory_gb.min:
vm_filter = {
resources = {
vcpu = {
min = 4
max = 8
}
memory_gb = {
min = 16
}
}
}
In both cases, the default values will be applied for any unspecified attributes (vcpu.max and memory_gb.max).
object({
resources = object({
vcpu = object({
min = optional(number, 0)
max = optional(number, 9999)
})
memory_gb = object({
min = optional(number, 0)
max = optional(number, 999999)
})
})
})
{
"resources": {
"memory_gb": {
"max": 999999,
"min": 0
},
"vcpu": {
"max": 9999,
"min": 0
}
}
}
no

Outputs

Name Description
disks A complex object containing two lists of disk SKU names:
- 'all' for all available disk SKUs in the specified Azure region.
- 'matches' for disk SKUs that match the specified criteria.

Sample structure:
{
names = {
all = ["Standard_LRS", "StandardSSD_LRS", "Premium_LRS", ...]
matches = ["StandardSSD_LRS", "Premium_LRS", ...]
}
details = {
all = [ ... ]
matches = [ ... ]
}
}
vms A complex object containing two lists of VM SKU names:
- 'all' for all available VM SKUs in the specified Azure region.
- 'matches' for VM SKUs that match the specified minimum and maximum vCPU and memory requirements.

Sample structure:
{
names = {
all = ["Standard_B1ls", "Standard_B1ms", "Standard_D2s_v3", ...]
matches = ["Standard_D2s_v3", "Standard_E2s_v3", ...]
}
details = {
all = [ ... ]
matches = [ ... ]
}
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HCL 100.0%