Skip to main content

Variables

Browse all articles, tutorials, and guides about Variables

7posts

Posts

Terraform
|14 min read

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.

Terraform
|8 min read

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.

Terraform
|5 min read

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.

Terraform
|7 min read

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.

Bash
|8 min read

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.

Bash
|7 min read

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.

Bash
|5 min read

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.