A cloud engineer is writing an Infrastructure as Code (IaC) script to deploy several virtual machines. The engineer needs a way to easily specify the number of VMs to create each time the script is run, without changing the core logic. Which scripting concept should the engineer use to store the number of VMs?
A variable is the correct choice because it is a placeholder for data that can be changed each time a script is executed. This allows the engineer to adjust the number of VMs without altering the script's underlying code. A constant is a value that cannot be changed during execution. An operator is used to perform actions like addition or comparison, not to store a value. A function is a block of reusable code designed to perform a specific task, not to hold a value that changes with each run.
Ask Bash
Bash is our AI bot, trained to help you pass your exam. AI Generated Content may display inaccurate information, always double-check anything important.
What is a variable in scripting?
Open an interactive chat with Bash
How do constants differ from variables in scripting?
Open an interactive chat with Bash
Can you give an example of using a variable in an Infrastructure as Code (IaC) script?