Variables Flashcards
(33 cards)
What are Terraform environment variables used for?
Configure Terraform behavior, pass secrets, and set execution parameters.
How does Terraform read environment variables?
Reads variables prefixed with TF_, TF_VAR_, or provider-specific prefixes.
How do you set an environment variable in Linux/macOS?
export VAR_NAME=value
How do you set an environment variable in Windows?
set VAR_NAME=value (cmd) or $env:VAR_NAME = ‘value’ (PowerShell)
What does TF_LOG do?
Sets the logging level (e.g., TRACE, DEBUG, INFO, WARN, ERROR).
What does TF_LOG_PATH do?
Defines a file path to store Terraform logs.
What is the purpose of TF_WORKSPACE?
Specifies the Terraform workspace in use.
What does TF_CLI_ARGS do?
Passes additional CLI arguments automatically to every Terraform command.
What does TF_DATA_DIR define?
Changes the directory where Terraform stores state files and cache.
What does TF_INPUT control?
Determines if Terraform prompts for user input (true or false).
What does TF_REGISTRY_DISCOVERY_RETRY do?
Sets the number of retries for Terraform registry discovery.
What does TF_SKIP_PROVIDER_VERIFY do?
Skips provider binary signature verification.
What does TF_IGNORE_WARNINGS do?
Suppresses specific warning messages in Terraform.
What does TF_ALLOW_DYNAMIC_PIVOT do?
Enables dynamic pivoting of Terraform configurations.
What does TF_DISABLE_PARTIAL_RETRY do?
Disables partial retries for Terraform operations.
How do you define a Terraform input variable using environment variables?
Use the TF_VAR_ prefix, e.g., export TF_VAR_region=’us-west-1’.
What is the benefit of using TF_VAR_?
Allows setting Terraform variables without modifying .tfvars files.
What does TF_CLI_CONFIG_FILE specify?
Defines a custom Terraform CLI configuration file.
What does TF_PLUGIN_CACHE_DIR do?
Sets the location to cache Terraform provider plugins.
What does TF_IN_AUTOMATION affect?
Optimizes Terraform for automation by disabling interactive prompts.
What does TF_HTTP_CREDENTIALS do?
Provides credentials for HTTP remote backend authentication.
What does TF_HTTP_TIMEOUT do?
Sets the timeout for HTTP operations in Terraform.
What does TF_REMOTE_STATE do?
Defines settings for Terraform remote state storage.
What does TF_CLOUD_ORGANIZATION specify?
Defines the Terraform Cloud organization for remote execution.