Free preview mode
Enjoy the free questions and consider upgrading to gain full access!
Terraform Associate
Free trial
Verified
Question 26
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
- A: Cloud infrastructure
- B: The .terraform directory
- C: The execution plan
- D: State file
- E: Terraform code
Question 27
A Terraform backend determines how Terraform loads state and stores updates when you execute ___________.
- A: apply
- B: taint
- C: destroy
- D: All of the above
- E: None of the above
Question 28
What does Terraform use .terraform.lock.hcl file for?
- A: Tracking provider dependencies
- B: There is no such file
- C: Preventing Terraform runs from occurring
- D: Storing references to workspaces which are locked
Question 29
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?
- A: Use the terraform state rm command to remove the VM from state file
- B: Use the terraform taint command targeting the VMs then run terraform plan and terraform apply
- C: Use the terraform apply command targeting the VM resources only
- D: Delete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply
Question 30
How do you specify a module's version when publishing it to the public Terraform Module Registry?
- A: The module's configuration page on the Terraform Module Registry
- B: Terraform Module Registry does not support versioning modules
- C: The release tags in the associated repo
- D: The module's Terraform code
Question 31
Terraform plan updates your state file.
- A: True
- B: False
Question 32
To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?
- A: terraform fmt -check
- B: terraform fmt -write-false
- C: terraform fmt ג€"list -recursive
- D: terraform fmt -check -recursive
Question 33
As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provision is best to use in your Terraform code?
- A: null-ex׀µׁ
- B: local-exec
- C: remote-exec
- D: file
Question 34
You are using a networking module in your Terraform configuration with the name label my_network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?
- A: Define the attribute vnet_id as a variable in the networking module
- B: Change the referenced value to module.my_network.outputs.vnet_id
- C: Define the attribute vnet_id as an output in the networking module
- D: Change the referenced value to my_network.outputs.vnet_id
Question 35
What is the provider for this fictitious resource?
- A: vpc
- B: main
- C: aws
- D: test
Question 36
You are writing a child Terraform module which provisions an AWS instance. You want to make use of the IP address returned in the root configuration. You name the instance resource "main".
Which of these is the correct way to define the output value using HCL2?
A.
B.
Question 37
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? (Choose two.)
- A: A full audit trail of the request and fulfillment process is generated
- B: A request must be submitted for infrastructure changes
- C: As additional resources are required, more tickets are submitted
- D: A catalog of approved resources can be accessed from drop down lists in a request form
Question 38
Which of the following statements about Terraform modules is not true?
- A: Modules must be publicly accessible
- B: Modules can be called multiple times
- C: Module is a container for one or more resources
- D: Modules can call other modules
Question 39
Which Terraform collection type should you use to store key/value pairs?
- A: tuple
- B: set
- C: maׁ€
- D: list
Question 40
You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your
Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)
- A: Run terraform plan -destroy
- B: Run terraform show -destroy
- C: Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval
- D: Run terraform show -destroy
Question 41
When do you need to explicitly execute terraform refresh?
- A: Before every terraform plan
- B: Before every terraform apply
- C: Before every terraform import
- D: None of the above
Question 42
All Terraform Cloud tiers support team management and governance.
- A: True
- B: False
Question 43
What advantage does an operations team that uses infrastructure as code have?
- A: The ability to delete infrastructure
- B: The ability to update existing infrastructure
- C: The ability to reuse best practice configurations and settings
- D: The ability to autoscale a group of servers
Question 44
You have modified your Terraform configuration to fix a typo in the Terraform ID of a resource from aws_security_group.http to aws_security_group.http
Which of the following commands would you run to update the ID in state without destroying the resource?
- A: terraform mv aws_security_group.htp aws_security_group.http
- B: terraform apply
- C: terraform refresh
Question 45
You are creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog.
Which of the following provider blocks would allow you to do this?
A.
B.
C.
Question 46
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
- A: Run terraform refresh
- B: It will happen automatically
- C: Manually update the state fire
- D: Run terraform import
Question 47
Terraform variable names are saved in the state file.
- A: True
- B: False
Question 48
Terraform Cloud is available only as a paid offering from HashiCorp.
- A: True
- B: False
Question 49
Which of the following is not a way to trigger terraform destroy?
- A: Using the destroy command with auto-approve
- B: Running terraform destroy from the correct directory and then typing "yes" when prompted in the CLI
- C: Passing --destroy at the end of a plan request
- D: Delete the state file and run terraform apply
Question 50
Which of the following is not an advantage of using infrastructure as code operations?
- A: Self-service infrastructure deployment
- B: Troubleshoot via a Linux diff command
- C: Public cloud console configuration workflows
- D: Modify a count parameter to scale resources
- E: API driven workflows
Free preview mode
Enjoy the free questions and consider upgrading to gain full access!