HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and Answers
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
Which of the following is not a way to trigger terraform destroy?
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?
You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?
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?
How would you output returned values from a child module in the Terraform CLI output?
What is the provider for the resource shown in the Exhibit?
resource "aws_vpc" "main" {
name = "test"
}
The_________determines how Terraform creates, updates, or delete resources.
Where can Terraform not load a provider from?
Terraform installs its providers during which phase?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.
A child module can always access variables declared in its parent 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?
Which of the following is not a valid Terraform collection type?
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
terraform apply will fail if you have not run terraform plan first to update the plan output.
Which of these statements about Terraform Cloud workspaces is false?
Which Terraform command checks that your configuration syntax is correct?
While attempting to deploy resources into your cloud provider using Terraform, you begin to see some odd behavior and experience slow responses. In order to troubleshoot you decide to turn on Terraform debugging. Which environment variables must be configured to make Terraform's logging more verbose?
What Terraform command always causes a state file to be updated with changes that might have been made outside of Terraform?
What functionality do providers offer in Terraform?(Pick 3 correct responses)
What does terraform import do?
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.
You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?
Which of the following is not a benefit of adopting infrastructure as code?
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
Which of the following is not a valid source path for specifying a module?
You 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 Terraform will delete.
Which command should you use to show all the resources that will be deleted? (Pick the 2 correct responses)
What is one disadvantage of using dynamic blocks in Terraform?
Which of the following is not true of Terraform providers?
You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?
When you include a module block in your configuration that references a module from the Terraform Registry, the "version" attribute is required.
What does Terraform not reference when running a terraform apply -refresh-only ?
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
You can develop a custom provider to manage its resources using Terraform.
terraform plan updates your state file.
Which of the following can you do with terraform plan? (Pick 2 correct responses)
Where does the Terraform local backend store its state?
Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.
Which of the following commands would you use to access all of the attributes and details of a resource managed by Terraform?
Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)
Terraform configuration (including any module references) can contain only one Terraform provider type.
When you initialize Terraform, where does it cache modules from the public Terraform Registry?
A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?
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?
Which of these actions will prevent two Terraform runs from changing the same state file at the same time?
Which of these is true about Terraform's plugin-based architecture?
Which of these commands makes your code more human readable?
How does Terraform determine dependencies between resources?
Which of the following is not a key principle of infrastructure as code?
When using Terraform to deploy resources into Azure, which scenarios are true regarding state files? (Choose two.)
When do changes invoked by terraform apply take effect?
You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?
Which are examples of infrastructure as code? Choose two correct answers.
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
Once you configure a new Terraform backend with a terraform code block, which command(s) should you use to migrate the state file?
What is the workflow for deploying new infrastructure with Terraform?
What is a Terraform provider not responsible for?
You have a list of numbers that represents the number of free CPU cores on each virtual cluster:
numcpus = [ 18, 3, 7, 11, 2 ]
What Terraform function could you use to select the largest number from the list?
Terraform configuration can only import modules from the public registry.
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.
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?
All standard backend types support state locking, and remote operations like plan, apply, and destroy.
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?
What does the default "local" Terraform backend store?
What does state looking accomplish?
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?
Which backend does the Terraform CU use by default?
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
When does Sentinel enforce policy logic during a Terraform Cloud run?
Which of the following should you put into the required_providers block?
You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.
If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?
You have to initialize a Terraform backend before it can be configured.
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
What does this code do?
terraform { required_providers { aws = ">= 3.0" }}
Which of the following is availableonlyinHCP Terraform workspacesandnot in Terraform CLI?
Which of the following is not a way to trigger terraform destroy?
What does the default "local" Terraform backend store?
What does terraform import do?
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location. Which of the following backends would not work?
Which of the following is not a benefit of adopting infrastructure as code?
If a module declares a variable with a default, that variable must also be defined within the module.
When using a remote backend or terraform Cloud integration, where does Terraform save resource sate?
If a module declares a variable without a default value, you must pass the value of the variable within the module block when you call the module in your configuration.
A module can always refer to all variables declared in its parent module.
Before you can use a remote backend, you must first execute terra-form init.
When you use a backend that requires authentication, it is best practice to:
Which are examples of infrastructure as code? Choose two correct answers.
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?
Terraform configuration can only call modules from the public registry.
In a Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
terraform validate confirms that your infrastructure matches the Terraform state file.
How can terraform plan aid in the development process?
The public Terraform Module Registry is free to use.
Which of the following is not a valid Terraform variable type?
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?
What is the provider for this resource?
Where in your Terraform configuration do you specify a state backend?
Using the terraform state rm command against a resource will destroy it.
terraform destroy is the only way to remove infrastructure.
terraform validate reports syntax check errors for which of the following?
Which of these are features of HCP Terraform/Terraform Cloud? Pick the 2 correct responses below.
By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?
You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?
Variables declared within a module are accessible outside of the module.
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?
What functionality do providers offer in Terraform?(Pick 3 correct responses)
Module version is required to reference a module on the Terraform Module Registry.
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
Terraform configuration can only import modules from the public registry.
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?
What are some benefits of using Sentinel with Terraform Cloud/Terraform Cloud? Choose three correct answers.
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
The Terraform binary version and provider versions must match each other in a single configuration.
Which configuration consistency errors does terraform validate report?
Which statement describes a goal of Infrastructure as Code (IaC)?
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
You can configure Terraform to log to a file using the TF_LOG environment variable.
Which backend does the Terraform CU use by default?
terraform plan updates your state file.
How do you specify a module’s version when publishing it to the public terraform Module Registry?
What is the workflow for deploying new infrastructure with Terraform?
You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead. What are the two things you must do to achieve this? Choose two correct answers.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
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?
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.
How is terraform import run?
When do changes invoked by terraform apply take effect?
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
Which command lets you experiment with terraform expressions?
Which of the following can you do with terraform plan? (Pick 2 correct responses)