Output variables

i am using for_each meta arguments for creating multiple instances of infrasturcture, but when i try to get the resource details with terraform output
it says it cant get sensitive data in output, but i dont have any sensitive data in the resources. what could be the reason, is there any change with for_each meta arugment or some thing has been updated in the terraform with respect with output variables ??

Can you paste your Terraform code?

hi here is the code. when i run plan i get the error as output cant have sensitvie data. but i dont have dont have sensitive data and i am using latest version of terraform1.9.x .
An intresting thing here, when i run terraform validate, it says configuration si valid, but during plan or apply phase i get the error as it print sensitive information and asking to add sensitive =true attribute to output variable.

main.tf

resource local_file “similarfiles”{
filename=each.value
content=var.content
for_each=var.filename
}

output “sampleobjects”{
value=local_file.similarfiles
}

variables.tf

variable “filenames”{
type= set(string)
default=[
“/home/anil/poc/file1.txt”,
“/home/anil/poc/file2.txt”
“/home/anil/poc/file3.txt”
]
}
variable “content”{
default=“dummy content”
}

The issue you’re encountering is likely due to the default behaviour of Terraform to protect sensitive data. Even if the data isn’t inherently sensitive, Terraform’s mechanisms may flag it as such if there’s any indication it could be.

To resolve the error, you can explicitly mark the output as non-sensitive by setting the sensitive attribute to false.

resource "local_file" "similarfiles" {
  filename = each.value
  content  = var.content
  for_each = var.filenames
}

output "sampleobjects" {
  value     = local_file.similarfiles
  sensitive = false
}

ill try this option.