Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
The concept of infrastructure as code (IaC) is to define and manage infrastructure using code, rather than manual processes or GUI tools. A script that contains a series of public cloud CLI commands is an example of IaC, because it uses code to provision resources into a public cloud. The other options are not examples of IaC, because they involve manual or interactive actions, such as running curl commands, sending REST requests, or entering commands into a console.Reference= [Introduction to Infrastructure as Code with Terraform] and [Infrastructure as Code]
What is the name of the default file where Terraform stores the state?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
The name of the default file where Terraform stores the state isterraform.tfstate. This file contains a JSON representation of the current state of the infrastructure managed by Terraform. Terraform uses this file to track the metadata and attributes of the resources, and to plan and apply changes. By default, Terraform stores the state file locally in the same directory as the configuration files, but it can also be configured to store the state remotely in a backend.Reference= [Terraform State], [State File Format]
A terraform apply can not _________ infrastructure.
The terraform import command is used to import existing infrastructure into Terraform's state. This allows Terraform to manage and destroy the imported infrastructure as part of the configuration. The terraform import command does not modify the configuration, so the imported resources must be manually added to the configuration after the import.Reference= [Importing Infrastructure]
Which command lets you experiment with terraform expressions?
This is the command that lets you experiment with Terraform expressions, by providing an interactive console that allows you to evaluate expressions and see their results. You can use this command to test your expressions before using them in your configuration files.
A senior admin accidentally deleted some of your cloud instances. What will Terraform do when you run terraform apply?
Terraform detects infrastructure drift by comparing thestate filewith the actual infrastructure.
When an instance ismanually deleted, Terraformsees it as missingand marks it for recreation.
Running terraform apply willonly recreate the missing instanceswhile leaving the rest of the infrastructure unchanged.
Explanation of incorrect answers:
A (Tear down everything and rebuild)-- Incorrect. Terraform does not destroy existing infrastructure unless explicitly told to.
B (Build a completely new set of infrastructure)-- Incorrect. Terraform does not create duplicates unless configuration changes.
D (Stop and error out)-- Incorrect. Terraform does not fail; itrebuilds missing resourcesautomatically.
Official Terraform Documentation Reference:
Handling Infrastructure Drift
Thomas King
23 days agoSteven Reed
1 month agoMelissa Mitchell
2 months agoCharles Bell
2 months agoJustin Baker
3 months agoRebecca Lewis
3 months agoThomas Miller
4 months agoFrank King
4 months agoFrank Hall
5 months agoEdward Baker
5 months agoElizabeth Cooper
6 months agoGerald Carter
6 months agoJames Ramirez
6 months agoJessica Flores
5 months agoRichard Allen
6 months agoMark Cook
5 months agoDarrel
7 months agoGearldine
7 months agoDonte
7 months agoLorrie
7 months agoSkye
8 months agoLavonda
8 months agoAudrie
8 months agoDong
8 months agoLigia
9 months agoLynelle
9 months agoElise
9 months ago