Terraform variable.tf | terraform.tfvars | Terraform command line variables - Part 3

  Рет қаралды 39,034

Rahul Wagh

Rahul Wagh

Күн бұрын

Terraform variable.tf and terraform.tfvars | Terraform tfvars | Terraform terraform.tfvars | Terraform command line variables
▬▬▬▬▬▬ * Instruction's Guides * ▬▬▬▬▬▬
1. How to use Terraform input variables - jhooq.com/terraform-variable-...
▬▬▬▬▬▬ * Previous Guides * ▬▬▬▬▬▬
How to use Terraform input variables - jhooq.com/terraform-input-var...
Terrafrom installation and setup on GCP and EC2 - jhooq.com/terraform-ec2-insta...
Terraform is OpenSource infrastructure as a code software tool. With the help of Terraform you can provision infrastructure on cloud platform such AWS(aws.amazon.com/), Google Cloud(cloud.google.com/), Azure(azure.microsoft.com/en-us/), DigitalOcean(www.digitalocean.com/), OpenShift(www.openshift.com/) and many more...cloud provider
But before you start working with Terraform you must understand different types of variables provided by the terraform -
1. variable.tf - This file is used for declaring and defining variables
2. terraform.tfvars - It is also used for declaring and defining variables but can be used for multiple environment like staging, production
3. commandline vars - If you want to pass the variable using terraform commandline
Here is the time stamp for all the topics which we are going to discuss
▬▬▬▬▬▬ ⭐️ 🕘Timestamps ⭐️ ▬▬▬▬▬▬
0:00 - Intro to Terraform Input Variables
01:27 - variable.tf
09:31 - terraform.tfvars
13:50 - mulitple terraform.tfvars
19:36 - terrafrom command line variable
For more details on Terraform here is the official guide - www.terraform.io/docs/
To learn more on DevOps visit - jhooq.com
Disclaimer/Policy: All the content/instructions are solely mine. The source is completely open-source.
Video is copyrighted and can not be re-distributed on any platform.
#devops #terraform #InfrastructureasCode #cloud

Пікірлер: 85
@forexmeter3900
@forexmeter3900 Жыл бұрын
Thank you, for taking the time to explain the concepts very clearly and SLOWLY without rushing through the presentation.
@sivam2224
@sivam2224 2 жыл бұрын
Thank you so much. It really clarified my doubts in terraform variables.
@RahulWagh
@RahulWagh 2 жыл бұрын
Glad to hear that
@malleshdappu5466
@malleshdappu5466 2 жыл бұрын
Whatever information you are providing it if much useful for me and simplistic way you are explaining...thanks j-hooq
@RahulWagh
@RahulWagh 2 жыл бұрын
Glad to hear that
@roshankumarsingh1470
@roshankumarsingh1470 3 жыл бұрын
Thank you so much for the video, really helpful.
@RahulWagh
@RahulWagh 3 жыл бұрын
Glad it was helpful!
@sivarasana3641
@sivarasana3641 Жыл бұрын
Great session , very clear explanation sir
@Ramankumar-zb5bo
@Ramankumar-zb5bo Жыл бұрын
Thank you sir for provide all this concepts in simple and effective manner. Thanks a lot again.
@RahulWagh
@RahulWagh Жыл бұрын
You are most welcome
@praveenbhogade
@praveenbhogade 2 жыл бұрын
Good Job Rahul!!! looking forward for a great content from your end, keep up the good work bhava...
@RahulWagh
@RahulWagh 2 жыл бұрын
Thanks praveen
@happylearningtricks
@happylearningtricks Жыл бұрын
very nice content and great explanation - thanks a lot
@RahulWagh
@RahulWagh Жыл бұрын
Glad you liked it!
@sagarbhavsar9409
@sagarbhavsar9409 9 ай бұрын
You are giving clear explanation. its amazing session
@RahulWagh
@RahulWagh 9 ай бұрын
You are welcome
@uniquetrading9906
@uniquetrading9906 2 жыл бұрын
Very good and informative...
@hasan135
@hasan135 2 жыл бұрын
Nice video. Thanks for sharing.
@RahulWagh
@RahulWagh 2 жыл бұрын
Thanks for the visit
@loksakt
@loksakt 11 ай бұрын
Crystal clear explanation brother!!! I was some other udemy video, concept wasn't clear.. Your video cleared everything
@RahulWagh
@RahulWagh 11 ай бұрын
Glad to hear that
@vositislomov1404
@vositislomov1404 2 жыл бұрын
Very well explanation!
@RahulWagh
@RahulWagh 2 жыл бұрын
Glad it was helpful!
@SaphireTech
@SaphireTech 2 жыл бұрын
Great stuff, thanks!
@RahulWagh
@RahulWagh 2 жыл бұрын
Glad you liked it!
@AwargiforSirTarar
@AwargiforSirTarar Жыл бұрын
Perfect explaination.
@RahulWagh
@RahulWagh Жыл бұрын
you welcome
@meenakshichhipa6150
@meenakshichhipa6150 3 жыл бұрын
Nice explanation Thank you
@RahulWagh
@RahulWagh 3 жыл бұрын
Glad you liked it
@alberthien3720
@alberthien3720 3 жыл бұрын
Great job my dear Raul
@RahulWagh
@RahulWagh 3 жыл бұрын
Thank you! Cheers!
@DeepthiSuresh777
@DeepthiSuresh777 5 ай бұрын
Nice explanation u taught us like a spoon feed thank you
@RahulWagh
@RahulWagh 5 ай бұрын
Glad you liked it
@vitorcartaxo3699
@vitorcartaxo3699 2 жыл бұрын
Thank you man !!!!!
@RahulWagh
@RahulWagh 2 жыл бұрын
You're welcome!
@rajivnayanverma6822
@rajivnayanverma6822 Жыл бұрын
nice tutorial Rahul , really liked it..
@RahulWagh
@RahulWagh Жыл бұрын
Glad you liked it
@rajivnayanverma6822
@rajivnayanverma6822 Жыл бұрын
@@RahulWagh I was stuck with creating ec2 instance with SSH key and was not able to demonstrate file provisioner, after seeing your video I managed to do it and understand the concept .. Thanks again.
@RaoShahzaib
@RaoShahzaib Жыл бұрын
awesome
@RahulWagh
@RahulWagh Жыл бұрын
Glad you like it!
@ipre4playgaming587
@ipre4playgaming587 2 жыл бұрын
Hey hello Rahul I have doubt I have one file called (variable.tfvars) if I change this name into (vars.tfvars) the actual values of (variable.tfvars) not coming so what is the difference between (variable.tfvars to vars. tfvars) can you explain
@vivekpuurkayastha1580
@vivekpuurkayastha1580 2 ай бұрын
when using .tfvars file, should the variables in the variable.tf file be totally empty or can it contain description and type but just not the default value?
@MaheshGaikwad21
@MaheshGaikwad21 Жыл бұрын
I have on query regarding .tfvars file. if we have different env like dev staggin prod how we managed this tfvars file and where we stored this file?
@kumargaurav4246
@kumargaurav4246 2 ай бұрын
i was expecting that when i run 2 plans with the tfvars files i would end up with 2 resources, however i end up with 1 resource that terraform want’s to replace…any help would be greatly appreciated!
@prafulldeshmukh5940
@prafulldeshmukh5940 Жыл бұрын
Hey Rahul, which terminal you have used run the command like terraform init, etc? Is it gitbash or cmd?
@aniketkhadye6814
@aniketkhadye6814 3 жыл бұрын
Great video So helpful for fresher Pls cover full terraform topic
@RahulWagh
@RahulWagh 3 жыл бұрын
There are more to come on terraform in upcoming weeks. Making video more detailed and concise take a little time. But stay tuned I will be covering the complete the terraform topics . //Rahul
@pawankumar786
@pawankumar786 3 жыл бұрын
@@RahulWagh no where in web we have terraform with Google cloud in detail. Will follow your tutorial .. looking forward for more in-depth material on terraform and Google cloud
@RahulWagh
@RahulWagh 3 жыл бұрын
Hey Pawan, Well I am having one lab session on my channel where i explained about Google Cloud and Terraform, I would recommend you to follow that lab session. Here is the time stamp of that particular part where I have shown how to get started with Terraform on Google Cloud - kzbin.info/www/bejne/oHu7Z4Zrf6Z6pqs Click on the above link that. I am planning to upload similar lab session in upcoming weeks and months, so if you have any topic then please post here I will add it into my list //Rahul
@Kosantosh
@Kosantosh 8 ай бұрын
Thanks for your effort to explain things simply, concept is clear, I have a query, do .tfvars file should have variables defined in variable.tf file?
@RahulWagh
@RahulWagh 8 ай бұрын
Yes, correct
@raveendravajrala2919
@raveendravajrala2919 2 жыл бұрын
Thank you for your efforts and sharing , Can you help me what is the destroy command when we are using multiple .tfvars file for the same mail.tf , will it be >terraform destroy --var-file ="stage.tfvars" ?
@rajivnayanverma6822
@rajivnayanverma6822 Жыл бұрын
yes
@sanketgangurde9445
@sanketgangurde9445 Жыл бұрын
sir can you please tell that how does terraform file calls terraform variable file
@sahadevdahit
@sahadevdahit 3 ай бұрын
❤❤❤❤
@RahulWagh
@RahulWagh 3 ай бұрын
Cheeers
@assrpavanteja7392
@assrpavanteja7392 2 жыл бұрын
Hi Rahul , is there a way where I'll plan the code and want to issue terraform apply at some point around 11 pm in the day ? is that possible using terraform?
@RahulWagh
@RahulWagh 2 жыл бұрын
You can create a bash script and in that script you write down all of your terraform command and save them some where. After that you need to write chron job to execute that bash script at whatever time you need
@ashishdeokar580
@ashishdeokar580 Жыл бұрын
Hello Rahul, Videos are crisped and well explained.. I do have query here.. Thank you so much for sharing a knowledge. Is it necessary to execute terraform plan 2 times for stage.tfvars & production.tfvars ? Can't we make add 2 tfvars in single command ?
@RahulWagh
@RahulWagh Жыл бұрын
No it is not necessary to run terraform plan two times, one time is more then sufficient
@devopsprabhakar806
@devopsprabhakar806 2 жыл бұрын
Suppose we execute firat stage.tfvar and after prod.tfvar then will it overwrite the state file? Or it will update entry in state file for stage and prod both?
@silentwatcher13
@silentwatcher13 2 жыл бұрын
It overrides the current state.. i want to know how we can achieve this (same state file for both tfvars) 👆🏼?..
@RahulWagh
@RahulWagh 2 жыл бұрын
If you are planning to execute the same terraform file in different environment then I would recommend using terraform workspaces because if you use stage.tfvar and then prod.tfvar it will lead to very unstable tfstate. terraform workspaces is meant to solve such problem where you can run the same infra with different profiles
@ksundar369gmail
@ksundar369gmail 2 жыл бұрын
How to pass variables with tfvars, while trying to call modules?
@narenderkondisetty9704
@narenderkondisetty9704 2 жыл бұрын
Excellent Job Rahul......Have a small doubt.....if i have two .tf files in one folder and when i say terraform plan and terraform apply,which .tf it will consider.
@RahulWagh
@RahulWagh 2 жыл бұрын
I guess it will consider both .tf files
@saeid5914
@saeid5914 10 ай бұрын
Thank you Rahul for your great session, I couldn't run variables .tfvars codes for gcp, so far rest of variables successfully ran, can you/anyone advise please?
@harirocking1530
@harirocking1530 Жыл бұрын
Please do create videos on jenkins and kubernetes too
@RahulWagh
@RahulWagh Жыл бұрын
It is already there probably you haven’t looked at it - Set up complete CI/CD Jenkins pipeline for kubernetes - Part 11 kzbin.info/www/bejne/ioGwhquph65khaM
@RahulWagh
@RahulWagh Жыл бұрын
Here is one more on aws - How to set up AWS Kubernetes Jenkins pipeline? - Part 13 kzbin.info/www/bejne/e3-xc5ejg9NnqJI
@harirocking1530
@harirocking1530 Жыл бұрын
@@RahulWagh i m gonna complete all these videos in dis weeked and very huge thanks for making us to understand the process in the simplest way.
@abhishekm1361
@abhishekm1361 2 жыл бұрын
Why you have not given type in variable section when you are using terraform.tfvars
@rahulchandran1616
@rahulchandran1616 2 жыл бұрын
thanks a lot for this session.. can you explain the use of *auto.tfvars file as well??
@RahulWagh
@RahulWagh 2 жыл бұрын
Will upload soon on auto.tfvars in upcoming weeks
@prakki
@prakki 2 жыл бұрын
Very Good Explanation. How can I reach you?
@RahulWagh
@RahulWagh 2 жыл бұрын
Check the contact page - jhooq.com/contact/
@NavneetKumar-ot5bg
@NavneetKumar-ot5bg 2 жыл бұрын
Could you please make a video on terraform state file
@RahulWagh
@RahulWagh 2 жыл бұрын
Terraform state video is coming soon
@NavneetKumar-ot5bg
@NavneetKumar-ot5bg 2 жыл бұрын
But you have not expalined the terraform.tfvars
@RahulWagh
@RahulWagh 2 жыл бұрын
It’s hard to capture everything in one video, everyone expect something different but I will make a note for upcoming video
@SenthilKumar-uv7rr
@SenthilKumar-uv7rr 2 жыл бұрын
Thanks for the wonderful video. Yeah I was expecting the explanation of terraform.tfvars and its benefits than others, until last min of video ! If u have it on any other video plz post the link here.
@vineet_kumar555
@vineet_kumar555 4 ай бұрын
unable tounderstand
@HeyMani92
@HeyMani92 2 жыл бұрын
Could you please make a video on terraform state file
@RahulWagh
@RahulWagh 2 жыл бұрын
Surely i would add it to my todo list
Terraform Locals | How to use Terraform Locals? - Part 4
10:32
Rahul Wagh
Рет қаралды 23 М.
Terraform for loop, for_each loop and count - Part 6
15:00
Rahul Wagh
Рет қаралды 44 М.
The day of the sea 🌊 🤣❤️ #demariki
00:22
Demariki
Рет қаралды 107 МЛН
Survival skills: A great idea with duct tape #survival #lifehacks #camping
00:27
你们会选择哪一辆呢#short #angel #clown
00:20
Super Beauty team
Рет қаралды 22 МЛН
Learn how to use Terraform variables
9:39
Cobus Bernard
Рет қаралды 23 М.
Input Variables with Terraform and Azure
21:52
Travis Roberts
Рет қаралды 13 М.
8 Terraform Best Practices that will improve your TF workflow immediately
8:57
What is Terraform null_resource and how to use it? - Part-21
19:10
ОБСЛУЖИЛИ САМЫЙ ГРЯЗНЫЙ ПК
1:00
VA-PC
Рет қаралды 1,3 МЛН
Blue Mobile 📲 Best For Long Audio Call 📞 💙
0:41
Tech Official
Рет қаралды 1 МЛН
Здесь упор в процессор
18:02
Рома, Просто Рома
Рет қаралды 73 М.
iPhone 16 с инновационным аккумулятором
0:45
ÉЖИ АКСЁНОВ
Рет қаралды 7 МЛН