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: B

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

23 comments
Sign in to comment
SilentMilliOption: B
Mar 12, 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
Sep 24, 2024

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.

ser_kaOption: B
Sep 3, 2022

Should be B. Tested this - no any descriptions v 1.2.7

RVivekOption: B
Sep 15, 2022

I checked in my LAB. terraform.tfstate file doesnot store descriptions

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.

adoubanOption: B
Dec 9, 2022

B, tested on my lab, state only stores resources information it does not store outputs or variables

itbrpl
Feb 14, 2023

Tested now.. Outputs are present in state file but description is not: { "version": 4, "terraform_version": "1.3.7", "serial": 19, "lineage": "8de81937-55d8-2487-7ad0-cabba43e4403", "outputs": { "iam_assumed_role": { "value": "user_iam_assumed_role", "type": "string" }, "user_role_to_assume": { "value": "arn:aws:iam::999999999:role/user_iam_assumed_role", "type": "string" } }, "resources": [ { }

SIAMIANJIOption: B
Jun 2, 2023

The correct answer is B.

starkonbulletOption: B
May 17, 2024

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

alifieOption: B
Oct 14, 2022

it isn't in the state, just check it

safe2008
Jan 3, 2023

Vaoted B.

kennynelconOption: B
Jan 10, 2023

Description not in state file

Only5
Jan 27, 2023

Answer is A, I can see description in state file on my environment

guicane
Nov 23, 2023

no you cannot

Mal_8Option: B
Feb 18, 2023

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

Power123
Mar 28, 2023

Correct Ans is B

Shane_COption: B
Jul 4, 2023

B is correct

Busi57Option: B
Jul 23, 2023

i think B

Jayanth
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_2008
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.

Lashe
Aug 7, 2024

not true. Terraform state file only stores the actual infrastructure resources and their state