Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 103


Which of the following arguments are required when declaring a Terraform output?

Show Answer
Correct Answer: D

When declaring a Terraform output, the only required argument is 'value'. The 'value' argument specifies what the output should be and is necessary for the configuration to understand what value should be returned. Other arguments like 'description' and 'sensitive' are optional and can be used to provide additional context or modify the behavior of the output, but they are not mandatory. The 'default' argument is not applicable to outputs; it is used for input variables.

Discussion

6 comments
Sign in to comment
NunyabiznesOption: D
Mar 24, 2023

The only required argument when declaring a Terraform output is the value argument, which specifies the value of the output: ``` output "example" { value = "example output value" } ``` The description argument is optional and can be used to provide additional information about the output: ``` output "example" { value = "example output value" description = "An example output" } ```

Nunyabiznes
Mar 24, 2023

The sensitive argument is also optional and can be used to mark the output as sensitive, which prevents its value from being displayed in the output of Terraform commands, logs, and state files: ``` output "example" { value = "example output value" sensitive = true } ``` The default argument is not a valid argument for an output. It is used for input variables and specifies a default value to be used if a value is not set in the configuration or passed in through the command line.

nakikooOption: D
Jan 13, 2023

https://developer.hashicorp.com/terraform/language/values/outputs

BurakkoOption: D
Sep 1, 2022

There has to be a value for sure.

Gaby999Option: D
Sep 6, 2022

yes, correct answer is D

Power123Option: D
Mar 31, 2023

D is correct

Ni33Option: D
May 9, 2023

DDDDDDDDD