1. HashiCorp Terraform Documentation, "Purpose of Terraform State": This document explains that the state file is used for mapping resources to configuration, tracking metadata, and improving performance. It details what is stored, focusing on managed resources and their attributes. It makes no mention of storing input variable names.
Source: HashiCorp, "Purpose of Terraform State," Terraform Documentation.
Reference: "State is used by Terraform to map real world resources to your configuration, keep track of metadata, and to improve performance for large infrastructures... This state is stored by default in a local file named terraform.tfstate..."
2. HashiCorp Terraform Documentation, "Input Variables": This page describes how input variables serve as parameters for a Terraform module, allowing aspects of the configuration to be customized without altering the source code. Their scope and purpose are confined to the configuration and planning phase, not the state file.
Source: HashiCorp, "Input Variables," Terraform Documentation.
Reference: "Input variables let you customize aspects of Terraform modules without altering the module's own source code. This allows you to share modules across different Terraform configurations, making your module composable and reusable."
3. HashiCorp Terraform Documentation, "Output Values": This source explicitly states that output values are stored in the state file, which contrasts with input variables. This highlights that only a specific type of variable-related data is stored.
Source: HashiCorp, "Output Values," Terraform Documentation.
Reference: "Output values are like the return values of a Terraform module... When you run terraform apply, Terraform prints the values of your outputs to the screen. You can also use the terraform output command to query them. The values of root module outputs are also stored in the state file."