Terraform-Associate-003 Study Guide: Latest [May 02, 2024] Realistic Verified Terraform-Associate-003 Dumps
Terraform-Associate-003 Questions & Practice Test are Available On-Demand
HashiCorp Terraform-Associate-003 Exam Syllabus Topics:
| Topic | Details |
|---|---|
| Topic 1 |
|
| Topic 2 |
|
| Topic 3 |
|
| Topic 4 |
|
NEW QUESTION # 62
Which of the following is not a valid siring function in Terraform?
- A. join
- B. slice
- C. choaf
- D. Split
Answer: C
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 # 63
How does Terraform determine dependencies between resources?
- A. Terraform automatically builds a resource graph based on resources provisioners, special meta-parameters, and the stale file (if present}
- 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 requires resources in a configuration to be listed m the order they will be created to determine dependencies
Answer: A
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 # 64
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
- A. Terraform state list
- B. Terraform get provider_type_name
- C. Terraform state show ' provider_type_name
- D. Terraform state list provider_type_name
Answer: C
Explanation:
Explanation
This is the command that you would use to access all of the attributes and details of a resource managed by Terraform, by providing the resource address as an argument. For example, terraform state show
'aws_instance.example' will show you all the information about the AWS instance named example.
NEW QUESTION # 65
Which are examples of infrastructure as code? Choose two correct answers.
- A. Change management database records
- B. Cloned virtual machine images
- C. Versioned configuration files
- D. Doctor files
Answer: C
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 # 66
Select the command that doesn't cause Terraform to refresh its state.
- A. Terraform plan
- B. Terraform state list
- C. Terraform destroy
- D. Terraform apply
Answer: B
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 # 67
You must use different Terraform commands depending on the cloud provider you use.
- A. False
- B. True
Answer: A
Explanation:
You do not need to use different Terraform commands depending on the cloud provider you use. Terraform commands are consistent across different providers, as they operate on the Terraform configuration files and state files, not on the provider APIs directly.
NEW QUESTION # 68
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
- A. True
- B. False
Answer: A
Explanation:
Explanation
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform init3. This will ensure that you use the same provider versions across different machines and runs.
NEW QUESTION # 69
If a module declares a variable with a default, that variable must also be defined within the module.
- A. False
- B. True
Answer: A
Explanation:
A module can declare a variable with a default value without requiring the caller to define it. This allows the module to provide a sensible default behavior that can be customized by the caller if needed. Reference = [Module Variables]
NEW QUESTION # 70
_______backends support state locking.
- A. Only local
- B. All
- C. No
- D. Some
Answer: D
Explanation:
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 # 71
Terraform configuration (including any module references) can contain only one Terraform provider type.
- A. False
- B. True
Answer: A
Explanation:
Explanation
Terraform configuration (including any module references) can contain more than one Terraform provider type. Terraform providers are plugins that Terraform uses to interact with various cloud services and other APIs. A Terraform configuration can use multiple providers to manage resources across different platforms and services. For example, a configuration can use the AWS provider to create a virtual machine, the Cloudflare provider to manage DNS records, and the GitHub provider to create a repository. Terraform supports hundreds of providers for different use cases and scenarios. References = [Providers], [Provider Requirements], [Provider Configuration]
NEW QUESTION # 72
Terraform providers are part of the Terraform core binary.
- A. False
- B. True
Answer: A
Explanation:
Terraform providers are not part of the Terraform core binary. Providers are distributed separately from Terraform itself and have their own release cadence and version numbers. Providers are plugins that Terraform uses to interact with various APIs, such as cloud providers, SaaS providers, and other services. You can find and install providers from the Terraform Registry, which hosts providers for most major infrastructure platforms. You can also load providers from a local mirror or cache, or develop your own custom providers. To use a provider in your Terraform configuration, you need to declare it in the provider requirements block and optionally configure its settings in the provider block. Reference = : Providers - Configuration Language | Terraform : Terraform Registry - Providers Overview | Terraform
NEW QUESTION # 73
What does this code do?
- A. Requires any version of the AWS provider > 3.0
- B. Requires any version of the AWS provider >= 3.0
- C. Requires any version of the AWS provider > = 3.0 and <4.0
- D. Requires any version of the AWS provider > = 3.0 major release. like 4.1
Answer: C
Explanation:
This is what this code does, by using the pessimistic constraint operator (~>), which specifies an acceptable range of versions for a provider or module.
NEW QUESTION # 74
A terraform apply can not _________ infrastructure.
- A. change
- B. import
- C. provision
- D. destroy
Answer: B
Explanation:
Explanation
The terraform import command is used to import existing infrastructure into Terraform's state. This allows Terraform to manage and destroy the imported infrastructure as part of the configuration. The terraform import command does not modify the configuration, so the imported resources must be manually added to the configuration after the import. References = [Importing Infrastructure]
NEW QUESTION # 75
You have a Terraform configuration that defines a single virtual machine with no references to it, You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.
What will happen you run terraform apply in the working directory again?
- A. Nothing
- B. Terraform will remove the virtual machine from the state file, but the resource will still exist
- C. Terraform will error
- D. Terraform will destroy the virtual machine
Answer: D
Explanation:
Explanation
This is what will happen if you run terraform apply in the working directory again, after removing the resource definition from your Terraform configuration file. Terraform will detect that there is a resource in the state file that is not present in the configuration file, and will assume that you want to delete it.
NEW QUESTION # 76
Which option cannot be used to keep secrets out of Terraform configuration files?
- A. secure string
- B. Environment variables
- C. A Terraform provider
- D. A -var flag
Answer: A
Explanation:
A secure string is not a valid option to keep secrets out of Terraform configuration files. A secure string is a feature of AWS Systems Manager Parameter Store that allows you to store sensitive data encrypted with a KMS key. However, Terraform does not support secure strings natively and requires a custom data source to retrieve them. The other options are valid ways to keep secrets out of Terraform configuration files. A Terraform provider can expose secrets as data sources that can be referenced in the configuration. Environment variables can be used to set values for input variables that contain secrets. A -var flag can be used to pass values for input variables that contain secrets from the command line or a file. Reference = [AWS Systems Manager Parameter Store], [Terraform AWS Provider Issue #55], [Terraform Providers], [Terraform Input Variables]
NEW QUESTION # 77
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 # 78
Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?
- A. A sequence of REST requests you pass to a public cloud API endpoint Most Voted
- B. curl commands manually run from a terminal
- C. A series of commands you enter into a public cloud console
- D. A script that contains a series of public cloud CLI commands
Answer: D
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 # 79
How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?
- A. aws_instance.example-ebs_block_device.*.volume_id
- B. aws_lnstance.example.ebs_block_device.[*].volume_id
- C. aws_instance.example.ebs_block_device[sda2,sda3).volume_id
- D. aws_lnstance.example.ebs_block_device.volume_ids
Answer: A
Explanation:
This is the correct way to reference the volume IDs associated with the ebs_block_device blocks in this configuration, using the splat expression syntax. The other options are either invalid or incomplete.
NEW QUESTION # 80
You're building a CI/CD (continuous integration/continuous delivery) pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?
- A. Pass variables to Terraform with a -var flag
- B. Store the sensitive variables as plain text in a source code repository
- C. Copy the sensitive variables into your Terraform code
- D. Store the sensitive variables in a secure_varS.tf file
Answer: A
Explanation:
This is a secure way to inject sensitive variables into your Terraform run, as they will not be stored in any file or source code repository. You can also use environment variables or variable files with encryption to pass sensitive variables to Terraform.
NEW QUESTION # 81
When using multiple configuration of the same Terraform provider, what meta-argument must you include in any non-default provider configurations?
- A. Id
- B. name
- C. Alias
- D. Depends_on
Answer: C
Explanation:
This is the meta-argument that you must include in any non-default provider configurations, as it allows you to give a friendly name to the configuration and reference it in other parts of your code. The other options are either invalid or irrelevant for this purpose.
NEW QUESTION # 82
......
Valid Terraform-Associate-003 Exam Dumps Ensure you a HIGH SCORE: https://actual4test.practicetorrent.com/Terraform-Associate-003-practice-exam-torrent.html