terraform-linters / tflint-ruleset-azurerm

TFLint ruleset for terraform-provider-azurerm
Mozilla Public License 2.0
117 stars 24 forks source link

azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size uses outdated list for VM's #192

Closed fheinonen closed 2 years ago

fheinonen commented 2 years ago

tflint fails to validate kubernetes cluster with the following error, when validating HCL. It seems that it is using a list that is not maintained Error: "Standard_D8s_v4" is an invalid value as vm_size (azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size)

https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/v0.17.1/docs/rules/azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size.md https://github.com/Azure/azure-rest-api-specs/blob/25fc6633c6feecfc01fd46f4926947f31d2e5945/specification/containerservice/resource-manager/Microsoft.ContainerService/preview/2022-03-02-preview/managedClusters.json#L2690

wata727 commented 2 years ago

Good catch. You can change the rule to use the validMachineSizes. https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/v0.17.1/rules/utils.go

Example: https://github.com/terraform-linters/tflint-ruleset-azurerm/pull/179