HashiCorp Certified: Terraform Associate (003) (HCTA0-003) Questions and 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?
Where in your Terraform configuration do you specify a state backend?
You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
How would you output returned values from a child module in the Terraform CLI output?
Terraform providers are always installed from the Internet.
Which of the following is not a valid Terraform collection type?
Select the command that doesn’t cause Terraform to refresh its state.
How does Terraform determine dependencies between resources?
You should run terraform fnt to rewrite all Terraform configurations within the current working directory to conform to Terraform-style conventions.
When do changes invoked by terraform apply take effect?
Which Terraform command checks that your configuration syntax is correct?
You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.
Which variable type could you use for this input?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
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?
A developer accidentally launched a VM (virtual machine) outside of the Terraform workflow and ended up with two servers with the same name. They don't know which VM Terraform manages but do have a list of all active VM IDs.
Which of the following methods could you use to discover which instance Terraform manages?
Variables declared within a module are accessible outside of the module.
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?
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.
Which of these ate features of Terraform Cloud? Choose two correct answers.
Your risk management organization requires that new AWS S3 buckets must be private and encrypted at rest. How can Terraform Cloud automatically and proactively enforce this security control?
You must use different Terraform commands depending on the cloud provider you use.
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
Which of the following is not true of Terraform providers?
How can terraform plan aid in the development process?
What is the provider for this resource?
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
Only the user that generated a plan may apply it.
Terraform configuration can only import modules from the public registry.
When should you run terraform init?
A terraform apply can not _________ infrastructure.
What value does the Terraform Cloud private registry provide over the public Terraform Module Registry?
You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick the 3 correct responses)
When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
Which of these statements about HCP Terraform/Terraform Cloud workspaces is false?
As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform command should you use?
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
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?
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.
Why would you use the -replace flag for terraform apply?
Module variable assignments are inherited from the parent module and you do not need to explicitly set them.
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?
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?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
Which command must you first run before performing further Terraform operations in a working directory?
A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
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?
Which of the following is not a benefit of adopting infrastructure as code?
Changing the Terraform backend from the default "local" backend to a different one after performing your first terrafom apply is:
What does the default "local" Terraform backend store?
What is the name of the default file where Terraform stores the state?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
What is one disadvantage of using dynamic blocks in Terraform?
You can configure Terraform to log to a file using the TF_LOG environment variable.
You have a list of numbers that represents the number of free CPU cores on each virtual cluster:
What Terraform function could you use to select the largest number from the list?
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?
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.
A)
B)
C)
D)
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.
What does Terraform not reference when running a terraform apply -refresh-only ?