GoogleCloudPlatform / terraform-google-anthos-vm

Creates VMs on Anthos Bare Metal clusters
https://registry.terraform.io/modules/GoogleCloudPlatform/anthos-vm/google
Apache License 2.0
7 stars 6 forks source link

Some inputs are unused #12

Closed bharathkkb closed 1 year ago

bharathkkb commented 1 year ago

We began rolling out tflint and while patching up this module, I noticed that a few vars are not used but seemed to have examples. https://github.com/GoogleCloudPlatform/terraform-google-anthos-vm/tree/main/examples/vm_startup_scripts_example. I did not create a PR as I was not sure how to proceed - if this was a mistake and we wanted to enable some functionality with these vars or if we can remove them.

Checking for tflint
Working in . ...
5 issue(s) found:

Notice: `vm_name` output has no description (terraform_documented_outputs)

  on outputs.tf line 17:
  17: output "vm_name" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_documented_outputs.md

Notice: `vm_namespace` output has no description (terraform_documented_outputs)

  on outputs.tf line 21:
  21: output "vm_namespace" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_documented_outputs.md

Warning: variable "auto_install_guest_agent" is declared but not used (terraform_unused_declarations)

  on variables.tf line 47:
  47: variable "auto_install_guest_agent" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_unused_declarations.md

Warning: variable "cloudinit_nocloud" is declared but not used (terraform_unused_declarations)

  on variables.tf line 73:
  73: variable "cloudinit_nocloud" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_unused_declarations.md

Warning: variable "startup_scripts" is declared but not used (terraform_unused_declarations)

  on variables.tf line 98:
  98: variable "startup_scripts" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_unused_declarations.md

tflint failed . 
Working in ./examples/vm_disk_example ...
tflint passed ./examples/vm_disk_example 
Working in ./examples/vm_example ...
tflint passed ./examples/vm_example 
Working in ./examples/vm_scheduling_example ...
tflint passed ./examples/vm_scheduling_example 
Working in ./examples/vm_startup_scripts_example ...
tflint passed ./examples/vm_startup_scripts_example 
Working in ./examples/vm_type_example ...
tflint passed ./examples/vm_type_example 
Working in ./modules/vm-disk ...
1 issue(s) found:

Warning: Missing version constraint for provider "null" in "required_providers" (terraform_required_providers)

  on main.tf line 32:
  32: resource "null_resource" "data_source_check" {

Reference: https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.1.1/docs/rules/terraform_required_providers.md

tflint failed ./modules/vm-disk 
Working in ./modules/vm-type ...
tflint passed ./modules/vm-type 
zhuchenwang commented 1 year ago

I will work on the fix.