Skip to content

[Incorrect sensitive check] - Failed to check azurerm_linux_virtual_machine_invalid_size rule: Invalid function argumen t; Invalid value for "value" parameter: the given value is not sensitive, so this call is redundant #1640

Answered by wata727
lonegunmanb asked this question in Q&A
Discussion options

You must be logged in to vote

This is the intended behavior. Perhaps local.vm_extensions is not sensitive because var.vm_extensions is NULL when running TFLint. On the other hand, local.vm_extensions is sensitive, as var.vm_extensions is probably given a value when running terraform plan.

Below is a minimal repro code:

variable "sensitive_set" {
  type      = list
  default   = null
  sensitive = true
}

locals {
  vm_extensions = var.sensitive_set == null ? [] : var.sensitive_set
}

resource "azurerm_virtual_machine" "main" {
  for_each = nonsensitive(local.vm_extensions)
}
$ tflint
Failed to check ruleset; Failed to check `azurerm_virtual_machine_invalid_vm_size` rule: main.tf:12,27-46: Invalid function argument; In…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@lonegunmanb
Comment options

Answer selected by lonegunmanb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1639 on January 04, 2023 17:49.