Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(IAC-421) Fix: tflint issue with default_nodepool_vm_type value #222

Closed
1 task done
dhoucgitter opened this issue Feb 11, 2022 · 10 comments · Fixed by #223
Closed
1 task done

(IAC-421) Fix: tflint issue with default_nodepool_vm_type value #222

dhoucgitter opened this issue Feb 11, 2022 · 10 comments · Fixed by #223
Labels
bug Something isn't working

Comments

@dhoucgitter
Copy link
Member

dhoucgitter commented Feb 11, 2022

Terraform Version Details

Terraform v1.0.0

Terraform Variable File Details

variables.tf
────────────────────────────────────────────────────────────────────────────────────────────

variable "default_nodepool_vm_type" {
default = "Standard_D8s_v4
}

Steps to Reproduce

Run tflint, a Terraform source file linting tool from the command line in the root level folder of the cloned viya4-iac-azure repository.

Sample output:
❯ tflint
1 issue(s) found:

Error: "Standard_D8s_v4" is an invalid value as vm_size (azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size)

on main.tf line 145:
145: aks_cluster_node_vm_size = var.default_nodepool_vm_type

Callers:
main.tf:145,46-74
modules/azure_aks/main.tf:50,29-57

Reference: https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/v0.14.0/docs/rules/azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size.md

Expected Behavior

No output from tflint would indicate no errors found and is the expected behavior.

Actual Behavior

❯ tflint
1 issue(s) found:

Error: "Standard_D8s_v4" is an invalid value as vm_size (azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size)

on main.tf line 145:
145: aks_cluster_node_vm_size = var.default_nodepool_vm_type

Callers:
main.tf:145,46-74
modules/azure_aks/main.tf:50,29-57

Reference: https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/v0.14.0/docs/rules/azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size.md

Additional Context

No response

References

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@dhoucgitter dhoucgitter added bug Something isn't working new Added to an issue when it's new ;) labels Feb 11, 2022
@thpang
Copy link
Member

thpang commented Feb 11, 2022

This is not an error, but a lack of the lint tool knowing about the newer versions of the VM types. If there is an error its on TFLint and should be opened there.

@dhoucgitter dhoucgitter changed the title Fix tflint issue with default_nodepool_vm_type value Fix tflint issue with default_nodepool_vm_type value (IAC-421) Feb 11, 2022
@dhoucgitter
Copy link
Member Author

This is not an error, but a lack of the lint tool knowing about the newer versions of the VM types. If there is an error its on TFLint and should be opened there.

Thanks Thomas, I'll look into doing that then.

@dhoucgitter dhoucgitter removed the new Added to an issue when it's new ;) label Feb 11, 2022
@dhoucgitter
Copy link
Member Author

dhoucgitter commented Feb 11, 2022

Looked into this further, it appears that the enum list that TFLint uses to validate the available vm_sizes is no longer being updated by the compute API team -> Azure/azure-rest-api-specs#10033 (comment)
I'll look into whether or not this particular warning can be ignored for now since it is a false indication that something is wrong given the situation.
Also reference GitHub tflint issue -> terraform-linters/tflint-ruleset-azurerm#30 which contains the api-specs issue referred to above.

@thpang
Copy link
Member

thpang commented Feb 11, 2022

Strange as I see Standard_D8s_v4 in the valid list on the main and v0.14.0 branch

@dhoucgitter dhoucgitter changed the title Fix tflint issue with default_nodepool_vm_type value (IAC-421) (IAC-421) Fix: tflint issue with default_nodepool_vm_type value Feb 11, 2022
@dhoucgitter
Copy link
Member Author

Strange as I see Standard_D8s_v4 in the valid list on the main and v0.14.0 branch

This is the v0.14.0 ruleset I referenced, it doesn't seem to have the Standard_D8s_v4 entry in that list https://github.com/terraform-linters/tflint-ruleset-azurerm/blob/v0.14.0/docs/rules/azurerm_kubernetes_cluster_default_node_pool_invalid_vm_size.md
Can you link me to the list that you are seeing it in?

@thpang
Copy link
Member

thpang commented Feb 14, 2022

@thpang
Copy link
Member

thpang commented Feb 15, 2022

Was this issue not address with this PR #223 ?

@dhoucgitter
Copy link
Member Author

Was this issue not address with this PR #223 ?

Yes it was, the update for PR #223 touched .tflint.hcl for a different reason so I mentioned that IAC-421 was also included in PR #223 in the PR comment. Should I have created a separate PR for the IAC-421 .tfhlint.hcl change all by itself?

@thpang
Copy link
Member

thpang commented Feb 17, 2022

Nope you should have linked the issue with the PR. That way when the PR is closed, if it covers all aspects of an issue, then the associated issue is also closed. Just a learning moment ;)

@dhoucgitter
Copy link
Member Author

OK, thanks @thpang, I think I've got it linked now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
2 participants