πŸ”

TA-003 β€” questions

Page 17 of 19 Β· 368 total questions.

Topic 1 Β· Question 329

Which of the following is not an action performed by terraform init?

  • ACreate template configuration files (correct answer)
  • BInitialize a configured backend
  • CRetrieve the source code for all referenced modules
  • DLoad required provider plugins
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Create template configuration files

Topic 1 Β· Question 330

In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit change to version control.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 331

A resource block is shown in the Exhibit space of this page. What is the Terraform resource name of the resource block?

Exhibit 1 for question 331
  • Atest
  • Bmain (correct answer)
  • Cgoogle
  • Dcompute_instance
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: main

Topic 1 Β· Question 332

A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?

Exhibit 1 for question 332
  • AYou cannot. Modules stored on the public Terraform Registry do not support versioning.
  • BAdd a version = β€œ1.0.0” attribute to the module block. (correct answer)
  • CNothing. Modules stored on the public Terraform module Registry always default to version 1.0.0.
  • DAppend ?ref=v1.0.0 argument to the source path.
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Add a version = β€œ1.0.0” attribute to the module block.

Explanation

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

Topic 1 Β· Question 333

Which syntax check errors when you run terraform validate?

  • AThe code contains tabs for indentation instead of spaces.
  • BThere is a missing value for a variable.
  • CThe state file does not match the current infrastructure.
  • 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 334

Terraform encrypts sensitive values stored in your state file.

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

The correct answer is B. Option B: False This option keeps traffic private / properly secured as required.

Topic 1 Β· Question 335

When should you run terraform init?

  • AEvery time you run terraform apply
  • BAfter you run terraform plan for the first time in a new Terraform project and before you run terraform apply
  • CAfter you start coding a new Terraform project and before you run terraform plan for the first time (correct answer)
  • DBefore you start coding a new Terraform project
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: After you start coding a new Terraform project and before you run terraform plan for the first time

Explanation

terraform plan compares configuration and state with real infrastructure and previews the proposed changes without applying them.

Topic 1 Β· Question 336

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

  • AAfter you run terraform plan so you can validate that your state file is consistent with your infrastructure
  • BBefore you run terraform plan so you can validate your code syntax (correct answer)
  • CBefore you run terraform apply so you can validate your infrastructure
  • DAfter you run terraform apply so you can validate your provider credentials
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Before you run terraform plan so you can validate your code syntax

Explanation

terraform plan compares configuration and state with real infrastructure and previews the proposed changes without applying them.

Topic 1 Β· Question 337

Which of these commands makes your code more human readable?

  • Aterraform validate
  • Bterraform output
  • Cterraform show
  • Dterraform fmt (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform fmt

Explanation

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

Topic 1 Β· Question 338

Terraform configuration can only import from the public registry.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 339

terraform init retrieves and caches the configuration for all remote modules.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 340

Terraform configuration can only call modules from the public registry.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 341

A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?

Exhibit 1 for question 341
  • Adata.kubernetes_namespace.name
  • Bresource.kubernetes_namespace.example.name
  • Ckubernetes_namespace.test.name
  • Dkubernetes_namespace.example.name (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: kubernetes_namespace.example.name

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

You want to use API tokens and other secrets within your team’s Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Choose three.)

  • AIn a terraform.tfvars file, securely managed and shared with your team. (correct answer)
  • BIn HashiCorp Vault. (correct answer)
  • CIn a terraform.tfvars file, checked into your version control system.
  • DIn a plaintext document on a shared drive.
  • EIn an HCP Terraform/Terraform Cloud variable, with the sensitive option checked. (correct answer)
Reveal answer & explanation
Correct answer: A, B, E

The correct answer is A, B, E. Option A: In a terraform.tfvars file, securely managed and shared with your team. Option B: In HashiCorp Vault. Option E: In an HCP Terraform/Terraform Cloud variable, with the sensitive option checked.

Explanation

Marking a value sensitive redacts it from routine CLI output, though it can still be stored in state. HCP Terraform provides managed runs, remote state, collaboration, policy enforcement, private registries, and governance. Terraform Cloud, now HCP Terraform, provides managed remote runs, state, collaboration, policy, and governance.

Topic 1 Β· Question 343

What happens when you execute terraform plan?

  • AImports all of your existing cloud provider resources to the state.
  • BInstalls all providers and modules referenced by configuration.
  • CCompares your Terraform code and local state file to the remote state file in a cloud provider and determines if any changes need to be made.
  • DRefreshes your state, then compares your state file to your Terraform configuration and creates an execution plan if any changes need to be made. (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Refreshes your state, then compares your state file to your Terraform configuration and creates an execution plan if any changes need to be made.

Explanation

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

Topic 1 Β· Question 344

What does terraform destroy do?

  • ADestroys the Terraform state file, leaves the infrastructure intact.
  • BDestroys all Terraform code files in the current directory, leaves the state file intact.
  • CDestroy all infrastructure in the Terraform state file. (correct answer)
  • DDestroys all infrastructure in the configured Terraform provider.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Destroy all infrastructure in the Terraform state file.

Explanation

terraform state subcommands inspect and safely modify resource bindings recorded in state. Terraform state maps resource addresses to remote objects and stores metadata needed to calculate changes efficiently.

Topic 1 Β· Question 345

When you include a module block in your configuration that references a module from the Terraform Registry, the β€œversion” attribute is required.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 346

Your root module contains a variable named num.servers. Which is the correct way to pass its value to a child module with an input named servers?

  • A${var.num.servers}
  • Bservers = num.servers
  • Cservers = var(num.servers)
  • Dservers = var.num_servers (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: servers = var.num_servers

Topic 1 Β· Question 347

What does the default local Terraform backend store?

  • AProvider plugins
  • BTerraform binary
  • Ctfplan files
  • DState file (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: State file

Explanation

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

Topic 1 Β· Question 348

Which method for sharing Terraform modules fulfills the following criteria: 1. Keeps the module configurations confidential within your organization. 2. Supports Terraform’s semantic version constraints. 3. Provides a browsable directory of your modules.

  • APublic Terraform module registry.
  • BA subfolder within your workspace.
  • CHCP Terraform/Terraform Cloud private registry. (correct answer)
  • DA Git repository containing your modules.
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: HCP Terraform/Terraform Cloud private registry.

Explanation

HCP Terraform provides managed runs, remote state, collaboration, policy enforcement, private registries, and governance. Terraform Cloud, now HCP Terraform, provides managed remote runs, state, collaboration, policy, and governance. A private registry lets an organization publish and govern internal modules and providers for reuse.

Showing questions 321–340 of 368 Β· Page 17 of 19