A deployment script needs the value of the string output lb_dns_name with no quotes or extra formatting so it can pass it to curl. Another pipeline stage needs all root outputs, including a map, in a stable machine-readable format. Which commands fit each need?
Select an answer to reveal the explanation.
Short Explanation
Think of -raw as handing over just the plain string, no wrapping paper, and -json as the neatly labeled box for everything else. You use -raw when one simple value goes straight into a shell command, and -json when structure matters. The trap is assuming -raw can handle maps; it can't.
Full Explanation
The terraform output command prints root module output values in a human-readable format by default, and that format can change between releases, so automation should use one of the two machine-oriented options. The -raw option converts a single named output to a string and prints it directly, with no quotes, escaping or trailing formatting, which makes it ideal for injecting one value into a shell command; it supports only string, number and boolean values. The -json option formats outputs as a JSON object with one key per output, or just the named output when a name is given, and is the stable format for tools such as jq and for complex types such as maps and lists. The console evaluates expressions interactively and prints values in its own quoted display format, and state pull emits the entire raw state, an internal structure rather than the documented output object; -raw cannot print all outputs at once or render complex types. Plain terraform output for a named string prints it with quotes in the human format, and terraform show prints state or plan details rather than a stable output object. Exam caveat: both -raw and -json display sensitive output values in plain text, so pipeline logs must be protected accordingly. Operational check: run the -raw command in the script and confirm curl receives a bare hostname, then pipe the -json output through jq in the later stage to confirm all keys are present.