πŸ”

TA-003 β€” questions

Page 7 of 19 Β· 368 total questions.

Topic 1 Β· Question 124

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?

  • AUse the terraform state rm command to remove the VM from state file
  • BUse the terraform taint command targeting the VMs then run terraform plan and terraform apply (correct answer)
  • CUse the terraform apply command targeting the VM resources only
  • DDelete the Terraform VM resources from your Terraform code then run terraform plan and terraform apply
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Use the terraform taint command targeting the VMs then run terraform plan and terraform apply

Explanation

terraform plan compares configuration and state with real infrastructure and previews the proposed changes without applying them. terraform apply executes the dependency-aware changes required to make infrastructure match the configuration.

Topic 1 Β· Question 125

How do you specify a module's version when publishing it to the public Terraform Module Registry?

  • AThe module's configuration page on the Terraform Module Registry
  • BTerraform Module Registry does not support versioning modules
  • CThe release tags in the associated repo (correct answer)
  • DThe module's Terraform code
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The release tags in the associated repo

Topic 1 Β· Question 126

Terraform plan updates your state file.

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 Β· Question 127

To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?

  • Aterraform fmt -check
  • Bterraform fmt -write-false
  • Cterraform fmt ""list -recursive
  • Dterraform fmt -check -recursive (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform fmt -check -recursive

Explanation

terraform fmt rewrites Terraform configuration into the canonical style and formatting.

Topic 1 Β· Question 128

As a member of the operations team, you need to run a script on a virtual machine created by Terraform. Which provision is best to use in your Terraform code?

  • Anull-ex׀¡ׁ
  • Blocal-exec
  • Cremote-exec (correct answer)
  • Dfile
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: remote-exec

Topic 1 Β· Question 129

You are using a networking module in your Terraform configuration with the name label my_network. In your main configuration you have the following code: When you run terraform validate, you get the following error: What must you do to successfully retrieve this value from your networking module?

Exhibit 1 for question 129Exhibit 2 for question 129
  • ADefine the attribute vnet_id as a variable in the networking module
  • BChange the referenced value to module.my_network.outputs.vnet_id
  • CDefine the attribute vnet_id as an output in the networking module (correct answer)
  • DChange the referenced value to my_network.outputs.vnet_id
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Define the attribute vnet_id as an output in the networking module

Explanation

A Terraform module packages related resources into a reusable configuration with defined inputs and outputs.

Topic 1 Β· Question 130

You are writing a child Terraform module which provisions an AWS instance. You want to make use of the IP address returned in the root configuration. You name the instance resource "main". Which of these is the correct way to define the output value using HCL2? A. B.

Exhibit 1 for question 130Exhibit 2 for question 130
  • A (correct answer)
  • B
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A:

Topic 1 Β· Question 131

How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? (Choose two.)

  • AA full audit trail of the request and fulfillment process is generated
  • BA request must be submitted for infrastructure changes
  • CAs additional resources are required, more tickets are submitted (correct answer)
  • DA catalog of approved resources can be accessed from drop down lists in a request form
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: As additional resources are required, more tickets are submitted This option scales automatically to match demand.

Topic 1 Β· Question 132

Which of the following statements about Terraform modules is not true?

  • AModules must be publicly accessible (correct answer)
  • BModules can be called multiple times
  • CModule is a container for one or more resources
  • DModules can call other modules
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Modules must be publicly accessible

Explanation

A Terraform module packages related resources into a reusable configuration with defined inputs and outputs.

Topic 1 Β· Question 133

Which Terraform collection type should you use to store key/value pairs?

  • Atuple
  • Bset
  • Cmaׁ€ (correct answer)
  • Dlist
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: maׁ€

Topic 1 Β· Question 134 Β· Select all that apply

You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform. Which command should you use to show all of the resources that will be deleted? (Choose two.)

  • ARun terraform plan -destroy (correct answer)
  • BRun terraform show -destroy
  • CRun terraform destroy and it will first output all the resources that will be deleted before prompting for approval (correct answer)
  • DRun terraform show -destroy
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Run terraform plan -destroy Option C: Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval

Explanation

terraform plan compares configuration and state with real infrastructure and previews the proposed changes without applying them. terraform destroy removes infrastructure managed by the current Terraform configuration and state.

Topic 1 Β· Question 135

When do you need to explicitly execute terraform refresh?

  • ABefore every terraform plan
  • BBefore every terraform apply
  • CBefore every terraform import
  • DNone of the above (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: None of the above

Topic 1 Β· Question 136

All Terraform Cloud tiers support team management and governance.

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 Β· Question 137

What advantage does an operations team that uses infrastructure as code have?

  • AThe ability to delete infrastructure
  • BThe ability to update existing infrastructure
  • CThe ability to reuse best practice configurations and settings (correct answer)
  • DThe ability to autoscale a group of servers
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The ability to reuse best practice configurations and settings

Topic 1 Β· Question 138

You have modified your Terraform configuration to fix a typo in the Terraform ID of a resource from aws_security_group.http to aws_security_group.http Which of the following commands would you run to update the ID in state without destroying the resource?

Exhibit 1 for question 138
  • Aterraform mv aws_security_group.htp aws_security_group.http (correct answer)
  • Bterraform apply
  • Cterraform refresh
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: terraform mv aws_security_group.htp aws_security_group.http This option keeps traffic private / properly secured as required.

Topic 1 Β· Question 139

You are creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this? A. B. C.

Exhibit 1 for question 139Exhibit 2 for question 139Exhibit 3 for question 139
  • A
  • B (correct answer)
  • C
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B:

Topic 1 Β· Question 140

Terraform variable names are saved in the state file.

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 Β· Question 141

Terraform Cloud is available only as a paid offering from HashiCorp.

  • ATrue
  • BFalse (correct answer)
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: False

Topic 1 Β· Question 142

Which of the following is not a way to trigger terraform destroy?

  • AUsing the destroy command with auto-approve
  • BRunning terraform destroy from the correct directory and then typing "yes" when prompted in the CLI
  • CPassing --destroy at the end of a plan request
  • DDelete the state file and run terraform apply (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Delete the state file and run terraform apply

Explanation

terraform apply executes the dependency-aware changes required to make infrastructure match the configuration. Terraform state maps resource addresses to remote objects and stores metadata needed to calculate changes efficiently.

Topic 1 Β· Question 143

Which of the following is not an advantage of using infrastructure as code operations?

  • ASelf-service infrastructure deployment
  • BTroubleshoot via a Linux diff command
  • CPublic cloud console configuration workflows (correct answer)
  • DModify a count parameter to scale resources
  • EAPI driven workflows
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Public cloud console configuration workflows

Showing questions 121–140 of 368 Β· Page 7 of 19