{"id":6776,"date":"2019-10-04T09:49:42","date_gmt":"2019-10-04T09:49:42","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=6776"},"modified":"2021-11-16T09:47:14","modified_gmt":"2021-11-16T09:47:14","slug":"terraform-interview-questions-and-answer-set-1","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/terraform-interview-questions-and-answer-set-1\/","title":{"rendered":"Terraform Interview Questions and Answer &#8211; Set 1"},"content":{"rendered":"\n<p><\/p>\n\n\n\n<p><strong>External data sources must return information in what format?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. XML<\/li><li>B. HTML<\/li><li>C. JSON<\/li><li>D. YAML<\/li><\/ul>\n\n\n\n<p>Ans:  C. JSON<\/p>\n\n\n\n<p><strong>Which of the following is an example of Source Control Management software?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Jenkins<\/li><li>B. Visual Studio Code<\/li><li>C. Docker<\/li><li>D. Git<\/li><\/ul>\n\n\n\n<p>Ans: D. Git<\/p>\n\n\n\n<p><strong>Why would you use a partial configuration for a backend?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. So that you can store your AWS credentials in the configuration<\/li><li>B. To make it simpler to change the backend storage type to a new service<\/li><li>C. So that the remainder of configuration can be defined the variables<\/li><li>D. To allow backend configuration data to be defined at runtime<\/li><\/ul>\n\n\n\n<p>Ans: D. To allow backend configuration data to be defined at runtime<\/p>\n\n\n\n<p><strong>What environment variable lets Terraform know it&#8217;s running in an automation context?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. TF_AUTO_YES<\/li><li>B. TF_IN_AUTOMATION<\/li><li>C. TF_AUTOMATION<\/li><li>D. TF_AUTOMATION_TRUE<\/li><\/ul>\n\n\n\n<p>Ans: B. TF_IN_AUTOMATION<\/p>\n\n\n\n<p><strong>What is special about the default workspace?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. It is removed when you create your first workspace.<\/li><li>B. It cannot be deleted.<\/li><li>C. You cannot select it.<\/li><li>D. It is named after the main configuration file.<\/li><\/ul>\n\n\n\n<p>Ans: B. It cannot be deleted.<\/p>\n\n\n\n<p><strong>What are the four common components of Configuration Management systems?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Get, Test, Set, Put<\/li><li>B. Authorization, Accounting, Auditing, and Access<\/li><li>C. Normalization, Comparison, Accounting, and Validation<\/li><li>D. Identification, Control, Accounting, and Verification<\/li><\/ul>\n\n\n\n<p>Ans: D. Identification, Control, Accounting, and Verification<\/p>\n\n\n\n<p><strong>Which Ansible command executes a playbook?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. ansible-run-playbook<\/li><li>B. ansible-run<\/li><li>C. ansible-execute<\/li><li>D. ansible-playbook<\/li><\/ul>\n\n\n\n<p>Ans: D. ansible-playbook<\/p>\n\n\n\n<p><strong>What is the purpose of running the terraform init command?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Init will download the required plugins and modules for the configuration.<\/li><li>B. Init is an optional command to configure aliases.<\/li><li>C. Init will remove any existing resources from previous deployments.<\/li><li>D. Init will create new configuration files for you to populate.<\/li><\/ul>\n\n\n\n<p>Ans:  A. Init will download the required plugins and modules for the configuration.<\/p>\n\n\n\n<p><strong>What does the import command do?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Imports a text file containing values to be used in the configuration<\/li><li>B. Imports an existing, unmanaged resource into the Terraform configuration<\/li><li>C. Creates a new Terraform configuration for unmanaged resources<\/li><li>D. Imports the settings from a previous Terraform installation<\/li><\/ul>\n\n\n\n<p>Ans:  B. Imports an existing, unmanaged resource into the Terraform configuration<\/p>\n\n\n\n<p><strong>What type of request does the HTTP data source use?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. PUT<\/li><li>B. POST<\/li><li>C. LIST<\/li><li>D. GET<\/li><\/ul>\n\n\n\n<p>Ans:  D. GET<\/p>\n\n\n\n<p><strong>What command is being deprecated in favor of workspaces?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Production<\/li><li>B. Environment<\/li><li>C. Posture<\/li><li>D. Staging<\/li><\/ul>\n\n\n\n<p>Ans:  B. Environment<\/p>\n\n\n\n<p><strong>Which option tells Terraform to use a local directory for plugins?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. -plugin-dir=<\/li><li>B. -plugin-local=<\/li><li>C. -plugin-source=<\/li><li>D. -init-dir=<\/li><\/ul>\n\n\n\n<p>Ans:  A. -plugin-dir=<\/p>\n\n\n\n<p><strong>What format does a rendered template take?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Map<\/li><li>B. String<\/li><li>C. JSON<\/li><li>D. List<\/li><\/ul>\n\n\n\n<p>Ans:  B. String<\/p>\n\n\n\n<p><strong>Why would you use the option &#8216;-input=false&#8217; when running terraform init?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. It disables the use of variable files for input.<\/li><li>B. It ensures that Terraform only generates output.<\/li><li>C. It prevents Terraform from import files.<\/li><li>D. It prevents Terraform from prompting the user for input.<\/li><\/ul>\n\n\n\n<p>Ans:  D. It prevents Terraform from prompting the user for input.<\/p>\n\n\n\n<p><strong>What format are ansible files written in?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. JSON<\/li><li>B. HTML<\/li><li>C. YAML<\/li><li>D. XML<\/li><\/ul>\n\n\n\n<p>Ans:  C. YAML<\/p>\n\n\n\n<p><strong>What is one benefit of using an immutable deployment?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. Instances are never patched or upgraded in-place.<\/li><li>B. Instances and infrastructure are never redeployed.<\/li><li>C. It offloads all work to configuration management software.<\/li><li>D. Images are generalized and configured after the instance is created.<\/li><\/ul>\n\n\n\n<p>Ans:  A. Instances are never patched or upgraded in-place.<\/p>\n\n\n\n<p><strong>Where can you find official modules to use with Terraform?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. You must create your own<\/li><li>B. On the provider&#8217;s website<\/li><li>C. You have to request them from Hashicorp<\/li><li>D. On the Terraform module repository<\/li><\/ul>\n\n\n\n<p>Ans:  D. On the Terraform module repository<\/p>\n\n\n\n<p><strong>In the import command, what do the ADDR and ID fields represent?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. ADDR is the Terraform identifier; ID is the provider identifier.<\/li><li>B. ADDR is the name of the key; ID is the value of the key.<\/li><li>C. ADDR is the loopback address; ID is the static IP address.<\/li><li>D. ID is the Terraform identifier; ADDR is the provider identifier.<\/li><\/ul>\n\n\n\n<p>Ans:  A. ADDR is the Terraform identifier; ID is the provider identifier.<\/p>\n\n\n\n<p><strong>How is the source for a template defined?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. On the Terraform website<\/li><li>B. Using a map generated by Terraform<\/li><li>C. By pulling from GitHub<\/li><li>D. Either in-line or from a file<\/li><\/ul>\n\n\n\n<p>Ans:  D. Either in-line or from a file<\/p>\n\n\n\n<p><strong>What command must be run to configure the backend in Terraform?<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>A. terraform backend<\/li><li>B. terraform fmt<\/li><li>C. terraform plan<\/li><li>D. terraform init<\/li><\/ul>\n\n\n\n<p>Ans:  D. terraform init<\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_68071\"><figure class=\"wp-block-embed wp-block-embed-youtube is-type-video is-provider-youtube epyt-figure\"><div class=\"wp-block-embed__wrapper\"><iframe loading=\"lazy\"  id=\"_ytid_14920\"  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_68071\"  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><\/figure><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>External data sources must return information in what format? A. XML B. HTML C. JSON D. YAML Ans: C. JSON Which of the following is an example of Source Control Management software? A. Jenkins B. Visual Studio Code C. Docker D. Git Ans: D. Git Why would you use a partial configuration for a backend?&#8230;<\/p>\n","protected":false},"author":1,"featured_media":7394,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","_joinchat":[],"footnotes":""},"categories":[52,5129],"tags":[641,766,203,482,5130],"class_list":["post-6776","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-interview-questions-answers","category-terraform","tag-answers","tag-interview","tag-job","tag-questions","tag-terraform"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6776","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=6776"}],"version-history":[{"count":3,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6776\/revisions"}],"predecessor-version":[{"id":25416,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/6776\/revisions\/25416"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media\/7394"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=6776"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=6776"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=6776"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}