Deck-1 Flashcards
What are the features exclusive to Terraform Enterprise? Choose 2 correct answeres.
SAML SSO
Auto Logging
When writing Terraform code, HashiCorp recommends that you use how many spaces between each nesting level?
2 spaces
Default workspace cannot be deleted?
True
Why should you constrain the acceptable provider versions in Terraform configuration for production use?
Provide version constraints make sure only matching versions are cached under the plugin directory and remove other versions to optimized disk space usage.
Providers are plugins released on a separate rhythm from Terraform, so providers have their own version numbers, and version constraint ensures that new versions with breaking changes will not be automatically installed by terraform init in the future.
Medium Corp is making use of an open-source version of Terraform. You have created a number of reusable modules for various components that you want to share with your team.
What is the right approach to do that?
Terraform modules cannot be shared in the OSS version. Each developer needs to maintain its own modules and leverage them in the main tf file.
Upload your modules with proper versioning in the terraform module registry. Terraform OSS is directly integrated with the public module registry and can reference the modules from the code in the main tf file.
The terraform refresh command is used to reconcile the state Terraform knows via its _______
with the real-world infrastructure.
state file
Where does terraform store the data associated with the current state of your infrastructure when terraform plan is run?
state file
Which of the following will allow Matthew to stream the output of terraform plan that is running in Terraform Cloud locally?
Remote Backends
Which Terraform files should be ignored by Git when committing code to a repository? (Choose Three)
Files named exactly terraform.tfvars or terraform.tfvars.json
terraform.tfstate
Any files with names ending in .auto.tfvars or .auto.tfvars.json
Before a new provider can be used, it must be ______ and _______.
declared in the configuration.
initialized
The following snippet is from the Terraform 0.11 version. Which of the below is the equivalent 0.12 version code?
${var.instance_types}”
var.instance_types
When terraform refresh command is run, what are the operations that happen?
terraform refresh syncs the state file with the real world infrastructure.
What tasks are achieved while running a terrafom plan?
Create an execution plan by evaluatating the difference between the configuration file and state file.
Which of the following commands will implicitly not run terraform refresh?
terraform init
Which of the following variable declarations is going to result in an error?
Lists are defined with [ ] and maps are defined with { }.
When it comes to Terraform 0.12, what does the terraform init command do? Choose THREE correct answers.
1) Sees the root configuration directory for backend configuration, and initialized the chosen backend.
2) Searches for module blocks and the source code for referenced modules is retrieved from the locations given in their source arguments.
3) Searches the configuration for direct and indirect references to providers and load plugins distributed by Hashicorp.
True or False. The terraform refresh command is used to reconcile the state
Terraform knows about (via its state file) with
the real-world infrastructure.
If drift is detected between the real-world
infrastructure and the last known-state, it will modify the
infrastructure to correct the drift.
False.
Peter Griffin used Terraform to spin up a disposable environment for a product demo. The demo is complete now; hence he needs to destroy all the resources he created for this demo to avoid hourly charges. Since he also has few production instances on the same AWS account, he wants to review resources before deleting to be sure Terraform will not cause any unforeseen downtime. What are the options for doing that? Choose TWO correct answers.
terraform plan -destroy
terraform destroy
Which flag would be used within a Terraform configuration block to identify the specific version of a provider required?
required_providers
Modules sourced from local file paths support version meta-argument within module blocks.
false
Terraform refresh is automatically run in which of the following commands? Select 2
terraform plan
terraform apply
Select the most accurate statement to describe the Terraform language from the following list.
terraform is an immutable, declarative, infrastructure as code provisioning language based on Hashicorp Configuration Language or optionally JSON.
Which of the following command is used to list all resources within a Terraform state?
terraform state list.
Which among the following is the default backend for Terraform OSS?
local
Which of the following action is not performed by terraform apply command?
import resource
Which of the following terraform commands run refresh first, prior to any other work unless explicitly disabled? Choose THREE correct answers.
terraform destroy
terraform apply
terraform plan
There can be multiple tfvars file were value associated with the variables that can be stored.
Which of the following files are loaded automatically without having to specify the -var-file option?
Any files with names ending with .auto.tfvars.json
terraform. tfvars
terraform. tfvars.json