1. HashiCorp Terraform Documentation
"Input Variables - Assigning Values to Root Module Variables": This page details the various methods for setting input variables. It lists command-line flags as a primary method: "To specify individual variables on the command line
use the -var option." This establishes -var as a standard mechanism for runtime injection.
Source: HashiCorp
"Input Variables"
Terraform Documentation
https://developer.hashicorp.com/terraform/language/values/variables#assigning-values-to-root-module-variables
Section: "On the Command Line".
2. HashiCorp Terraform Documentation
"Running Terraform in Automation": This guide provides best practices for using Terraform in CI/CD. It explicitly warns against storing secrets in version control and recommends injecting them at runtime. While it prefers environment variables (TFVAR...)
it acknowledges command-line flags as a valid method.
Source: HashiCorp
"Running Terraform in Automation"
Terraform Documentation
https://developer.hashicorp.com/terraform/cli/run/automation
Section: "Variable and Credential Management". The document states
"Do not save plain-text credentials in your VCS... You can set input variables from a file (-var-file) or the command line (-var)..." This directly contrasts the insecure methods (A
B
C) with the secure runtime injection method (D).