{"id":22730,"date":"2021-07-24T20:10:09","date_gmt":"2021-07-24T20:10:09","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=22730"},"modified":"2021-10-23T07:21:52","modified_gmt":"2021-10-23T07:21:52","slug":"interview-questions-answers-for-terraform","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/interview-questions-answers-for-terraform\/","title":{"rendered":"Interview Questions &#038; Answers for Terraform"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">Explain what Terraform is and how does it works<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What benefits infrastructure-as-code has?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Why Terraform and not other technologies? (e.g. Ansible, Puppet, CloufFormation)<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">True or False? Terraform follows the mutable infrastructure paradigm<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">True or False? Terraform uses declarative style to describe the expected end state<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain what is &#8220;Terraform configuration&#8221;<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is HCL?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain each of the following:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>Provider<\/li><li>Resource<\/li><li>Provisioner<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">What terraform.tfstate file is used for?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How do you rename an existing resource?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain what the following commands do:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li>terraform init<\/li><li>terraform plan<\/li><li>terraform validate<\/li><li>terraform apply<\/li><\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">How to write down a variable which changes by an external source or during terraform apply?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Give an example of several Terraform best practices<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain how implicit and explicit dependencies work in Terraform<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is local-exec and remote-exec in the context of provisioners?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is a &#8220;tainted resource&#8221;?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What terraform taint does?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What types of variables are supported in Terraform?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is a data source? In what scenarios for example would need to use it?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What are output variables and what terraform output does?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain Modules<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is the Terraform Registry?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain remote-exec and local-exec<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain &#8220;Remote State&#8221;. When would you use it and how?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Explain &#8220;State Locking&#8221;<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">What is the &#8220;Random&#8221; provider? What is it used for<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">How do you test a terraform module?<\/h3>\n\n\n\n<h3 class=\"wp-block-heading\">Aside from .tfvars files or CLI arguments, how can you inject dependencies from other modules?<\/h3>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_60143\"><iframe loading=\"lazy\"  id=\"_ytid_85413\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_60143\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Explain what Terraform is and how does it works What benefits infrastructure-as-code has? Why Terraform and not other technologies? (e.g. Ansible, Puppet, CloufFormation) True or False? Terraform follows the mutable&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[2],"tags":[],"class_list":["post-22730","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=22730"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22730\/revisions"}],"predecessor-version":[{"id":24250,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/22730\/revisions\/24250"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=22730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=22730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=22730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}