From the course: Advanced Terraform
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
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
-
-
-
-
Input variables5m 52s
-
(Locked)
Using input variables6m 23s
-
(Locked)
Output variables5m 50s
-
(Locked)
Sensitive data4m 10s
-
(Locked)
Looping with count7m 59s
-
(Locked)
Looping with for_each3m 26s
-
(Locked)
Expressions and functions6m 33s
-
(Locked)
Introduction to modules2m 38s
-
(Locked)
Using Terraform modules3m 55s
-
-
-
-