InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
Explain the workflow of the core terraform. |
|
Answer» Terraform's CORE workflow consists of THREE steps:
|
|
| 2. |
What do you understand about providers in the context of Terraform? |
|
Answer» To INTERFACE with cloud providers, SaaS providers, and other APIs, Terraform uses plugins CALLED "providers." Terraform configurations must specify the providers they need in order for Terraform to install and use them. Some providers also require setup (such as endpoint URLS or cloud regions) before they may be used. Terraform may manage a set of resource types and/or data sources that each provider contributes. A provider implements each resource type; Terraform would be unable to manage any infrastructure without them. The majority of service providers set up a specific infrastructure PLATFORM (either cloud or self-hosted). Local utilities, such as generating random numbers for unique resource names, can be OFFERED by providers. |
|
| 3. |
Mention some of the version control tools supported by Terraform. |
|
Answer» Some of the VERSION CONTROL tools supported by Terraform are as FOLLOWS:
|
|
| 4. |
Explain the command terraform version in the context of Terraform. |
|
Answer» The terraform version command shows the current Terraform version as well as any INSTALLED plugins. Syntax: terraform version [options] UNLESS DISABLED, the version will display the Terraform version, the platform it's installed on, installed providers, and the results of upgrade and security checks with no EXTRA arguments. There is one optional flag for this command: If you SPECIFY -json, the version information is formatted as a JSON object, with no upgrade or security information. |
|
| 5. |
Explain the command terraform apply in the context of Terraform. |
|
Answer» The terraform apply command is used to carry out the tasks in a Terraform plan. The simplest method to use terraform apply is to run it WITHOUT any arguments, in which case it will construct a new EXECUTION plan (as if you had run terraform plan) and then request you to accept it before doing the activities you specified. Another approach to use terraform apply is to SUPPLY it the filename of a saved plan file generated with terraform plan -out=..., in which case Terraform will apply the modifications to the plan without PROMPTING for CONFIRMATION. This two-step process is most useful when using Terraform in an automated environment. Syntax: terraform apply [options] [plan file] |
|
| 6. |
Explain the command terraform validate in the context of Terraform. |
|
Answer» The terraform validate command verifies the configuration files in a directory, focusing solely on the configuration and excluding any outside services such as remote state, provider APIs, and so on. Validate performs checks to see if a configuration is syntactically correct and internally CONSISTENT, REGARDLESS of any variables or current state. As a result, it's best used for general verification of reusable modules, such as ensuring that attribute names and value types are correct. This command can be executed automatically, for example as a post-save check in a TEXT editor or as a test step for a reusable module in a continuous integration system. Syntax: terraform validate [options] The following options are available with this command:
|
|
| 7. |
Explain null resource in the context of Terraform. |
|
Answer» The NULL resource is a resource that lets you SET up provisioners that aren't directly linked to any current resource. Because a null resource behaves like any other resource, you can configure provisioners, CONNECTION details, and other meta-parameters just like any other resource. This gives you more precise control over when provisioners execute in the dependency GRAPH. |
|
| 8. |
What are some guidelines that should be followed while using Terraform modules? |
|
Answer» Following are some of the guidelines that should be followed while using Terraform modules :
|
|
| 9. |
What are the benefits of using modules in Terraform? |
|
Answer» Following are the benefits of using modules in Terraform :
|
|
| 10. |
What do you understand about Terraform modules? |
|
Answer» A Terraform module is a single directory containing Terraform CONFIGURATION files. Even a simple arrangement with a single directory having one or more files can be referred to as a module. The files have the extension .tf. This directory is referred to as the root module when Terraform commands are RUN directly from it. Terraform commands will only use the configuration files in one location: the current working directory. Your configuration, on the other hand, can employ module blocks to call modules from other directories. When Terraform comes across a module block, it loads and processes the configuration files for that module. A module that is CALLED by another configuration is FREQUENTLY referred to as that configuration's "CHILD module." |
|
| 11. |
Explain the destroy command in the context of Terraform. |
|
Answer» The terraform destroy command is a simple WAY to eliminate all remote OBJECTS maintained by a Terraform setup. While you should avoid destroying long-lived objects in a production environment, Terraform is occasionally used to MANAGE temporary infrastructure for development, in which case you can use terraform destroy to quickly clean up all of those temporary objects after you're done. Syntax: terraform destroy [options] You may also execute the following command to build a speculative destroy plan to see what the effect of destroying MIGHT be: terraform -destroy plan This will launch Terraform Plan in destroy mode, displaying the PROPOSED destroy changes but not allowing you to execute them. |
|
| 12. |
What do you understand about Terraform Cloud? |
|
Answer» TERRAFORM Cloud is a collaboration tool for teams using Terraform. It offers easy access to shared STATE and secret data, access controls for approving infrastructure modifications, a private registry for sharing Terraform modules, full policy controls for managing the contents of Terraform configurations, and more. Terraform Cloud is a hosted service that can be found at https://app.terraform.io. Terraform allows small teams to connect to version control, share variables, run Terraform in a reliable REMOTE environment, and securely save remote state for FREE. Paid tiers provide you with the ability to add more than five PEOPLE, establish teams with varying levels of access, enforce policies before building infrastructure, and work more efficiently. Large businesses can utilise the Business tier to scale to multiple concurrent runs, establish infrastructure in private environments, manage user access using SSO, and automate infrastructure end-user self-service provisioning. |
|
| 13. |
Mention some of the major competitors of Terraform. |
|
Answer» Following are some of the major competitors of Terraform:
|
|
| 14. |
Why is Terraform preferred as one of the DevOps tools? |
|
Answer» Following are the reasons that Terraform is preferred as one of the DevOps tools :
|
|
| 15. |
What do you mean by terraform init in the context of Terraform? |
|
Answer» The terraform init command creates a working directory in which Terraform CONFIGURATION files can be FOUND. After creating a new Terraform configuration or cloning an OLD one from version control, run this command first. It is safe to use this command more than once. Despite the fact that successive runs may result in errors, this command will never overwrite your current SETTINGS or state. Syntax: terraform init [options] The following options can be used in conjunction with the init command :
|
|
| 16. |
Is it feasible to use Terraform on Azure with callbacks? Sending a callback to a logging system, a trigger, or other events, for example? |
|
Answer» Yes. Azure EVENT Hubs can be used to accomplish this. This capability is now ACCESSIBLE in the Terraform AzureRM PROVIDER. Terraform's Azure supplier provides USERS with simple functionality. Microsoft Azure Cloud Shell includes a Terraform occurrence that has ALREADY been setup. |
|
| 17. |
What are the use cases of Terraform? |
|
Answer» Following are the USE cases of Terraform:
|
|
| 18. |
What are the key features of Terraform? |
|
Answer» Following are the key features of Terraform:
|
|