Terraform Associate Exam QuestionsBrowse all questions from this exam

Terraform Associate Exam - Question 12


Terraform variables and outputs that set the "description" argument will store that description in the state file.

Show Answer
Correct Answer: AB

The description argument for Terraform variables and outputs is used to provide human-readable documentation for users of the Terraform configuration. It is not included in the state file. The state file is designed to store the current state of the managed infrastructure, including values of variables and outputs, but it does not retain descriptive metadata.

Discussion

17 comments
Sign in to comment
SilentMilliOption: B
Mar 11, 2023

Terraform variables and outputs that set the "description" argument are not stored in the state file. The "description" argument is used to provide a human-readable description of the variable or output, and it is intended to be used as documentation for other users of the Terraform code. The state file is used to store the current state of the infrastructure managed by Terraform, including the values of variables and outputs. However, the "description" argument is not part of the state file, and it is not used by Terraform to manage the infrastructure. Instead, it is only used as metadata to describe the variable or output.

antivrilleeOption: B
Sep 1, 2022

Answer is B. Descriptions aren't stored in the state file.

BereOption: B
Jul 28, 2023

1) Create the following Terraform configuration: provider "aws" { region = "eu-west-1" } variable "instance_type" { description = "The type of instance to create" default = "t2.micro" } resource "aws_instance" "example" { ami = "ami-096800910c1b781ba" # Replace this with an appropriate AMI ID for your region instance_type = var.instance_type } output "instance_id" { description = "The ID of the created instance" value = aws_instance.example.id } 2) After you run terraform apply on this configuration, the state file (terraform.tfstate) will include the value of the instance_type variable ("t2.micro") and the value of the instance_id output (which would be the ID of the created AWS instance), but it would not include the descriptions of either the variable or the output.

Don5366
Jun 19, 2023

This examtopic is getting me confused.

[Removed]
May 29, 2023

Why the anwsers are all wrong?

SIAMIANJIOption: B
Jun 2, 2023

The correct answer is B.

samimshaikhOption: B
Dec 29, 2023

Terraform state files are intended to store the actual configuration and state of the infrastructure, focusing on information that is necessary for Terraform to understand and manage the resources. Descriptions, being informational and not affecting the infrastructure's configuration or behavior, are typically not included in the state file to keep it concise and focused on essential details for Terraform's management.

starkonbulletOption: B
May 17, 2024

Validated; it would just show type, value in the terraform state.

Power123Option: B
Mar 28, 2023

Correct Ans is B

Shane_COption: B
Jul 4, 2023

B is correct

Busi57Option: B
Jul 23, 2023

i think B

JayanthOption: B
Jul 28, 2023

B. False

BadiiOption: B
Sep 7, 2023

Answer is B

Mimi666Option: B
Oct 1, 2023

variables are not stored in state

luke404Option: B
Nov 2, 2023

simply check the output of "terraform state pull" or see inside the tfstate file if using local state, there are no descriptions stored in the state

guicaneOption: B
Nov 23, 2023

I don't understand how such a simple question can show the wrong answer by the website.

mamtak_2008Option: A
Feb 1, 2024

A. True Terraform variables and outputs that set the "description" argument will indeed store that description in the state file. This allows for better documentation and understanding of the purpose of variables and outputs within the Terraform configuration. However, it's important to note that sensitive information should not be included in descriptions as the state file is stored in plain text and could potentially expose sensitive information if not handled properly.