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 and logs.
Complete the code to assign a sensitive variable value from environment variables.
variable "api_key" { type = string sensitive = true } provider "example" { key = var.[1] }
Terraform variable names are case-sensitive and usually lowercase with underscores. Use var.api_key to reference the variable.
Fix the error in the variable declaration to properly mark it as sensitive.
variable "admin_password" { type = string sensitive = [1] }
The sensitive attribute expects a boolean value true without quotes.
Fill both blanks to declare a sensitive variable with a description.
variable "token" { [1] = string [2] = true description = "API token for service" }
The type defines the variable type, and sensitive = true marks it as sensitive.
Fill all three blanks to create a sensitive variable with a default value and description.
variable "secret_key" { [1] = string [2] = true [3] = "Default secret key" }
Define the variable type with type, mark it sensitive with sensitive = true, and set a default value with default.