Terraform Interview Questions | Terraform Scenario Questions | DevOps Interview Series | Terraform
ฝัง
- เผยแพร่เมื่อ 21 ส.ค. 2024
- Terraform Real Time Interview Questions Terraform Interview Questions | Terraform Scenario Questions | DevOps Interview Series | Terraform | 03
Hey Folks,
Welcome back to another video in the series of DevOps Interviews. This is the 3rd video in this series. This is a complete 17-minute-long technical video purely on #Terraform. Pick a pen and paper, and note down the questions we have covered in this video.
LogicOps Lab - / @logicopslab
LogicOps Lab - Hindi - / @logicopslabhindi
GitHub - bit.ly/3lsUjdE
Twitter - / logicopslab
Instagram - bit.ly/3tJ9Jyf
Facebook - bit.ly/3ziMoVq
Like | Share | Subscribe | Follow
terraform devops,terraform interview questions and answers for devops engineer,terraform interview questions,terraform modules,terraform interview questions for experienced,terraform interview questions and answers,terraform scenario based,terraform scenario based interview questions,terraform scenario based questions,terraform scenario,terraform real time interview questions,terraform scenario questions,devops terraform interview questions,terraform interview
NOTICE/DISCLAIMER - We take permission/consent from the Candidate/Agency/Organisation before posting these interviews. Without consent/permission, we DO/WILL NOT publish any content in public.
Thanks me later -- > Question: When you created the environment using Terraform, what components did you create using Terraform?
Answer: I created resource groups, storage accounts, network security groups, application gateways, and VMs using Azure providers. While Terraform supports different providers like GCP or AWS, I used Azure since I have experience with it.
Question: How can you make changes in the configuration of already created resources using Terraform?
Answer: To make changes in the configuration of already created resources, we can use the terraform import command.
Question: What does Terraform do with the state file when it runs?
Answer: Terraform maintains a state file that maps the current status of the infrastructure with the configuration file. The state file is commonly stored either locally or in remote storage locations like Azure Storage or AWS S3.
Question: In case the state file is lost, how do you resolve that issue?
Answer: If the state file is lost, using the terraform import command can help. It allows Terraform to reconcile the cloud infrastructure state with the expected state.
Question: What are the major features of Terraform that you find noteworthy?
Answer: Terraform can manage infrastructure across multiple cloud platforms (Azure, GCP, AWS), uses HashiCorp Configuration Language (HCL), supports infrastructure code, and allows tracking resource changes throughout deployments.
Question: What is the full form of HCL?
Answer: HCL stands for HashiCorp Configuration Language.
Question: Can you explain the purpose of the terraform validate command?
Answer: The terraform validate command is used to validate the syntax of Terraform files, performing a syntax check to identify errors in the configuration.
Question: What is the lifecycle block in Terraform?
Answer: The lifecycle block is a nested block within a resource block, containing meta-arguments for resource behavior, such as create_before_destroy, prevent_destroy, and others.
Question: Have you worked with other tools like CloudFormation or Ansible?
Answer: Yes, I have worked with Ansible. When comparing Terraform and Ansible, the choice depends on the specific needs and the nature of the infrastructure.
Question: If given a choice between Ansible and Terraform, which one would you prefer, and why?
Answer: The choice between Ansible and Terraform depends on the specific needs. Terraform is suitable for maintaining a steady state in infrastructure, while Ansible excels in managing and configuring evolving environments.
Question: Have you heard about Pulumi?
Answer: Yes, I have heard about Pulumi. One notable feature is that Pulumi allows using multiple languages like Python, TypeScript, or JavaScript for configuration.
Question: Have you heard about Bicep or ARM templates?
Answer: Yes, I have heard about Bicep, and I have worked on ARM templates in the past.
Question: Is it possible to destroy a single resource out of multiple resources using Terraform?
Answer: Yes, it is possible. We can use the terraform destroy -target command followed by the resource type and name to destroy a specific resource.
Question: How do you preserve keys created using Terraform?
Answer: Keys created using Terraform can be preserved by storing them in the AWS CLI configuration folder under the credentials directory and instructing Terraform to use a specific profile during execution.
Question: What happens if the Terraform state file is accidentally deleted?
Answer: If the Terraform state file is deleted, Terraform may duplicate all resources, leading to increased costs and potential issues with overlapping and cross-pollination between resources.
Question: Have you worked with Terraform modules?
Answer: Yes, I have worked with Terraform modules. There are root modules, child modules, and published modules in Terraform.
Question: How do you manage Terraform code in multiple environments?
Answer: Terraform workspaces and reusable modules can be used to manage Terraform code in multiple environments, allowing separate state files for each workspace.
Question: What is Terraform workspace used for?
Answer: Terraform workspace allows managing separate state files for each workspace, enabling different environment processing.
Question: How do you provide variable values at runtime in Terraform?
Answer: To provide variable values at runtime in Terraform, the default values in the variable file (variable.tf) can be removed, and the values can be provided when running the Terraform command.
Question: Why is Terraform called "Infrastructure as Code"?
Answer: Terraform is referred to as "Infrastructure as Code" because it involves writing code to provision, manage, and deploy infrastructure. It uses a declarative approach to define infrastructure elements using HashiCorp Configuration Language (HCL).
Question: Can you mention some drawbacks of Terraform based on your experience?
Answer: Some drawbacks include a lack of error handling, restriction to a specific language (HCL), limitations on importing certain things, lack of script generation support, and occasional bugs in specific Terraform versions.
Question: In your organization, which version of Terraform are you currently using?
Answer: Currently, we are not using Terraform in our organization.
This is amazing!!! 😍
super bro saved my times thanks
Thanks alot brother ❤
Amazing
did you used any AI, to get this text?
if yes, can you please drop the AI name
Seems like the answers are being read....such smooth articulation is sus!
Anyways, a good mock interview at the least
..cheers
Thanks for the feedback.
Great concepts and fluent answers. similar questions were asked during my interviews.
Thanks a lot for your support.
Hi, I am not here to demean your effort but I am terraform engineer working in Ireland and this questionnaire answers are theoretical and looks like someone is reading script whereas in general , I have given or taken a whiteboard based Terraform interview writing a piece of code.
Thanks for the feedback, Teena. Would you like to connect over LinkedIn and discuss over points like these?
It'd be helpful for fellow devops engineers and they can prepare better.
Do let me know if you can help the community out. Thanks!
I don't think there was anything wrong with the answers, even if they are "theoretical".
Hi can you send your link for terraform interview
Sahi pakde ho...
Majority of his videos follow this template
Teena is absolutely correct.but it helps a bit to get some questions how to handle orally, writing scripts is the realistic interview pattern.I have gone through open the notepad.show me scripts to open the terraform automation and yaml such stuff with real scenarios based.what we have done in the pjcts mentioned as in Resume.
All the answers given in reading notes, for example
lifecycle is a nested block that can appear within a resource block. The lifecycle block and its contents are meta-arguments, available for all resource blocks regardless of type.
The arguments available within a lifecycle block are create_before_destroy, prevent_destroy, ignore_changes, and replace_triggered_by
Flawless interview 👍. Please also include the part where candidates introduce themselves and talk about their BAU. Need more such videos. Many thanks Ravish.
Thanks for the support, Amol. Apologies, I actually cannot reveal the identity of the candidates.
Did everyone miss this? "Currently, we are not using Terraform in our organization." You can handle errors, you can run scripts, the AWS S3 is about the worst of the storage options, import is best done by import block, not by command anymore. Just to name a few issues with the answers.
For a long time I was looking for this type of interview questions , Again thanks 😊
Glad to hear that.
Amazing confidence. Such perfect answers, selection is must. I wonder I'd have this much grasp over Terraform.
Thanks for putting this together 🙏🏻
Means a lot
Dont believe..i think its a plot
Seems just learned phrases or even reading it. Sound absolutely not natural.
are you the same Riddhima from Ansible interview
🤣
Perfect example, that's something I was looking for.
Questions in this Interview:
When you created the environment using Terraform, what components did you set up using Terraform?
How do you make changes to the configuration of already created resources using Terraform?
When the Terraform state file is created, what do you do with that state file and where do you store and find it?
How do you resolve the issue if you lose the Terraform state file?
What are the major features you have found in Terraform that you can talk about?
What are the major features you have found in Terraform that you can talk about?
What is the `terraform validate` command used for, and can you provide an example?
Have you ever heard about the lifecycle in Terraform? Can you talk more about it?
Have you worked with tools like CloudFormation, Ansible, or anything similar?
Do you have any experience with Ansible?
If you had to choose between Ansible and Terraform, which one would you prefer and why?
In your current organization, which tool are you using: Ansible, Terraform, or Pulumi?
Can you talk about any features of Pulumi that you find particularly useful or impressive?
Have you ever heard about Bicep or ARM templates?
In a scenario where you have 20 resources running on a public cloud (AWS or Azure) and you want to destroy just one resource, how would you go about doing that?
Have you ever preserved a key that you created using Terraform?
What happens if you delete the Terraform state file and then run the `terraform apply` or `terraform plan` command?
Have you ever worked with modules in Terraform?
What are the different types of modules in Terraform?
The module that gets called is what: a parent module or a child module?
From where we call a module, what is that module called?
Have you ever heard about remote backends in Terraform? Do you have any ideas or experience with them?
How can you provide variable values at runtime in Terraform?
In an organization, how do you manage multiple environments in Terraform?
Why do we call Terraform "Infrastructure as Code" (IaC)? Is there a particular reason for this?
Can you explain some drawbacks or challenges you have faced in your career?
Which version of Terraform are you using?
Awesome Interview. Learning a lot from your Interview videos. Keep up the good work and keep posting content like this. Thanks 👍💯
Means a lot, Rachit! 🙏🏻
Nice video who actually don't know terrform it will be useful
Appreciate it, mate
Sharing knowledge is also - Caring for others
Thank you!
Thanks
Thanks Ravish bhai. Nice interview. At 3:40, the interviewee mentioned about infra costs getting doubled if we try to recreate the terraform configuration using terraform apply in case we lose the state file, which is understood.....what would nasty cross-pollination exactly mean?
Thank you for making these inetrview series but i heared all questions and answers and noticed that the candidate giving answer from google same as witten there nice startegy . Thats's why both are not showing there face 🤓🤓🤓🤓🤓
Thanks for the feedback. No personal information has to revealed, thus no faces. I hope you understand and still support us.
Perfect thanks bro . Please share more interviews Questions and answers ❤
Sure, will do that.
Boss if we delete 1 resource manually out of three resource created by terraform apply then it will not create entire infra after we do terraform apply. existing resources will not change if no changes happened
Thank you So much. Awesome Interview
Glad you liked it.
life cycle of terraform?
copy paste from terraform documentation.
lifecycle is a nested block that can appear within a resource block. The lifecycle block and its contents are meta-arguments, available for all resource blocks regardless of type.
The arguments available within a lifecycle block are create_before_destroy, prevent_destroy, ignore_changes, and replace_triggered_by.
exactly.. i noticed this too... it felt as if he read through the lines.
Thanks for the feedback, folks.
Sir please make a video answering those questions (Q & A session)
Apologies, I was not keeping well. Will drop by the end of this week.
@@LogicOpsLab just came across this. Did you drop it?
very informative and useful video 👍
Thanks a lot
Osm videos.
Can you please make video on Prometheus and Grafana interview.
Sure thing
Either this is scripted or the person is pro the choice is words are pretty impressive personally have never had such an experience
Same feeling, Sidharth. Worked with the candidate personally. Believe me, the candidate was that good. Unfortunately, left after a year, the last time I heard the candidate was with Walmart.
@@LogicOpsLab how much exp?
@@sidharthvijayakumar3521 Less than 4, I guess. Not sure now.
Hi please let me know answer for this question - How to do the changes in the configuration of already created resources using Terraform
Terraform import
Yes, terraform import
Informative video ❤
Glad it was helpful.
Good but you need to impove to present the video to reach each and every one. It's better to have either subtitles or word pad with questions and answers along with his tone.
Feedback taken, thank you for the same.
Thank you, amazing
Glad to hear that.
tanq bro keep for u r doing such a nice videos
Glad to hear that 💪🏻
Superb
Thanks for the support.
Good candidate
Great man!!!
Means a lot
Bro small suggestions please dont mind.
1. Starting 2 mins is too much of introduction
2. Can you please give sub titles as voice is not clear and also if possible make it slides and more interactive
Noted. Thanks for letting us know. We will improve on this for sure.
Tq much helpful
Cheers, mate!
🔥🔥
In most of the cases if the state file is deleted and you run again, It would fail saying the resource already exists. right?
No cuz it says already exists because there was state file that where your all infrastructure state details store. Since u delete it it will create new resources and could be overlapping
Good one 👍
Thank you
how to do changes in terraform for already created resouces -->ans using terraform plan ...not import i think
terraform import command is used in Terraform to import existing infrastructure resources into the Terraform state.
It is import
Example - terraform import aws_instance.my_instance i-0123456789abcdef0
Good video
Thanks for the visit
Hi , From last one month following the DevOps interview questions. you are able to provide the interview questions each tool in devops. If it chargeable if yes I will pay the amount. I am basically working as Linux & AWS Engineer. Moving to DevOps end. Please help me to crack the interviews.
I don't charge a thing, as of now. But, I don't have a list. You can connect with me on LinkedIn.
Hi bro,
Any suggestion on how interview questions would be in Onshore round.
Thanks,
Onshore? You mean client round?
@@LogicOpsLab yes
Ok the candidate is reading from official documentation. :D
Ya, some people do read the official documentation which I think is the best way to learn and explain while giving interviews.
Is there a way that you can give the answers in your own voice? Those of us that are not accustomed to hearing various types of english cannot understand some of the interviewees
Thanks for the suggestion. Will try doing the same soon.
Is that ok, if we dont work on Terraform, but went to a Terraform interview?
Not okay, these days people might ask you to write a Terraform code file.
Good stuff thanks 👍
Thanks a bunch
Are these a video call interview or an audio call?
Audio separated from a video call. This is done as we do not want to reveal the identity of the person.
I was looking for some good questions on terraform, very well explained and good bunch of questions. Just had one doubt as after tfstate file get deleted and a person tries to run the terraform code again will it give already exist or duplicate. As we are not changing the name , can you explain this briefly.
Glad I could help! Made my evening!
Also, to answer your question, If you attempt to run your Terraform code again after deleting the state file without any changes to the resource names, Terraform will not be aware of the existing resources, and it will attempt to recreate them. When you delete the state file, Terraform no longer has that mapping information, so it will assume the resources do not exist and will proceed to create them again.
In cases where the state file is deleted accidentally or lost, you can import existing resources into Terraform's state, but this process can be more complex and error-prone.
Ok, Ok, Ok, "Joe Pesi" 😁
Sorry, didn't understand. Kindly explain.
Sounds like fluffy chat GPT when he talks, the interviewee. I can't see hiring somebody who is either reading or memorized the questions and answers
When was ChatGPT released?
When is this interview uploaded?
But, thanks for the feedback.
@@LogicOpsLab2020 codex was live. LLMs existed before that as well
Share some advance level of interview .
Getting real time interviews is very tough these days. But, I am still working on it.
The answers are so generic. I don't think anybody would answer to questions like they are reading from a paragraph. Still great video to refresh the IaC scenarios.
Appreciate the feedback, Anish.
Do you take any mock interview ji?
Not exactly, but, if you want I can take yours.
i bet this candidate is just reading the answers
Nopes. Took a demo later. The candidate was that good.
If he was reading he would have taken pause to at least look for the answers..common sense 🤦 why can't people understand there are some candidates who can be this good ... honestly even I was trying to answer the questions and almost answered 80% .. anyway great job Ravish..🙂
terraform remote command ????
i dont understand this
can u explain it
3:50
terraform import
Terraform can import existing infrastructure resources. This functionality lets you bring existing resources under Terraform management.
@@LogicOpsLab thanks bro
It looks like her ansible candidate is similer as this one
Could be possible. There are multiple rounds on multiple technologies.
What's the total experience of the candidate?
I think close to 4.
all good but the voice of the candidate is irritating !!
Thanks a lot for the feedback. The voice is modified due to candidate's privacy. Apologies for the inconvenience.
good but i found that he is answering from google😂, exact same wording and sentences.
Could be possible, people do a lot of that. But, let's stay positive and take the good part from it and forget the rest.
I hope he/she had the camera open during the interview.
Yes, it was open the whole time.
People can't believe as the candidate is so good. But it's clear he is very intelligent and not reading and giving answers..🙂
@@subhalaxmidash9993 Thanks for the feedback. The voice has been modified, it's a 'She', and the candidate was really good.
...🙏...
These questions are very basic for terraform developer it will not help anyone to get the job
Thank you for sharing your thoughts with us. We greatly appreciate your feedback. We strive to create content that caters to a diverse audience, ranging from beginners to experienced professionals, in order to foster a supportive learning environment for all.
While some of our questions may appear basic to more seasoned Terraform developers or devops, they are intentionally designed to serve as foundational knowledge for those who are new to the field. Our aim is to help aspiring devops grasp the fundamental concepts before progressing to more advanced topics.
Devops related pdf share karde
Didn't get you?
Thikanae bat kr pahile
you speak too fast with not very clear English,
Not sure if that is a compliment or an issue. Ha Ha!
Please set the speed to 0.75 and you wood be good to go!