2024 Updated Verified Terraform-Associate-003 Q&As - Pass Guarantee or Full Refund
[Apr-2024] Terraform-Associate-003 Certification with Actual Questions from Prep4away
HashiCorp Terraform-Associate-003 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
| Topic 5 |
|
NEW QUESTION # 52
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
- A. curl commands manually run from a terminal
- B. A series of commands you enter into a public cloud console
- C. A script that contains a series of public cloud CLI commands
- D. A sequence of REST requests you pass to a public cloud API endpoint Most Voted
Answer: C
Explanation:
The concept of infrastructure as code (IaC) is to define and manage infrastructure using code, rather than manual processes or GUI tools. A script that contains a series of public cloud CLI commands is an example of IaC, because it uses code to provision resources into a public cloud. The other options are not examples of IaC, because they involve manual or interactive actions, such as running curl commands, sending REST requests, or entering commands into a console. Reference = [Introduction to Infrastructure as Code with Terraform] and [Infrastructure as Code]
NEW QUESTION # 53
The_________determines how Terraform creates, updates, or delete resources.
- A. Terraform provider
- B. Terraform provisioner
- C. Terraform core
- D. Terraform configuration
Answer: A
Explanation:
Explanation
This is what determines how Terraform creates, updates, or deletes resources, as it is responsible for understanding API interactions with some service and exposing resources and data sources based on that API.
NEW QUESTION # 54
How does Terraform determine dependencies between resources?
- A. Terraform requires resources in a configuration to be listed m the order they will be created to determine dependencies
- B. Terraform requires all dependencies between resources to be specified using the depends_on parameter
- C. Terraform requires resource dependencies to be defined as modules and sourced in order
- D. Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
Answer: D
Explanation:
Explanation
This is how Terraform determines dependencies between resources, by using the references between them in the configuration files and other factors that affect the order of operations.
NEW QUESTION # 55
When should you use the force-unlock command?
- A. Automatic unlocking failed
- B. You have a high priority change
- C. You see a status message that you cannot acquire the lock
- D. apply failed due to a state lock
Answer: A
Explanation:
You should use the force-unlock command when automatic unlocking failed. Terraform will lock your state for all operations that could write state, such as plan, apply, or destroy. This prevents others from acquiring the lock and potentially corrupting your state. State locking happens automatically on all operations that could write state and you won't see any message that it is happening. If state locking fails, Terraform will not continue. You can disable state locking for most commands with the -lock flag but it is not recommended. If acquiring the lock is taking longer than expected, Terraform will output a status message. If Terraform doesn't output a message, state locking is still occurring if your backend supports it. Terraform has a force-unlock command to manually unlock the state if unlocking failed. Be very careful with this command. If you unlock the state when someone else is holding the lock it could cause multiple writers. Force unlock should only be used to unlock your own lock in the situation where automatic unlocking failed. To protect you, the force-unlock command requires a unique lock ID. Terraform will output this lock ID if unlocking fails. This lock ID acts as a nonce, ensuring that locks and unlocks target the correct lock. The other situations are not valid reasons to use the force-unlock command. You should not use the force-unlock command if you have a high priority change, if apply failed due to a state lock, or if you see a status message that you cannot acquire the lock. These situations indicate that someone else is holding the lock and you should wait for them to finish their operation or contact them to resolve the issue. Using the force-unlock command in these cases could result in data loss or inconsistency. Reference = [State Locking], [Command: force-unlock]
NEW QUESTION # 56
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. Manually apply two spaces indentation and align equal sign "=" characters in every Terraform file (*.tf)
- B. Run the terraform fmt command during the code linting phase of your CI/CD process Most Voted
- C. Write a shell script to transform Terraform files using tools such as AWK, Python, and sed
- D. Designate one person in each team to review and format everyone's code
Answer: B
Explanation:
Explanation
The terraform fmt command is used to rewrite Terraform configuration files to a canonical format and style.
This command applies a subset of the Terraform language style conventions, along with other minor adjustments for readability. Running this command on your configuration files before committing them to source control can help ensure consistency of style between different Terraform codebases, and can also make diffs easier to read. You can also use the -check and -diff options to check if the files are formatted and display the formatting changes respectively2. Running the terraform fmt command during the code linting phase of your CI/CD process can help automate this process and enforce the formatting standards for your team. References = [Command: fmt]2
NEW QUESTION # 57
Which are examples of infrastructure as code? Choose two correct answers.
- A. Cloned virtual machine images
- B. Versioned configuration files
- C. Doctor files
- D. Change management database records
Answer: B
Explanation:
Explanation
These are examples of infrastructure as code (IaC), which is a practice of managing and provisioning infrastructure through machine-readable definition files, rather than physical hardware configuration or interactive configuration tools.
NEW QUESTION # 58
Select the command that doesn't cause Terraform to refresh its state.
- A. Terraform apply
- B. Terraform state list
- C. Terraform destroy
- D. Terraform plan
Answer: B
Explanation:
Explanation
This is the command that does not cause Terraform to refresh its state, as it only lists the resources that are currently managed by Terraform in the state file. The other commands will refresh the state file before performing their operations, unless you use the -refresh=false flag.
NEW QUESTION # 59
A provider configuration block is required in every Terraform configuration.
Example:
- A. True
- B. False
Answer: B
Explanation:
Explanation
A provider configuration block is not required in every Terraform configuration. A provider configuration block can be omitted if its contents would otherwise be empty. Terraform assumes an empty default configuration for any provider that is not explicitly configured. However, some providers may require some configuration arguments (such as endpoint URLs or cloud regions) before they can be used. A provider's documentation should list which configuration arguments it expects. For providers distributed on the Terraform Registry, versioned documentation is available on each provider's page, via the "Documentation" link in the provider's header1. References = [Provider Configuration]1
NEW QUESTION # 60
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.
- A. True
- B. False
Answer: B
Explanation:
Explanation
The execution plan for terraform apply will not be the same as the one you ran locally with terraform plan, if your teammate manually modified the infrastructure component you are working on. This is because Terraform will refresh the state file before applying any changes, and will detect any differences between the state and the real resources.
NEW QUESTION # 61
What is the Terraform style convention for indenting a nesting level compared to the one above it?
- A. With three spaces
- B. With two spaces
- C. With a tab
- D. With four spaces
Answer: B
Explanation:
Explanation
This is the Terraform style convention for indenting a nesting level compared to the one above it. The other options are not consistent with the Terraform style guide.
NEW QUESTION # 62
When should you run terraform init?
- A. Before you start coding a new Terraform project
- B. After you run terraform plan for the time in a new terraform project and before you run terraform apply
- C. After you start coding a new terraform project and before you run terraform plan for the first time.
- D. Every time you run terraform apply
Answer: C
Explanation:
You should run terraform init after you start coding a new Terraform project and before you run terraform plan for the first time. This command will initialize the working directory by downloading the required providers and modules, creating the initial state file, and performing other necessary tasks. Reference = : Initialize a Terraform Project
NEW QUESTION # 63
Which of the following is not a valid siring function in Terraform?
- A. Split
- B. choaf
- C. slice
- D. join
Answer: B
Explanation:
This is not a valid string function in Terraform. The other options are valid string functions that can manipulate strings in various ways2.
NEW QUESTION # 64
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.
- A. True
- B. False
Answer: B
Explanation:
The execution plan for terraform apply will not be the same as the one you ran locally with terraform plan, if your teammate manually modified the infrastructure component you are working on. This is because Terraform will refresh the state file before applying any changes, and will detect any differences between the state and the real resources.
NEW QUESTION # 65
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?
- A. Map
- B. Object
- C. List
- D. Terraform does not support complex input variables of different types
Answer: B
Explanation:
Explanation
This is the variable type that you could use for this input, as it can store multiple attributes of different types within a single value. The other options are either invalid or incorrect for this use case.
NEW QUESTION # 66
Which of the following is not a valid Terraform variable type?
- A. string
- B. array
- C. nap
- D. list
Answer: B
Explanation:
This is not a valid Terraform variable type. The other options are valid variable types that can store different kinds of values2.
NEW QUESTION # 67
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. Terraform plan rm:aws_instance.ubuntu[1]
- B. Terraform state rm:aws_instance.ubuntu[1]
- C. Terraform apply rm:aws_instance.ubuntu[1]
- D. Terraform destory rm:aws_instance.ubuntu[1]
Answer: B
Explanation:
Explanation
To tell Terraform to stop managing a specific resource without destroying it, you can use the terraform state rm command. This command will remove the resource from the Terraform state, which means that Terraform will no longer track or update the corresponding remote object. However, the object will still exist in the remote system and you can later use terraform import to start managing it again in a different configuration or workspace. The syntax for this command is terraform state rm <address>, where <address> is the resource address that identifies the resource instance to remove. For example, terraform state rm aws_instance.ubuntu[1] will remove the second instance of the aws_instance resource named ubuntu from the state. References = : Command: state rm : Moving Resources
NEW QUESTION # 68
How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
- A. Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
- B. Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
- C. Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
- D. Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
Answer: A
Explanation:
This will trigger a run in the Terraform Cloud workspace, which will perform a plan and apply operation on the infrastructure defined by the Terraform configuration files in the VCS repository.
NEW QUESTION # 69
_______backends support state locking.
- A. No
- B. Only local
- C. Some
- D. All
Answer: C
Explanation:
Some backends support state locking, which prevents other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss. Not all backends support this feature, and you can check the documentation for each backend type to see if it does.
NEW QUESTION # 70
What does state looking accomplish?
- A. Encrypts any credentials stored within the state file
- B. Prevent accidental Prevent accident deletion of the state file
- C. Copies the state file from memory to disk
- D. Blocks Terraform commands from modifying, the state file
Answer: D
Explanation:
This is what state locking accomplishes, by preventing other users from modifying the state file while a Terraform operation is in progress. This prevents conflicts and data loss.
NEW QUESTION # 71
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?
- A. Set the environment variable TF_LOG_PATH
- B. Set the environment variable TF_LOG_TRACE
- C. Set the environment variable TF_log_TRACE
- D. Set verbose for each provider in your Terraform configuration
Answer: B
Explanation:
Explanation
This will enable additional logging messages to find out from which paths Terraform is loading providers referenced in your Terraform configuration files, as it will set the log level to TRACE, which is the most verbose and detailed level.
NEW QUESTION # 72
What is one disadvantage of using dynamic blocks in Terraform?
- A. Dynamic blocks can construct repeatable nested blocks
- B. They make configuration harder to read and understand
- C. Terraform will run more slowly
- D. They cannot be used to loop through a list of values
Answer: B
Explanation:
Explanation
This is one disadvantage of using dynamic blocks in Terraform, as they can introduce complexity and reduce readability of the configuration. The other options are either advantages or incorrect statements.
NEW QUESTION # 73
......
Terraform-Associate-003 Real Valid Brain Dumps With 145 Questions: https://www.prep4away.com/HashiCorp-certification/braindumps.Terraform-Associate-003.ete.file.html
Updated Terraform-Associate-003 Dumps PDF: https://drive.google.com/open?id=1FSq2rQzymEp9ezOOt8mSnoruSHbnldLK