HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and Answers
You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After application changes, you updated the Terraform code to change the port to 443.
You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended and step away to grab some coffee.
In the meantime, another team member manually changes the load balancer port to 443 through the cloud provider console before you get back to your desk.
What will happen when you run terraform apply upon returning to your desk?
A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
What is the workflow for deploying new infrastructure with Terraform?
Which of these is true about Terraform's plugin-based architecture?
What functionality do providers offer in Terraform?(Pick 3 correct responses)
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.
Which command will migrate your current state file to the new S3 remote backend?
When does Terraform create the .terraform.lock.hc1 file?
In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
Which command lets you experiment with terraform expressions?
Which task does terraform init not perform?
As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?
Which of these are features of Terraform Cloud? Choose two correct answers.
What kind of configuration block will create an infrastructure object with settings specified within the block?
A terraform apply can not _________ infrastructure.
Why would you use the -replace flag for terraform apply?
Which of the following should you put into the required_providers block?
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
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 runfirst?
Which of the following can you do with terraform plan? (Pick 2 correct responses)
What is the Terraform style convention for indenting a nesting level compared to the one above it?
Which backend does the Terraform CU use by default?
You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?
Which of the following is not a way to trigger terraform destroy?
Which command(s) adds existing resources in a public cloud into Terraform state?
Which Terraform collection type should you use to store key/value pairs?
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)
What does terraform import do?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
Which option cannot be used to keep secrets out of Terraform configuration files?
One remote backend configuration always maps to a single remote workspace.
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
Which of the following should you add in the required_providers block to define a provider version constraint?
Any user can publish modules to the public Terraform Module Registry.
terraform validate reports syntax check errors for which of the following?
You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.
Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?
What information does the public Terraform Module Registry automatically expose about published modules?
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
terraform plan updates your state file.
You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.
What is a Terraform provider not responsible for?
A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
Your root module contains a variable namednum_servers. Which is the correct way to pass its value to a child module with an input namedservers?
You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource?
Original configuration:
resource "aws_s3_bucket" "photoes" {
bucket_prefix = "images"
}
Updated configuration:
resource "aws_s3_bucket" "photos" {
bucket_prefix = "images"
}
Which of these commands makes your code more human readable?
Which of the following is not a valid Terraform variable type?
Before you can use a new backend or HCP Terraform/Terraform Cloud integration, you must first execute terraform init.
Which of these ate features of Terraform Cloud? Choose two correct answers.
You ate 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)
D)
What does state looking accomplish?
Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.
How should they ensure the code satisfies conventions?
Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example.
What does Terraform not reference when running a terraform apply -refresh-only ?
terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?
Error:
yaml
CopyEdit
Error loading state: AccessDenied: Access Denied
status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com
Which argument can you use toprevent unexpected updatesto a module's configuration when calling Terraform Registry modules?
When should you use the force-unlock command?
Which of the following statements about Terraform modules is not true?
Terraform providers are part of the Terraform core binary.
Which command doesnotcause Terraform to refresh its state?
terraform validate confirms thesyntaxof Terraform files.
When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.
Terraform configuration can only call modules from the public registry.
When should you run terraform init?
You much initialize your working directory before running terraform validate.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
How do you specify a module’s version when publishing it to the public terraform Module Registry?