[{"id":"terraformbeginner-001","courseId":"terraform-beginner","domain":"configuration-language","topic":"Block syntax","prompt":"A teammate reads this configuration. Which line is an argument rather than a block?","hint":"Look for the line that uses an equals sign.","explain":"Configuration uses two constructs: named values set with an equals sign, and containers that group other content. Check whether each line sets a name or opens a container.","source":"https://developer.hashicorp.com/terraform/language/syntax/configuration","interaction":{"type":"single"},"options":[{"id":"a","text":"ami = \"abc123\"","why":"An argument assigns a value to a name: the name, an equals sign, then an expression."},{"id":"b","text":"network_interface { ... }","whyNot":"This is a block, a container for other content, written with braces and no equals sign."},{"id":"c","text":"resource \"aws_instance\" \"example\" { ... }","whyNot":"This is a block with the type resource that holds other content; it sets no value."},{"id":"d","text":"Every line in the snippet is an argument","whyNot":"The resource and network_interface lines open blocks, which are containers for other content."}],"answer":"a","explanation":"An argument assigns a value to a name with an equals sign; a block has a type and braces, and holds other content.","concept":"An argument assigns a value to a name with an equals sign; a block has a type and braces, and holds other content.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","code":"resource \"aws_instance\" \"example\" {\n  ami = \"abc123\"\n  network_interface {\n    # ...\n  }\n}","takeaways":["An equals sign marks an argument; a type followed by braces marks a block."]},{"id":"terraformbeginner-002","courseId":"terraform-beginner","domain":"configuration-language","topic":"Input variables","prompt":"A variable block sets sensitive = true. Terraform then keeps that variable's value out of the state file.","hint":"Separate what the CLI prints from what Terraform saves.","explain":"The sensitive argument controls what is displayed. Terraform records variable values in its own data during operations, so check which kind of protection this argument gives before judging.","source":"https://developer.hashicorp.com/terraform/language/values/variables","interaction":{"type":"true-false"},"options":[{"id":"a","text":"True","whyNot":"sensitive only hides the value in CLI output; Terraform still stores it in state."},{"id":"b","text":"False","why":"Terraform still stores sensitive variable values in state, so the argument does not keep them out of it."}],"answer":"b","explanation":"sensitive hides a variable's value in CLI output, but Terraform still stores it in state; the ephemeral argument omits it from state and plan files.","concept":"sensitive hides a variable's value in CLI output, but Terraform still stores it in state; the ephemeral argument omits it from state and plan files.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["sensitive hides values in CLI output; it does not remove them from state."]},{"id":"terraformbeginner-003","courseId":"terraform-beginner","domain":"configuration-language","topic":"Output values","prompt":"A child module named web_server defines an output called instance_ip. The parent module needs that value. Which expression reads it?","hint":"Think about how a parent names the child module it calls.","explain":"Outputs are how a module passes values upward to whatever calls it. A parent reaches a child's values through the call that created that child, so think about which name it refers to.","source":"https://developer.hashicorp.com/terraform/language/values/outputs","interaction":{"type":"single"},"options":[{"id":"a","text":"module.web_server.instance_ip","why":"Parent modules read child outputs with module.<CHILD_MODULE_NAME>.<OUTPUT_NAME>."},{"id":"b","text":"output.web_server.instance_ip","whyNot":"There is no output. prefix for reading; child outputs are read through the module. path."},{"id":"c","text":"var.web_server.instance_ip","whyNot":"var. reads an input variable the module declares, not an output from a child module."},{"id":"d","text":"local.web_server.instance_ip","whyNot":"local. reads locals from the module that defines them, so it cannot reach a child's output."}],"answer":"a","explanation":"A child module's output blocks expose values to its parent, which reads them as module.<CHILD_MODULE_NAME>.<OUTPUT_NAME>.","concept":"A child module's output blocks expose values to its parent, which reads them as module.<CHILD_MODULE_NAME>.<OUTPUT_NAME>.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Read a child module's output from the parent with the module. prefix."]},{"id":"terraformbeginner-004","courseId":"terraform-beginner","domain":"configuration-language","topic":"Local values","prompt":"A teammate is learning locals. Which TWO statements about local values are true?","hint":"Think about which module can read a local, and which keyword reads it.","explain":"A locals block gives a name to an expression so the expression can be reused. Consider where that name can be read, and what kinds of expressions can be stored under it.","source":"https://developer.hashicorp.com/terraform/language/values/locals","interaction":{"type":"multiple","tellCount":true},"options":[{"id":"a","text":"Read a local with the plural locals.<NAME> form, the same keyword as the block.","whyNot":"The locals block defines values, but references use the singular local.<NAME> keyword."},{"id":"b","text":"Read a local with local.<NAME> inside the module that defines the locals block.","why":"Local values can be accessed in the module where they are defined, using the singular local keyword."},{"id":"c","text":"A child module can read the parent's local with local.<NAME> directly.","whyNot":"Locals are not visible to other modules; you pass one to a child as a module argument."},{"id":"d","text":"A locals block can hold any valid expression, including ones built from variables or function calls.","why":"Locals can be any valid Terraform expression, and may reference variables, resource attributes, functions, or other locals."},{"id":"e","text":"Every repeated value belongs in a locals block, since locals always make configurations easier to read.","whyNot":"Locals avoid repetition, but they can make configurations harder to read because they obscure where values come from."},{"id":"f","text":"A local can only hold a literal string, because expressions are allowed only in variable blocks.","whyNot":"Expressions are allowed in locals; the block accepts any valid Terraform expression."}],"answer":"bd","explanation":"Locals are read as local.<NAME> in the module that defines them and can hold any valid expression; other modules need a passed argument.","concept":"Locals are read as local.<NAME> in the module that defines them and can hold any valid expression; other modules need a passed argument.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Read a local as local.<NAME> in its own module; pass it as an argument to share it."]},{"id":"terraformbeginner-005","courseId":"terraform-beginner","domain":"configuration-language","topic":"Type constraints","prompt":"A module's input variable sets type = list(string). What does this constraint mean?","hint":"Read the constructor's argument: it names the type each element must have.","explain":"A type constraint limits what values a variable accepts. Collection types group many values, and each has one element type that applies to all of them.","source":"https://developer.hashicorp.com/terraform/language/expressions/type-constraints","interaction":{"type":"single"},"options":[{"id":"a","text":"A list in which every element is a string.","why":"list(string) is a list of strings; every element of a collection shares its element type."},{"id":"b","text":"A list whose elements may each have a different type.","whyNot":"Every element of a collection must be the same type, so mixed element types are not allowed."},{"id":"c","text":"A map whose keys are strings.","whyNot":"That describes a map, a collection of labelled values; list(string) is a list indexed by whole numbers."},{"id":"d","text":"A list of any type, with no restriction on its elements.","whyNot":"Even the bare list keyword requires every element to be the same type; list(string) is more specific."}],"answer":"a","explanation":"list(string) is a list whose elements are all strings; every element of a collection must share one element type.","concept":"list(string) is a list whose elements are all strings; every element of a collection must share one element type.","rev":1,"updatedAt":"2026-10-23","kind":"scenario","takeaways":["Collection types take one element type, and every element must match it."]}]