From the course: Advanced Terraform

Unlock the full course today

Join today to access over 23,200 courses taught by industry experts.

Using input variables

Using input variables - Terraform Tutorial

From the course: Advanced Terraform

Using input variables

- So far, we've added string and Bool variables. Now that we've seen some simple examples of variables, we're going to look at some more complex ones. First, I want to show you what to do if you've made changes in a branch and you want to switch to another branch. If you try to switch branches with uncommitted changes, you'll see this error here. (keyboard gently clicking) The fix is to throw away the changes in the current branch before you switch. Here are the commands to do that: "git stash," and then "git stash drop." Now, you can go ahead and switch. We'll go ahead and switch to, "02_02." Now, we can take a look at some new variables in variables.tf. We have target environment, which is just a simple string. We have environment list, which is a list of strings. We have environment map, which is a map of strings. And we have environment machine type, another map of strings. And then a complex map object, which…

Contents