A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
True
False
From the Terraform Output Docs – Sensitive:
"Marking an output as sensitive prevents Terraform from showing its value in the CLI output,but it will still bestored in the state file."
Thus, it protects display, not storage.
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.
Option A
Option B
Option C
Option D
From the official Terraform Type Constraints Documentation:
The object({ name = string, age = number }) type expects:
name to be aquoted string, e.g. "John"
age to be anumber, e.g. 52
Option Bsatisfies both:
{
name = "John" #✅Valid string
age = 52 #✅Valid number
}
Let's analyze the incorrect ones:
âŒOption A: "fifty two" is not a valid number.
âŒOption C: John is unquoted (invalid string), and "fifty two" is not a number.
âŒOption D: name = John is not quoted, making it an invalid string in HCL.
Terraform is strict about type and formatting. Stringsmust be quoted, and numbersmust be numeric literals.
A child module can always access variables declared in its parent module.
Child modulesdo not automatically inheritvariables from the parent module.
To pass values from theparent moduleto thechild module, you mustexplicitly define input variablesin the child module and pass them in the parent module.
Example:
hcl
CopyEdit
module "example" {
source = "./child_module"
var1 = "value"
Official Terraform Documentation Reference:
Passing Variables to Modules