Complete the code to declare a sensitive variable in Terraform.
variable "db_password" { type = string [1] = true }
Setting sensitive = true marks the variable as sensitive, hiding its value in outputs.
Complete the code to output a sensitive variable without revealing its value.
output "db_password" { value = var.db_password [1] = true }
Marking the output as sensitive = true prevents Terraform from showing the value in the output.
Fix the error in the variable declaration to properly mark it as sensitive.
variable "api_key" { type = string sensitive = [1] }
The sensitive property expects a boolean value true or false, not a string.
Fill both blanks to create a sensitive variable with a default value.
variable "admin_password" { type = string [1] = true [2] = "defaultPass123" }
Use sensitive = true to mark the variable as sensitive and default to set its default value.
Fill all three blanks to output a sensitive variable with a description and hide its value.
output "secret_token" { value = var.secret_token [1] = true [2] = "The secret token for API access" [3] = true }
Use sensitive = true to hide the output value, and description to add a helpful note.