πŸ”

TA-003 β€” questions

Page 12 of 19 Β· 368 total questions.

Topic 1 Β· Question 226

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 changes
  • DAfter you run terraform apply so you can validate that your infrastructure is reflected in your code
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 227

How does Terraform manage most dependencies between resources?

  • ABy defining dependencies as modules and including them in a particular order
  • BThe order that resources appear in Terraform configuration indicates dependencies
  • CUsing the depends_on parameter
  • DTerraform will automatically manage most resource dependencies (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Terraform will automatically manage most resource dependencies

Topic 1 Β· Question 228

What does running a terraform plan do?

  • AImports all of your existing cloud provider resources to the state file
  • BCompares the state file to your Terraform code and determines if any changes need to be made (correct answer)
  • CImports all of your existing cloud provider resources to your Terraform configuration file
  • DCompares 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
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: Compares the state file to your Terraform code and determines 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 229 Β· Select all that apply

What are some benefits of using Sentinel with Terraform Cloud/Terraform Enterprise? (Choose three.)

  • APolicy-as-code can enforce security best practices (correct answer)
  • BYou can restrict specific configurations on resources like "CIDR=0.0.0.0/0" not allowed (correct answer)
  • CYou can enforce a list of approved AWS AMIs (correct answer)
  • DSentinel Policies can be written in HashiCorp Configuration Language (HCL)
  • EYou can check out and check in cloud access keys
Reveal answer & explanation
Correct answer: A, B, C

The correct answer is A, B, C. Option A: Policy-as-code can enforce security best practices Option B: You can restrict specific configurations on resources like "CIDR=0.0.0.0/0" not allowed Option C: You can enforce a list of approved AWS AMIs

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

You want to share Terraform state with your team, store it securely, and provide state locking. How would you do this? (Choose three.)

  • AUsing the remote Terraform backend with Terraform Cloud / Terraform Enterprise. (correct answer)
  • BUsing the local backend.
  • CUsing the s3 terraform backend. The dynamodb_field option is not needed.
  • DUsing an s3 terraform backend with an appropriate IAM policy and dynamodb_field option configured. (correct answer)
  • EUsing the consul Terraform backend. (correct answer)
Reveal answer & explanation
Correct answer: A, D, E

The correct answer is A, D, E. Option A: Using the remote Terraform backend with Terraform Cloud / Terraform Enterprise. Option D: Using an s3 terraform backend with an appropriate IAM policy and dynamodb_field option configured. Option E: Using the consul Terraform backend.

Explanation

A Terraform backend determines where state is stored and, for supported backends, how operations and locking are performed. Terraform Cloud, now HCP Terraform, provides managed remote runs, state, collaboration, policy, and governance. This option keeps traffic private / properly secured as required.

Topic 1 Β· Question 231

From which of these sources can Terraform import modules?

  • ALocal path
  • BGitHub Repository
  • CTerraform Module Registry
  • DAll of the above (correct answer)
Reveal answer & explanation
Correct answer: D

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

Topic 1 Β· Question 232

How would you output returned values from a child module?

  • ADeclare the output in the root configuration
  • BDeclare the output in the child module
  • CDeclare the output in both the root and child module (correct answer)
  • DNone of the above
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: Declare the output in both the root and child module

Explanation

A Terraform module packages related resources into a reusable configuration with defined inputs and outputs. A child module is called by another module to reuse and encapsulate infrastructure configuration.

Topic 1 Β· Question 233

You have decided to create a new Terraform workspace to deploy a development environment. What is different about this workspace?

  • AIt has its own state file (correct answer)
  • BIt pulls in a different terraform.tfvars file
  • CIt uses a different branch of code
  • DIt uses a different backend
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: It has its own state file

Explanation

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

Topic 1 Β· Question 234

Any user can publish modules to the public Terraform Module Registry.

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

The correct answer is A. Option A: True

Topic 1 Β· Question 235

Which of these commands makes your code more human readable?

  • Aterraform validate
  • Bterraform output
  • Cterraform plan
  • 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 236

Infrastructure as Code (IaC) can be stored in a version control system along with application code.

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

The correct answer is A. Option A: True

Topic 1 Β· Question 237

Select the command that doesn’t cause Terraform to refresh its state.

  • Aterraform apply
  • Bterraform destroy
  • Cterraform plan
  • Dterraform state list (correct answer)
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: terraform state list

Explanation

terraform state subcommands inspect and safely modify resource bindings recorded in state.

Topic 1 Β· Question 238

Sentinel policy-as-code is available in Terraform Enterprise.

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

The correct answer is A. Option A: True

Topic 1 Β· Question 239

Before you can use Terraform’s remote backend, you must first execute terraform init.

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

The correct answer is A. Option A: True

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

Which two steps are required to provision new infrastructure in the Terraform workflow? (Choose two.)

  • APlan
  • BApply (correct answer)
  • CImport
  • DInit (correct answer)
  • EValidate
Reveal answer & explanation
Correct answer: B, D

The correct answer is B, D. Option B: Apply Option D: Init

Topic 1 Β· Question 241

You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?

  • ATerraform data sources
  • BTerraform local values
  • CTerraform modules
  • DTerraform workspaces (correct answer)
  • ENone of the above
Reveal answer & explanation
Correct answer: D

The correct answer is D. Option D: Terraform workspaces

Explanation

Terraform CLI workspaces maintain separate state instances for the same configuration.

Topic 1 Β· Question 242

Which provisioner invokes a process on the machine running Terraform?

  • Aremote-exec
  • Bfile
  • Clocal-exec (correct answer)
  • Dnull-exec
Reveal answer & explanation
Correct answer: C

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

Topic 1 Β· Question 243

____________ backends support state locking.

  • ASome (correct answer)
  • BNo
  • COnly local
  • DAll
Reveal answer & explanation
Correct answer: A

The correct answer is A. Option A: Some

Topic 1 Β· Question 244

Which of the following methods, used to provision resources into a public cloud, demonstrates the concept of infrastructure as code?

  • Acurl commands manually run from a terminal
  • BA sequence of REST requests you pass to a public cloud API endpoint
  • CA script that contains a series of public cloud CLI commands (correct answer)
  • DA series of commands you enter into a public cloud console
Reveal answer & explanation
Correct answer: C

The correct answer is C. Option C: A script that contains a series of public cloud CLI commands

Topic 1 Β· Question 245

Which of the following should you put into the required_providers block?

  • Aversion >= 3.1
  • Bversion = β€œ>= 3.1” (correct answer)
  • Cversion ~> 3.1
Reveal answer & explanation
Correct answer: B

The correct answer is B. Option B: version = β€œ>= 3.1”

Showing questions 221–240 of 368 Β· Page 12 of 19