Home Máy chủLinux HashiCorp Certified: Terraform Associate Practice Exam 2020 – Exam 2 (Q31-Q57)

HashiCorp Certified: Terraform Associate Practice Exam 2020 – Exam 2 (Q31-Q57)

by admincp

HashiCorp Certified: Terraform Associate Practice Exam 2020 – Exam 2 (Q31-Q57)Cuongquach.com | Bộ đề ôn thi chứng chỉ HashiCorp Certified: Terraform Associate , Bộ đề số 2 với những câu hỏi trọng tâm trong năm 2020 và 2021 về kiến thức sử dụng công cụ Terraform quản lý hạ tầng dịch vụ. Bộ đề số 2, bao gồm 57 câu hỏi chia ra làm nhiều bài viết, bạn đang ở bài viết bao gồm câu hỏi 31 đến câu hỏi 57 của bộ đề 2.

Có thể bạn quan tâm phần 1 – Exam 2:
HashiCorp Certified: Terraform Associate Practice Exam 2020 – Exam 2 (Q1-Q30)

Nếu bạn cảm thấy câu trả lời của các câu hỏi có sự không chính xác hoặc băn khoăn về đáp án, thì đừng ngại bình luận ở dưới.

[note note_color=”#FFFF66″ text_color=”#333333″ radius=”3″]HashiCorp Certified: Terraform Associate Test Exam, questionnaire number 2 focus on knowledge of using Terraform to manage infrastructure. Questionare Exam 2, consists of 56 questions divided into multiple articles, you are in the post including questions 31 to 57 of the Questionare Exam 2[/note]

terraform-associate-exam-02-part-2

Terraform Associate Practice Exam 2020 – Exam 2 – Question 31 to 57

[label type=”important”]Question 31[/label]

A. run a terraform plan and validate the changes that will be made
B. run terraform apply using a local-exec provisioner so the configuration won’t impact existing workloads
C. run terraform refresh to compare his existing configuration file against the current one
D.

run a terraform validate to ensure the changes won’t impact the production workloads

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 32[/label]

What is the result of the following terraform function call?

> zipmap(["a", "b"], [1, 2])
A.
{
  "a" = 1
  "b" = 2
}
B.
{
  "a",
  "b",
  "1",
  "2",
}
C.
[
  "a" = 1
  "b" = 2
]
D.
[
  "a",
  "b",
  "1",
  "2",
]

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 33[/label]

Complete the following sentence:

The terraform state command can be used to ____

A. modify the current state, such as removing items
B. refresh the existing state
C. create a new state file
D. there is no such command

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 34[/label]

When using constraint expressions to signify a version of a provider, which of the following are valid provider versions that satisfy the expression found in the following code snippet: (select two)

terraform {
  required_providers {
    aws = "~> 1.2.0"
  }
}
A.

1.3.0

B. 1.2.3
C. 1.3.1
D. 1.2.9

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B, D[/spoiler]


[label type=”important”]Question 35[/label]

True or False? Each Terraform workspace uses its own state file to manage the infrastructure associated with that particular workspace.

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 36[/label]

A user runs terraform init on their RHEL based server and per the output, two provider plugins are downloaded:

$ terraform init
 
Initializing the backend...
 
Initializing provider plugins...
- Checking for available provider plugins...
- Downloading plugin for provider "aws" (hashicorp/aws) 2.44.0...
- Downloading plugin for provider "random" (hashicorp/random) 2.2.1...
 
Terraform has been successfully initialized!
A. The .terraform.plugins directory in the directory terraform init was executed in.
B. The .terraform/plugins directory in the directory terraform init was executed in.
C.

The .terraform.d directory in the directory terraform init was executed in.

D. /etc/terraform/plugins

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 37[/label]

When Terraform needs to be installed in a location where it does not have internet access to download the installer and upgrades, the installation is generally known as to be __________.

A.

a private install

B. disconnected
C.

air-gapped

D. non-traditional

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]C[/spoiler]


[label type=”important”]Question 38[/label]

During a terraform apply, a resource is successfully created but eventually fails during provisioning. What happens to the resource?

A. the resource is marked as tainted
B. the terraform plan is rolled back and all provisioned resources are removed
C. Terraform attempts to provision the resource up to three times before exiting with an error
D.

it is automatically deleted

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 39[/label]

Terraform Enterprise (also referred to as pTFE) requires what type of backend database for a clustered deployment?

A. PostgreSQL
B.

MySQL

C. Cassandra
D. MSSQL

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 40[/label]

Which of the following is not a valid Terraform string function?

A. join
B. tostring
C. format
D. replace

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 41[/label]

Which are some of the benefits of using Infrastructure as Code in general? (select three)

A. it is always platform agnostic
B.

it can be versioned

C.

it can be shared

D. it can be reused

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B, C, D[/spoiler]


[label type=”important”]Question 42[/label]

A.

TF_DEBUG

B.

TF_INFO

C.

TF_LOG

D.

TF_TRACE

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]C[/spoiler]


[label type=”important”]Question 43[/label]

A. delete the entire state file using the terraform state rm command and manually delete the other resources in GCP
B. take a snapshot of the database, run a terraform destroy, and then recreate the database in the GCP console by restoring the snapshot
C. run a terraform state rm command to remove the Cloud SQL instance from Terraform management before running the terraform destroy command
D. run a terraform destroy, modify the configuration file to include only the Cloud SQL resource, and then run a terraform apply

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]C[/spoiler]


[label type=”important”]Question 44[/label]

Emma is a Terraform expert, and she has automated all the things with Terraform. During a recent deployment, a virtual machine was deployed but a local script did not work correctly, and therefore needs to be destroyed and recreated. How can Emma easily have Terraform recreate this one resource without having to destroy everything that was created?

A. use terraform import to import the error so Terraform is aware of the problem
B. use terraform refresh to refresh the state and make Terraform aware of the error
C. use terraform state rm to remove the resource from the state file, which will cause Terraform to recreate the instance again
D. use terraform taint to mark the virtual machine as tainted

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]D[/spoiler]


[label type=”important”]Question 45[/label]

A.

a collection of values where each is identified by a string label.

B. a collection of named attributes that each have their own type
C. a collection of unique values that do not have any secondary identifiers or ordering.
D. a sequence of values identified by consecutive whole numbers starting with zero.

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]D[/spoiler]


[label type=”important”]Question 46[/label]

Whenever you add a new module to a configuration, Terraform must install the module before it can be used. What two commands can be used to install and update modules? (select two)

A. terraform refresh
B. terraform init
C. terraform get
D. terraform plan

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B, C[/spoiler]


[label type=”important”]Question 47[/label]

Terraform is distributed as a single binary and available for many different platforms. Select all Operating Systems that Terraform is available for. (select five)

A. Windows
B. Linux
C. MacOS
D. Solaris
E. FreeBSD
F. Unix

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A, B, C, D, E[/spoiler]


[label type=”important”]Question 48[/label]

True or False? The terraform refresh command is used to reconcile the state Terraform knows about (via its state file) with the real-world infrastructure. If drift is detected between the real-world infrastructure and the last known-state, it will modify the infrastructure to correct the drift.

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 49[/label]

Which of the following variable declarations is going to result in an error?

A.
variable "example" { 
  description = "This is a test"
  type        = map
  default     = {"one" = 1, "two" = 2, "Three" = "3"}
}
B.
variable "example" { 
  description = "This is a variable description" 
  type        = list(string) 
  default     = {}
}
C.
variable "example" {}
D.
variable "example" { 
  type = object({})
}

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 50[/label]

Terraform Cloud is more powerful when you integrate it with your version control system (VCS) provider. Select all the supported VCS providers from the answers below. (select four)

A. Azure DevOps Server
B. Github Enterprise
C. Github
D. Bitbucket Cloud
E. CVS Version Control

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A, B, C, D[/spoiler]


[label type=”important”]Question 51[/label]

Sara has her entire application automated using Terraform, but she now needs to start including more infrastructure pieces, such as creating a new subnet, DNS record, and load balancer. Like the Terraform pro she is, Sara requires that these new resources be created within modules so she can easily reuse the code later. However, Sara is having problems getting the subnet_id from the subnet module to pass to the load balancer module. What could fix this problem?

A. publish the module to a Terraform registry first
B. add an output to the subnet module and reference it using module.subnet.subnet_id in the load balancer module
C. move the subnet and load balancer resource into the main configuration file so they can easily be referenced
D. references to resources in a module cannot be used within other modules

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 52[/label]

A. TF_ENV_VAR
B.

TF_VAR_NAME

C. TF_ENV
D. TF_VAR

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]D[/spoiler]


[label type=”important”]Question 53[/label]

True or False? When using the Terraform provider for Vault, the tight integration between these HashiCorp tools provides the ability to mask secrets in the terraform plan and state files.

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]B[/spoiler]


[label type=”important”]Question 54[/label]

Which of the following commands will launch the Interactive console for Terraform interpolations?

A.

terraform cli

B. terraform
C.

terraform console

D. terraform cmdline

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]C[/spoiler]


[label type=”important”]Question 55[/label]

A “backend” in Terraform determines how state is loaded and how an operation such as apply is executed. Which of the following is not a supported backend type?

A. s3
B. terraform enterprise
C.

github

D. artifactory
E. consul

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]C[/spoiler]


[label type=”important”]Question 56[/label]

While Terraform is generally written using the HashiCorp Configuration Language (HCL). What other syntax can Terraform be expressed in?

A. JSON
B. XML
C. YAML
D. TypeScript

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A[/spoiler]


[label type=”important”]Question 57[/label]

A.

Self-Service Infrastructure

B. Cost Estimation
C. Audit Logging
D. Sentinel
E. SAML/SSO

[spoiler title=”Answer” open=”no” style=”fancy” icon=”chevron” anchor_in_url=”no”]A, C, E

Reference: LINK
[/spoiler]

Nguồn: https://cuongquach.com/

You may also like

Leave a Comment