Variables
Browse all articles, tutorials, and guides about Variables
Posts
Terraform Variables, Loops, and Outputs: The Complete Guide
Everything about moving values through Terraform in one place: declaring vs assigning variables, tfvars and TF_VAR_ precedence, locals, maps and lists, for_each and its pitfalls, splat outputs for counted resources, sensitive values, and the classic "variables may not be used here" error.
How to Fix Terraform "Variables Not Allowed" Error During Plan
Learn why Terraform throws 'Variables not allowed' errors in certain contexts and how to resolve them using locals, data sources, or restructuring your configuration.
Specifying an API Gateway Endpoint with a Variable in Terraform
Learn how to dynamically specify an API Gateway endpoint with a variable in Terraform for flexible configurations.
Can a Resource Be Passed as a Variable into a Module?
Learn how to pass resources as variables into modules in Terraform for reusable and modular infrastructure.
How to Check if a Variable is Set in Bash
Learn multiple methods to check if variables are set, unset, empty, or have specific values in Bash scripts with practical examples and best practices.
How to Set a Variable to the Output of a Command in Bash
Learn multiple methods to capture command output in Bash variables using command substitution, including best practices and error handling techniques.
How to Iterate Over a Range of Numbers in Bash Using Variables
Learn different methods to loop through number ranges defined by variables in Bash, from simple for loops to advanced sequence generation techniques.