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
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style. This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability. Running this command on your configuration files before committing them to source control can help ensure consistency of style between different Terraform codebases, and can also make diffs easier to read.You can also use the -check and -diff options to check if the files are formatted and display the formatting changes respectively2.Running the terraform fmt command during the code linting phase of your CI/CD process can help automate this process and enforce the formatting standards for your team.Reference= [Command: fmt]2
You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine instance with an identical one without affecting the database. What is the best way to achieve this using Terraform?
The terraform taint command marks a resource as tainted, which means it will be destroyed and recreated on the next apply. This way, you can replace the VM instance without affecting the database or other resources.Reference= [Terraform Taint]
Charles Bell
14 days agoJustin Baker
28 days agoRebecca Lewis
1 month agoThomas Miller
2 months agoFrank King
3 months agoFrank Hall
3 months agoEdward Baker
3 months agoElizabeth Cooper
4 months agoGerald Carter
4 months agoJames Ramirez
4 months agoJessica Flores
3 months agoRichard Allen
4 months agoMark Cook
4 months agoDarrel
5 months agoGearldine
5 months agoDonte
5 months agoLorrie
5 months agoSkye
6 months agoLavonda
6 months agoAudrie
6 months agoDong
6 months agoLigia
7 months agoLynelle
7 months agoElise
7 months ago