Input Variables in Terraform | Terraform Tutorial | #7

  Рет қаралды 46,682

Will Brock

Will Brock

Күн бұрын

Terraform variables are like variables in any other programming language. Input variables allow you to pass in date to your configurations or modules making them more dynamic. Variables can be set in a number of different ways but the most common that I use is setting them in a specific file for variables.
In this video we'll modify the existing configuration that we have to allow us to dynamically set the configuration.
Declaring a variable
Using a variables.tf file
Variable types - string, number, bool, list, map, object
Using variables
Different ways of setting variables like with files, command line, environment variables, defaults
Variable precedence
Code Examples:
github.com/Wil...
Terraform documentation on varaibles
www.terraform....

Пікірлер: 50
@lmahesh26
@lmahesh26 2 жыл бұрын
These videos are criminallly underrated, much better than the freecodecamp ones, this helped me ace an interview. Thanks Brock
@WillBrock
@WillBrock 2 жыл бұрын
Awesome, so glad it helped
@andrefortunatolino
@andrefortunatolino 2 жыл бұрын
Those series of Terraform videos are the kind of things that really makes the difference, they are the real world of terraform and help a lot to understand simple concepts that we really want and need on the daily basis. You went directly to the point showing how to do it, totally different from the majority of the courses, that cover badly theory concepts. Thanks, Will
@WillBrock
@WillBrock 2 жыл бұрын
Thanks for the kind words. I'm glad they have been helpful.
@kayoutube690
@kayoutube690 2 жыл бұрын
The best terraform tutorial I found in youtube.
@WillBrock
@WillBrock 2 жыл бұрын
Thanks, glad it was helpful!
@chrispelfrey8651
@chrispelfrey8651 Жыл бұрын
Thanks for taking the time to create this video. It was one of the best!
@WillBrock
@WillBrock Жыл бұрын
Thanks for the kind words
@hassanmohammad4912
@hassanmohammad4912 2 жыл бұрын
After watching a bunchhh of videos came across this one, 8 minutes in the videos and you've helped so much, beautifully explained, straight to the point simple to make you understand. Thank you
@WillBrock
@WillBrock 2 жыл бұрын
Awesome, glad they were helpful
@MrHanSoL0
@MrHanSoL0 3 жыл бұрын
Wow bravo man 👏 I finally understand!! I was so stuck on inputs, variables, tfvars and you just simplified it and dumbed it down so well man, thank you very much 🙏. Keep it up, this is very impactful and serious for our times and companies that need to be migrated to the ☁️
@WillBrock
@WillBrock 3 жыл бұрын
Awesome! I'm glad it was helpful.
@George-mk7lp
@George-mk7lp 3 жыл бұрын
you are amazing man, all your terraform classes are high quality content
@WillBrock
@WillBrock 3 жыл бұрын
Thanks for the kind words :) glad they have been helpful
@Siva-wh9yp
@Siva-wh9yp Жыл бұрын
This is very helpful, to the point. Thank you so much for making the video
@arunadig1755
@arunadig1755 3 жыл бұрын
Very nice, clean, simple way you have explained like a magic.....Never saw a video like this one on Terraform...
@aj7176
@aj7176 3 жыл бұрын
i searched so many video, but this one has what iam searching for. So Thank You
@ihor_1995
@ihor_1995 16 күн бұрын
Very useful video! Awesome! Thank you, Will.
@WillBrock
@WillBrock 16 күн бұрын
No problem, glad it was helpful
@madaarimultitasks5945
@madaarimultitasks5945 3 жыл бұрын
Hi will. Appreciate the effort. Had a massive doubt between variables.tf and terraform.tfvars, you came as a saviour.
@WillBrock
@WillBrock 3 жыл бұрын
Awesome, glad it was helpful
@swalkers8008
@swalkers8008 3 жыл бұрын
HashiCorp should officially recognize this chanel
@Gaurav-qw9us
@Gaurav-qw9us 3 жыл бұрын
very nice explanation of variable usage in terraform. Thank you!
@derekmab7734
@derekmab7734 2 жыл бұрын
A very clear and helpful explanation. Thank you very much.
@WillBrock
@WillBrock 2 жыл бұрын
No problem, glad it was helpful
@Tomtheseapirate
@Tomtheseapirate 3 жыл бұрын
Your videos have helped me a ton. Thank you 1000 times for these.
@BuffaloSpring
@BuffaloSpring 2 жыл бұрын
Your videos are real helpful, thanks man!
@WillBrock
@WillBrock 2 жыл бұрын
Glad you've found them helpful
@jebc88
@jebc88 2 жыл бұрын
Im getting "the argument is required, but no definition was found" error message. I do have the terraform.tfvars file with all the correct values, yet somehow it won't pull them. Im also using the variables.tf file to declare these as type = object(). As Will showed us, I'm trying to use these to define tags within AWS.
@felipeozoski
@felipeozoski 3 жыл бұрын
Thank you for this!!! We all appreciate it!
@tendaimusonza9547
@tendaimusonza9547 3 жыл бұрын
Quite informative ,well done
@namithcc
@namithcc 4 жыл бұрын
Hi Will , I am getting below error, but i dont see any isue with code. any suggestion with tf version, i am using 13.4
@khilielbullock8509
@khilielbullock8509 3 жыл бұрын
So lets say we wanted to created a dynamic s3 and i have a veriable for that. I still would have to call the resource in the main.tf right? I plan on doing this to use existing s3's in DEV
@veerendrakumarmarni2222
@veerendrakumarmarni2222 3 жыл бұрын
I don't want replace resources, just need add to another 2 resource along with existing one.. How? Using command line
@blazorax
@blazorax 3 жыл бұрын
Thank you for the video, it was really helpful.
@harshaisgud
@harshaisgud 3 жыл бұрын
Thank You. This was incredibly helpful. 👍
@WillBrock
@WillBrock 3 жыл бұрын
You're welcome
@timonthyhall6744
@timonthyhall6744 2 жыл бұрын
So let me get this straight ..to use variables you have to also have a tfvars file ?
@WillBrock
@WillBrock 2 жыл бұрын
You don't have to. You can also specify them on the command line
@umasrilakshmi3313
@umasrilakshmi3313 3 жыл бұрын
can we pass a pipe line variable like CI_JOB_ID as an input to terraform?
@WillBrock
@WillBrock 3 жыл бұрын
Yes. www.terraform.io/docs/language/values/variables.html#environment-variables
@Joro123
@Joro123 2 жыл бұрын
Thank you !
@sushantasarkar8538
@sushantasarkar8538 3 жыл бұрын
How to pass variable in Json format,. Please guide
@sushantjillawar7164
@sushantjillawar7164 3 жыл бұрын
Thank you for the amazing video..!!
@agassijoel3343
@agassijoel3343 3 жыл бұрын
What is the difference between vars.tf and tfvars file. I am struggling alot to understand. Can someone help me to understand please
@MuhammadWaqas-gr4gg
@MuhammadWaqas-gr4gg 2 жыл бұрын
Vars.tf is for Variables declaration whereas tfvars file is for Values of those variables.....So due to tfvars file we don't manually pass/enter the values for variables via command prompt, also its not a good practice to do...seems this solves your question.
@sharsha9210
@sharsha9210 3 жыл бұрын
@Will Brock It is not assigning any public IP to Instance
@WillBrock
@WillBrock 3 жыл бұрын
You'll need to specify that you want a public IP in your config
@rohitgupta-ep3nk
@rohitgupta-ep3nk 3 жыл бұрын
Thanks
@Shiki229
@Shiki229 4 жыл бұрын
Thank you!
Local Values | Terraform Tutorial | #8
6:23
Will Brock
Рет қаралды 28 М.
Resource Meta Arguments | Terraform Tutorial | #11
24:20
Will Brock
Рет қаралды 22 М.
Хасанның өзі эфирге шықты! “Қылмыстық топқа қатысым жоқ” дейді. Талғарда не болды? Халық сене ме?
09:25
Демократиялы Қазақстан / Демократический Казахстан
Рет қаралды 289 М.
Help Me Celebrate! 😍🙏
00:35
Alan Chikin Chow
Рет қаралды 84 МЛН
Terraform Basics: Input Variables
33:54
Ned in the Cloud
Рет қаралды 7 М.
Data Sources | Terraform Tutorial | #10
14:21
Will Brock
Рет қаралды 51 М.
Learn how to use Terraform variables
9:39
Cobus Bernard
Рет қаралды 25 М.
Input Variables with Terraform and Azure
21:52
Travis Roberts
Рет қаралды 15 М.
Why You NEED To Learn Terraform | Practical Tutorial
27:33
Travis Media
Рет қаралды 123 М.
Workspaces | Terraform Tutorial | #16
19:17
Will Brock
Рет қаралды 48 М.
Condition variables in C
18:57
CodeVault
Рет қаралды 95 М.
8 Terraform Best Practices that will improve your TF workflow immediately
8:57
Choosing Between Count and For-Each
17:53
Ned in the Cloud
Рет қаралды 12 М.