πŸ”

TA-003 β€” questions

Page 8 of 19 Β· 368 total questions.

Topic 1 Β· Question 144

You're writing a Terraform configuration that needs to read input from a local file called id_rsa.pub. Which built-in Terraform function can you use to import the file's contents as a string?

  • Afileset("id_rsa.pub")
  • Bfilebase64("id_rsa.pub")
  • Ctemplatefile("id_rsa.pub")
  • Dfile("id_rsa.pub") (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: file("id_rsa.pub")

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

What does Terraform use providers for? (Choose three.)

  • AProvision resources for on-premises infrastructure services (correct answer)
  • BSimplify API interactions (correct answer)
  • CProvision resources for public cloud infrastructure services (correct answer)
  • DEnforce security and compliance policies
  • EGroup a collection of Terraform configuration files that map to a single state file
Reveal answer & explanation
Correct answer: A, B, C

The correct answer is A, B, C. Option A: Provision resources for on-premises infrastructure services Option B: Simplify API interactions Option C: Provision resources for public cloud infrastructure services

Topic 1 Β· Question 146

You can reference a resource created with for_each using a Splat (*) expression.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 147

How does Terraform determine dependencies between resources?

  • ATerraform automatically builds a resource graph based on resources, provisioners, special meta-parameters, and the state file, if present. (correct answer)
  • BTerraform requires all dependencies between resources to be specified using the depends_on parameter
  • CTerraform requires resources in a configuration to be listed in the order they will be created to determine dependencies
  • DTerraform requires resource dependencies to be defined as modules and sourced in order
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Terraform automatically builds a resource graph based on resources, provisioners, special meta-parameters, and the state file, if present.

Explanation

Terraform state maps resource addresses to remote objects and stores metadata needed to calculate changes efficiently. Provisioners run imperative actions as a last resort because Terraform cannot model their behavior reliably.

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

Which parameters does terraform import require? (Choose two.)

  • APath
  • BProvider
  • CResource ID (correct answer)
  • DResource address (correct answer)
Reveal answer & explanation
Correct answer: C, D

The correct answer is C, D. Option C: Resource ID Option D: Resource address

Topic 1 Β· Question 149

Once a new Terraform backend is configured with a Terraform code block, which command(s) is (are) used to migrate the state file?

  • Aterraform apply
  • Bterraform push
  • Cterraform destroy, then terraform apply
  • Dterraform init (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform init

Explanation

terraform init initializes a working directory, installs required providers and modules, and configures the backend.

Topic 1 Β· Question 150

What does this code do?

Exhibit 1 for question 150
  • ARequires any version of the AWS provider >= 3.0 and < 4.0 (correct answer)
  • BRequires any version of the AWS provider >= 3.0
  • CRequires any version of the AWS provider after the 3.0 major release, like 4.1
  • DRequires any version of the AWS provider > 3.0
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Requires any version of the AWS provider >= 3.0 and < 4.0

Explanation

A provider plugin implements resource types and data sources that communicate with an external API.

Topic 1 Β· Question 151

What does terraform refresh modify?

  • AYour cloud infrastructure
  • BYour state file (correct answer)
  • CYour Terraform plan
  • DYour Terraform configuration
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Your state file

Explanation

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

Topic 1 Β· Question 152

Which of the following is not valid source path for specifying a module?

  • Asource = "./modulelversion=v1.0.0" (correct answer)
  • Bsource = "github.com/hashicorp/example?ref=v1.0.0"
  • Csource = "./module"
  • Dsource = "hashicorp/consul/aws"
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: source = "./modulelversion=v1.0.0"

Explanation

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

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

Which of the following is true about terraform apply? (Choose two.)

  • AIt only operates on infrastructure defined in the current working directory or workspace (correct answer)
  • BYou must pass the output of a terraform plan command to it
  • CDepending on provider specification, Terraform may need to destroy and recreate your infrastructure resources (correct answer)
  • DBy default, it does not refresh your state file to reflect current infrastructure configuration
  • EYou cannot target specific resources for the operation
Reveal answer & explanation
Correct answer: A, C

The correct answer is A, C. Option A: It only operates on infrastructure defined in the current working directory or workspace Option C: Depending on provider specification, Terraform may need to destroy and recreate your infrastructure resources

Explanation

A provider plugin implements resource types and data sources that communicate with an external API.

Topic 1 Β· Question 154

Which of the following statements about local modules is incorrect?

  • ALocal modules are not cached by terraform init command
  • BLocal modules are sourced from a directory on disk
  • CLocal modules support versions (correct answer)
  • DAll of the above (all statements above are incorrect)
  • ENone of the above (all statements above are correct)
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Local modules support versions

Explanation

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

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

Which of the following is true about Terraform's implementation of infrastructure as code? (Choose two.)

  • AIt is only compatible with AWS infrastructure management
  • BYou cannot reuse infrastructure configuration
  • CYou can version your infrastructure configuration (correct answer)
  • DIt requires manual configuration of infrastructure resources
  • EIt allows you to automate infrastructure provisioning (correct answer)
Reveal answer & explanation
Correct answer: C, E

The correct answer is C, E. Option C: You can version your infrastructure configuration Option E: It allows you to automate infrastructure provisioning

Topic 1 Β· Question 156

You need to write some Terraform code that adds 42 firewall rules to a security group as shown in the example. What can you use to avoid writing 42 different nested ingress config blocks by hand?

Exhibit 1 for question 156
  • AA count loop
  • BA for block
  • CA for each block
  • DA dynamic block (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: A dynamic block

Explanation

A dynamic block programmatically generates repeatable nested blocks from a collection. This option keeps traffic private / properly secured as required.

Topic 1 Β· Question 157

Which of the following is the safest way to inject sensitive values into a Terraform Cloud workspace?

  • AWrite the value to a file and specify the file with the -var-file flag
  • BSet a value for the variable in the UI and check the "Sensitive" check box (correct answer)
  • CEdit the state file directly just before running terraform apply
  • DSet the variable value on the command line with the -var flag
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Set a value for the variable in the UI and check the "Sensitive" check box

Explanation

Marking a value sensitive redacts it from routine CLI output, though it can still be stored in state.

Topic 1 Β· Question 158

terraform apply will fail if you have not am terraform plan first to update the plan output.

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

The correct answer is B. Option B: False

Topic 1 Β· Question 159

How would you reference the attribute "name" of this fictitious resource in HCL?

Exhibit 1 for question 159
  • Aresource.kubernetes_namespace.example.name
  • Bkubernetes_namespace.test.name
  • Ckubernetes_namespace.example.name (correct answer)
  • Ddata.kubernetes_namespace.name
  • ENone of the above
Reveal answer & explanation
Correct answer: C

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

Topic 1 Β· Question 160

A Terraform output that sets the "sensitive" argument to true will not store that value 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 161 Β· Select all that apply

Which are forbidden actions when the Terraform state file is locked? (Choose three.)

  • Aterraform destroy (correct answer)
  • Bterraform fmt
  • Cterraform state list
  • Dterraform apply (correct answer)
  • Eterraform plan (correct answer)
  • Fterraform validate
Reveal answer & explanation
Correct answer: A, D, E

The correct answer is A, D, E. Option A: terraform destroy Option D: terraform apply Option E: terraform plan

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. terraform destroy removes infrastructure managed by the current Terraform configuration and state.

Topic 1 Β· Question 162

Terraform installs its providers during which phase?

  • APlan
  • BInit (correct answer)
  • CRefresh
  • DAll of the above
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Init

Topic 1 Β· Question 163

When does Sentinel enforce policy logic during a Terraform Enterprise run?

  • ABefore the plan phase
  • BDuring the plan phase
  • CBefore the apply phase (correct answer)
  • DAfter the apply phase
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Before the apply phase

Showing questions 141–160 of 368 Β· Page 8 of 19