Complete the code to declare a variable in a Terraform configuration.
variable "project_id" { type = [1] }
The type of a variable defines what kind of value it holds. For project IDs, string is the correct type.
Complete the code to output the project ID variable value.
output "project_id_output" { value = [1] }
var. prefix.To output a variable's value, use var.variable_name. Here, var.project_id accesses the project ID variable.
Fix the error in the output block to correctly reference the variable.
output "region_output" { value = [1] }
var. prefix.The correct way to reference a variable in Terraform output is with var.variable_name. Here, var.region is correct.
Fill both blanks to declare a variable with a default value and output it.
variable "region" { type = [1] default = [2] } output "region_output" { value = var.region }
The variable type should be string. The default value must be a quoted string like "us-central1" to be valid.
Fill all three blanks to declare a variable, assign a default, and output its uppercase value.
variable "env" { type = [1] default = [2] } output "env_upper" { value = upper([3]) }
var. prefix.The variable type is string. The default value must be a quoted string "prod". To output the uppercase value, use upper(var.env).