ExamGecko
Home / HashiCorp / Terraform Associate 003
Ask Question

HashiCorp Terraform Associate 003 Practice Test - Questions Answers, Page 3

Question list
Search

Question 21

Report
Export
Collapse

Which task does terraform init not perform?

Validates all required variables are present
Validates all required variables are present
Sources any modules and copies the configuration locally
Sources any modules and copies the configuration locally
Connects to the backend
Connects to the backend
Sources all providers used in the configuration and downloads them
Sources all providers used in the configuration and downloads them
Suggested answer: A

Explanation:

The terraform init command is used to initialize a working directory containing Terraform configuration files. This command performs several different initialization steps to prepare the current working directory for use with Terraform, which includes initializing the backend, installing provider plugins, and copying any modules referenced in the configuration. However, it does not validate whether all required variables are present; that is a task performed by terraform plan or terraform apply1.

Reference = This information can be verified from the official Terraform documentation on the terraform init command provided by HashiCorp Developer1.

asked 18/09/2024
Aubrey Oliver Jr
34 questions

Question 22

Report
Export
Collapse

Which of the following is not a benefit of adopting infrastructure as code?

Versioning
Versioning
A Graphical User Interface
A Graphical User Interface
Reusability of code
Reusability of code
Automation
Automation
Suggested answer: B

Explanation:

Infrastructure as Code (IaC) provides several benefits, including the ability to version control infrastructure, reuse code, and automate infrastructure management. However, IaC is typically associated with declarative configuration files and does not inherently provide a graphical user interface (GUI). A GUI is a feature that may be provided by specific tools or platforms built on top of IaC principles but is not a direct benefit of IaC itself1.

Reference = The benefits of IaC can be verified from the official HashiCorp documentation on ''What is Infrastructure as Code with Terraform?'' provided by HashiCorp Developer1.

asked 18/09/2024
brandon landaal
40 questions

Question 23

Report
Export
Collapse

Which of these is true about Terraform's plugin-based architecture?

Terraform can only source providers from the internet
Terraform can only source providers from the internet
Every provider in a configuration has its own state file for its resources
Every provider in a configuration has its own state file for its resources
You can create a provider for your API if none exists
You can create a provider for your API if none exists
All providers are part of the Terraform core binary
All providers are part of the Terraform core binary
Suggested answer: C

Explanation:

Terraform is built on a plugin-based architecture, enabling developers to extend Terraform by writing new plugins or compiling modified versions of existing plugins1. Terraform plugins are executable binaries written in Go that expose an implementation for a specific service, such as a cloud resource, SaaS platform, or API2. If there is no existing provider for your API, you can create one using the Terraform Plugin SDK3 or the Terraform Plugin Framework4. Reference =

* 1: Plugin Development - How Terraform Works With Plugins | Terraform | HashiCorp Developer

* 2: Lab: Terraform Plug-in Based Architecture - GitHub

* 3: Terraform Plugin SDK - Terraform by HashiCorp

* 4: HashiCorp Terraform Plugin Framework Now Generally Available

asked 18/09/2024
Arturs Grigorjevs
42 questions

Question 24

Report
Export
Collapse

The Terraform binary version and provider versions must match each other in a single configuration.

True
True
False
False
Suggested answer: B

Explanation:

The Terraform binary version and provider versions do not have to match each other in a single configuration. Terraform allows you to specify provider version constraints in the configuration's terraform block, which can be different from the Terraform binary version1. Terraform will use the newest version of the provider that meets the configuration's version constraints2. You can also use the dependency lock file to ensure Terraform is using the correct provider version3. Reference =

* 1: Providers - Configuration Language | Terraform | HashiCorp Developer

* 2: Multiple provider versions with Terraform - Stack Overflow

* 3: Lock and upgrade provider versions | Terraform - HashiCorp Developer

asked 18/09/2024
Yesaldine Salazar
42 questions

Question 25

Report
Export
Collapse

Which of the following is not true of Terraform providers?

An individual person can write a Terraform Provider
An individual person can write a Terraform Provider
A community of users can maintain a provider
A community of users can maintain a provider
HashiCorp maintains some providers
HashiCorp maintains some providers
Cloud providers and infrastructure vendors can write, maintain, or collaborate on Terraform
Cloud providers and infrastructure vendors can write, maintain, or collaborate on Terraform
providers
providers
None of the above
None of the above
Suggested answer: F

Explanation:

All of the statements are true of Terraform providers. Terraform providers are plugins that enable Terraform to interact with various APIs and services1. Anyone can write a Terraform provider, either as an individual or as part of a community2. HashiCorp maintains some providers, such as the AWS, Azure, and Google Cloud providers3. Cloud providers and infrastructure vendors can also write, maintain, or collaborate on Terraform providers, such as the VMware, Oracle, and Alibaba Cloud providers. Reference =

* 1: Providers - Configuration Language | Terraform | HashiCorp Developer

* 2: Plugin Development - How Terraform Works With Plugins | Terraform | HashiCorp Developer

* 3: Terraform Registry

* : Terraform Registry

asked 18/09/2024
J.L.M. van Loo
48 questions

Question 26

Report
Export
Collapse

How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?

Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
Only Terraform Cloud organization owners can set workspace variables on VCS connected workspaces
Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
Commit a change to the VCS working directory and branch that the Terraform Cloud workspace is connected to
Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
Only Terraform Cloud organization owners can approve plans in VCS connected workspaces
Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
Only members of a VCS organization can open a pull request against repositories that are connected to Terraform Cloud workspaces
Suggested answer: B

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.

asked 18/09/2024
Roger Warner
33 questions

Question 27

Report
Export
Collapse

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?

Copy the sensitive variables into your Terraform code
Copy the sensitive variables into your Terraform code
Store the sensitive variables in a secure_varS.tf file
Store the sensitive variables in a secure_varS.tf file
Store the sensitive variables as plain text in a source code repository
Store the sensitive variables as plain text in a source code repository
Pass variables to Terraform with a -var flag
Pass variables to Terraform with a -var flag
Suggested answer: D

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.

asked 18/09/2024
Morris Djavaheri
29 questions

Question 28

Report
Export
Collapse

When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?

You can import infrastructure without corresponding Terraform code
You can import infrastructure without corresponding Terraform code
Terraform will generate the corresponding configuration files for you
Terraform will generate the corresponding configuration files for you
Before you run terraform Import
Before you run terraform Import
After you run terraform import
After you run terraform import
Suggested answer: C

Explanation:

You need to write Terraform configuration files for the existing infrastructure that you want to import into Terraform, otherwise Terraform will not know how to manage it. The configuration files should match the type and name of the resources that you want to import.

asked 18/09/2024
Angelica Caldeo
41 questions

Question 29

Report
Export
Collapse

Variables declared within a module are accessible outside of the module.

True
True
False
False
Suggested answer: B

Explanation:

Variables declared within a module are only accessible within that module, unless they are explicitly exposed as output values1.

asked 18/09/2024
Vipul Mehra
34 questions

Question 30

Report
Export
Collapse

Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?

Edit your state file to scrub out the sensitive data
Edit your state file to scrub out the sensitive data
Always store your secrets in a secrets.tfvars file
Always store your secrets in a secrets.tfvars file
Delete the state file every time you run Terraform
Delete the state file every time you run Terraform
Store the state in an encrypted backend
Store the state in an encrypted backend
Suggested answer: D

Explanation:

This is a secure way to protect sensitive data in the state file, as it will be encrypted at rest and in transit2. The other options are not recommended, as they could lead to data loss, errors, or security breaches.

asked 18/09/2024
Md. Soyaeb Hossain
33 questions
Total 195 questions
Go to page: of 20