πŸ”

TA-003 β€” questions

Page 9 of 19 Β· 368 total questions.

Topic 1 Β· Question 164

What is the purpose of a Terraform workspace in either open source or enterprise?

  • AWorkspaces allow you to manage collections of infrastructure in state files (correct answer)
  • BA logical separation of business units
  • CA method of grouping multiple infrastructure security policies
  • DProvides limited access to a cloud environment
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Workspaces allow you to manage collections of infrastructure in state files

Explanation

Terraform state maps resource addresses to remote objects and stores metadata needed to calculate changes efficiently.

Topic 1 Β· Question 165

Which is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example git::https://example.com/vpc.git)?

  • AAppend ?ref=v1. 0. 0 argument to the source path (correct answer)
  • BAdd version = "1.0.0" parameter to module block
  • CNothing "" modules stored on GitHub always default to version 1.0.0
  • DModules stored on GitHub do not support versioning
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Append ?ref=v1. 0. 0 argument to the source path

Topic 1 Β· Question 166

Changing the Terraform backend from the default "local" backend to a different one after doing your first terraform apply is:

  • AMandatory
  • BOptional (correct answer)
  • CImpossible
  • DDiscouraged
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Optional

Topic 1 Β· Question 167

You have modified your local Terraform configuration and ran 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.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 168

terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem? Error loading state: AccessDenied: Access Denied status code: 403, request id: 288766CE5CCA24A0, host id: FOOBAR

  • ASet TF_LOG=DEBUG (correct answer)
  • BReview syslog for Terraform error messages
  • CRun terraform login to reauthenticate with the provider
  • DReview /var/log/terraform.log for error messages
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Set TF_LOG=DEBUG

Topic 1 Β· Question 169

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

  • AClone the repository containing your infrastructure code and then run the code
  • BUse the public cloud console to make the change after a database record has been approved
  • CMake the change programmatically via the public cloud CLI
  • DMake the change via the public cloud API endpoint
  • ESubmit a pull request and wait for an approved merge of the proposed changes (correct answer)
Reveal answer & explanation
Correct answer: E

The correct answer is E. Option E: Submit a pull request and wait for an approved merge of the proposed changes

Topic 1 Β· Question 170

What command can you run to generate DOT (Document Template) formatted data to visualize Terraform dependencies?

  • Aterraform refresh
  • Bterraform show
  • Cterraform graph (correct answer)
  • Dterraform output
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: terraform graph

Topic 1 Β· Question 171

Which provider authentication method prevents credentials from being stored in the state file?

  • AUsing environment variables
  • BSpecifying the login credentials in the provider block
  • CSetting credentials as Terraform variables
  • 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 172

Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files without changing their contents.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 173

terraform init retrieves the source code for all referenced modules.

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

The correct answer is A. Option A: True

Topic 1 Β· Question 174

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 when you run terraform apply in the working directory again?

  • ANothing
  • BTerraform will destroy the virtual machine (correct answer)
  • CTerraform will error
  • DTerraform will remove the virtual machine from the state file, but the resource will still exist
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Terraform will destroy the virtual machine

Topic 1 Β· Question 175

Which configuration consistency errors does terraform validate report?

  • AA mix of spaces and tabs in configuration files
  • BDifferences between local and remote state
  • CTerraform module isn't the latest version
  • DDeclaring a resource identifier more than once (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Declaring a resource identifier more than once

Topic 1 Β· Question 176

In Terraform HCL, an object type of object({ name=string, age=number }) would match this value: A. B.

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

The correct answer is B. Option B:

Topic 1 Β· Question 177

Where can Terraform not load a provider from?

  • ASource code (correct answer)
  • BPlugins directory
  • COfficial HashiCorp distribution on releases.hashicorp.com
  • DProvider plugin cache
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Source code

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

Which of the following locations can Terraform use as a private source for modules? (Choose two.)

  • AInternally hosted SCM (Source Control Manager) platform (correct answer)
  • BPublic Terraform Module Registry
  • CPrivate repository on GitHub (correct answer)
  • DPublic repository on GitHub
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: Internally hosted SCM (Source Control Manager) platform Option C: Private repository on GitHub This option keeps traffic private / properly secured as required.

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

Why should secrets not be hard coded into Terraform code? (Choose two.)

  • AIt makes the code less reusable. (correct answer)
  • BTerraform code is typically stored in version control, as well as copied to the systems from which it's run. Any of those may not have robust security mechanisms. (correct answer)
  • CThe Terraform code is copied to the target resources to be applied locally and could expose secrets if a target resource is compromised.
  • DAll passwords should be rotated on a quarterly basis.
Reveal answer & explanation
Correct answer: A, B

The correct answer is A, B. Option A: It makes the code less reusable. Option B: Terraform code is typically stored in version control, as well as copied to the systems from which it's run. Any of those may not have robust security mechanisms.

Topic 1 Β· Question 180

If a Terraform creation-time provisioner fails, what will occur by default?

  • AThe resource will not be affected, but the provisioner will need to be applied again
  • BThe resource will be destroyed
  • CThe resource will be marked as "tainted" (correct answer)
  • DNothing, provisioners will not show errors in the command line
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: The resource will be marked as "tainted"

Topic 1 Β· Question 181

When should Terraform configuration files be written when running terraform import on existing infrastructure?

  • AInfrastructure can be imported without corresponding Terraform code
  • BTerraform will generate the corresponding configuration files for you
  • CYou should write Terraform configuration files after the next terraform import is executed
  • DTerraform configuration should be written before terraform import is executed (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Terraform configuration should be written before terraform import is executed

Explanation

terraform import associates an existing remote object with a resource address in Terraform state.

Topic 1 Β· Question 182

Which command lets you experiment with Terraform's built-in functions?

  • Aterraform env
  • Bterraform console (correct answer)
  • Cterraform test
  • Dterraform validate
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: terraform console

Explanation

terraform console evaluates Terraform expressions interactively using the current configuration and state.

Topic 1 Β· Question 183

Why does this backend configuration not follow best practices?

Exhibit 1 for question 183
  • AYou should not store credentials in Terraform Configuration (correct answer)
  • BYou should use the local enhanced storage backend whenever possible
  • CAn alias meta-argument should be included in backend blocks whenever possible
  • DThe backend configuration should contain multiple credentials so that more than one user can execute terraform plan and terraform apply
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: You should not store credentials in Terraform Configuration

Showing questions 161–180 of 368 Β· Page 9 of 19