ExamGecko
Home / HashiCorp / Terraform Associate 003
Ask Question

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

Question list
Search

Question 101

Report
Export
Collapse

What information does the public Terraform Module Registry automatically expose about published modules?

Required input variables
Required input variables
Optional inputs variables and default values
Optional inputs variables and default values
Outputs
Outputs
All of the above
All of the above
None of the above
None of the above
Suggested answer: D

Explanation:

The public Terraform Module Registry automatically exposes all the information about published modules, including required input variables, optional input variables and default values, and outputs. This helps users to understand how to use and configure the modules.

asked 18/09/2024
Wasawatt Ch
39 questions

Question 102

Report
Export
Collapse

You must use different Terraform commands depending on the cloud provider you use.

True
True
False
False
Suggested answer: B

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.

asked 18/09/2024
Arnab Gupta
39 questions

Question 103

Report
Export
Collapse

As a member of an operations team that uses infrastructure as code (lac) practices, you are tasked with making a change to an infrastructure stack running in a public cloud. Which pattern would follow laC best practices for making a change?

Make the change via the public cloud API endpoint
Make the change via the public cloud API endpoint
Clone the repository containing your infrastructure code and then run the code
Clone the repository containing your infrastructure code and then run the code
Use the public cloud console to make the change after a database record has been approved
Use the public cloud console to make the change after a database record has been approved
Make the change programmatically via the public cloud CLI
Make the change programmatically via the public cloud CLI
Submit a pull request and wait for an approved merge of the proposed changes
Submit a pull request and wait for an approved merge of the proposed changes
Suggested answer: E

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.

asked 18/09/2024
aakriti grover
51 questions

Question 104

Report
Export
Collapse

You ate making changes to existing Terraform code to add some new infrastructure. When is the best time to run terraform validate?

After you run terraform apply so you can validate your infrastructure
After you run terraform apply so you can validate your infrastructure
Before you run terraform apply so you can validate your provider credentials
Before you run terraform apply so you can validate your provider credentials
Before you run terraform plan so you can validate your code syntax
Before you run terraform plan so you can validate your code syntax
After you run terraform plan so you can validate that your state file is consistent with your infrastructure
After you run terraform plan so you can validate that your state file is consistent with your infrastructure
Suggested answer: C

Explanation:

This is the best time to runterraform validate, as it will check your code for syntax errors, typos, and missing arguments before you attempt to create a plan. The other options are either incorrect or unnecessary.

asked 18/09/2024
Maksim Alpatov
43 questions

Question 105

Report
Export
Collapse

How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?

HashiCorp Terraform Associate 003 image Question 105 30543 09182024192049000000

aws_instance.example.ebs_block_device[sda2,sda3).volume_id
aws_instance.example.ebs_block_device[sda2,sda3).volume_id
aws_lnstance.example.ebs_block_device.[*].volume_id
aws_lnstance.example.ebs_block_device.[*].volume_id
aws_lnstance.example.ebs_block_device.volume_ids
aws_lnstance.example.ebs_block_device.volume_ids
aws_instance.example-ebs_block_device.*.volume_id
aws_instance.example-ebs_block_device.*.volume_id
Suggested answer: D

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.

asked 18/09/2024
Renata Maria DA SILVA
46 questions

Question 106

Report
Export
Collapse

Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?

terraform fmt -write-false
terraform fmt -write-false
terraform fmt -list -recursive
terraform fmt -list -recursive
terraform fmt -check -recursive
terraform fmt -check -recursive
terraform fmt -check
terraform fmt -check
Suggested answer: C

Explanation:

This command will check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes, and will return a non-zero exit code if any files need formatting. The other commands will either make changes, list the files that need formatting, or not check the modules.

asked 18/09/2024
Diego Beltran
53 questions

Question 107

Report
Export
Collapse

What kind of configuration block will create an infrastructure object with settings specified within the block?

provider
provider
state
state
data
data
resource
resource
Suggested answer: D

Explanation:

This is the kind of configuration block that will create an infrastructure object with settings specified within the block. The other options are not used for creating infrastructure objects, but for configuring providers, accessing state data, or querying data sources.

asked 18/09/2024
Subha Mishra
39 questions

Question 108

Report
Export
Collapse

What is the Terraform style convention for indenting a nesting level compared to the one above it?

With a tab
With a tab
With two spaces
With two spaces
With four spaces
With four spaces
With three spaces
With three spaces
Suggested answer: B

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.

asked 18/09/2024
Anu V
34 questions

Question 109

Report
Export
Collapse

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?

The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
Delete the Terraform state file and execute terraform apply.
Delete the Terraform state file and execute terraform apply.
The Terraform state file only contains the one new VM. Execute terraform destroy.
The Terraform state file only contains the one new VM. Execute terraform destroy.
Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.
Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.
Suggested answer: C

Explanation:

This is the best way to delete the newly-created VM with Terraform, as it will only affect the resource that was created by your configuration and state file. The other options are either incorrect or inefficient.

asked 18/09/2024
Manoj A Rajan
40 questions

Question 110

Report
Export
Collapse

When do changes invoked by terraform apply take effect?

After Terraform has updated the state file
After Terraform has updated the state file
Once the resource provider has fulfilled the request
Once the resource provider has fulfilled the request
Immediately
Immediately
None of the above are correct
None of the above are correct
Suggested answer: B

Explanation:

Changes invoked byterraform applytake effect once the resource provider has fulfilled the request, not after Terraform has updated the state file or immediately. The state file is only a reflection of the real resources, not a source of truth.

asked 18/09/2024
Thembinkosi Sibiya
34 questions
Total 195 questions
Go to page: of 20