The terraform.tfstate file always matches your currently built infrastructure.
ATrue
BFalse
You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code.
What is the best method to quickly find the IP address of the resource you deployed?
ARun terraform output ip_address to view the result
BIn a new folder, use the terraform_remote_state data source to load in the state file, then write an output for each resource that you find the state file
CRun terraform state list to find the name of the resource, then terraform state show to find the attributes including public IP address
DRun terraform destroy then terraform apply and look for the IP address in stdout
You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?
AAdd node_count = var.node_count
BDeclare the variable in a terraform.tfvars file
CDeclare a node_count input variable for child module
DNothing, child modules inherit variables of parent module
If a module declares a variable with a default, that variable must also be defined within the module.
ATrue
BFalse
Which option cannot be used to keep secrets out of Terraform configuration files?
AEnvironment Variables
BMark the variable as sensitive
CA Terraform provider
DA -var flag
Which of the following arguments are required when declaring a Terraform output?
Asensitive
Bdescription
Cdefault
Dvalue
Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Enterprise automatically and proactively enforce this security control?
AWith a Sentinel policy, which runs before every apply
BBy adding variables to each TFE workspace to ensure these settings are always enabled
CWith an S3 module with proper settings for buckets
DAuditing cloud storage buckets with a vulnerability scanning tool
Most Terraform providers interact with ____________.
AAPI
BVCS Systems
CShell scripts
DNone of the above
terraform validate validates that your infrastructure matches the Terraform state file.
ATrue
BFalse
What does terraform import allow you to do?
AImport a new Terraform module
BUse a state file to import infrastructure to the cloud
CImport provisioned infrastructure to your state file
DImport an existing state file to a new Terraform workspace
FILL BLANK -
In the below configuration, how would you reference the module output vpc_id?
Type your answer in the field provided. The text field is not case sensitive and all variations of the correct answer are accepted.
How would you reference the Volume IDs associated with the ebs_block_device blocks in this configuration?
Which of the following is not a key principle of infrastructure as code?
AVersioned infrastructure
BGolden images
CIdempotence
DSelf-describing infrastructure
What does state locking accomplish?
ACopies the state file from memory to disk
BEncrypts any credentials stored within the state file
CBlocks Terraform commands from modifying the state file
DPrevents accidental deletion of the state file
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
ARun terraform apply -upgrade
BRun terraform init -upgrade
CRun terraform refresh
DUpgrade your version of Terraform
A module can always refer to all variables declared in its parent module.
ATrue
BFalse
When you use a remote backend that needs authentication, HashiCorp recommends that you:
AUse partial configuration to load the authentication credentials outside of the Terraform code
BPush your Terraform configuration to an encrypted git repository
CWrite the authentication credentials in the Terraform configuration files
DKeep the Terraform configuration files in a secret store
You have a simple Terraform configuration containing one virtual machine (VM) in a cloud provider. You run terraform apply and the VM is created successfully.
What will happen if you terraform apply again immediately afterwards without changing any Terraform code?
ATerraform will terminate and recreate the VM
BTerraform will create another duplicate VM
CTerraform will apply the VM to the state file
DNothing
A junior admin accidentally deleted some of your cloud instances. What does Terraform do when you run terraform apply?
ABuild a completely brand new set of infrastructure
BTear down the entire workspace infrastructure and rebuild it
CRebuild only the instances that were deleted
DStop and generate an error message about the missing instances
You have created a main.tr Terraform configuration consisting of an application server, a database, and a load balancer. You ran terraform apply and all resources were created successfully. Now you realize that you do not actually need the load balancer so you run terraform destroy without any flags What will happen?
ATerraform will destroy the application server because it is listed first in the code
BTerraform will prompt you to confirm that you want to destroy all the infrastructure
CTerraform will destroy the main.tf file
DTerraform will prompt you to pick which resource you want to destroy
ETerraform will immediately destroy all the infrastructure
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
Aprovider
Bresource
Clocal
Ddata
You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.
Which Terraform command should you run first?
Aterraform apply
Bterraform plan
Cterraform show
Dterraform init
All modules published on the official Terraform Module Registry have been verified by HashiCorp.
ATrue
BFalse
Terraform variables and outputs that set the "description" argument will store that description in the state file.
ATrue
BFalse
You have to initialize a Terraform backend before it can be configured.