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.
Terraform Associate Practice Exam 2020 – Exam 2 – Question 31 to 57
Oscar is modifying his Terraform configuration file but isn’t 100% sure it’s correct. He is afraid that changes made could negatively affect production workloads. How can Oscar validate the changes that will be made without impacting existing workloads?
|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|
run a terraform validate to ensure the changes won’t impact the production workloads
What is the result of the following terraform function call?
> zipmap(["a", "b"], [1, 2])
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|
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)
aws = "~> 1.2.0"
True or False? Each Terraform workspace uses its own state file to manage the infrastructure associated with that particular workspace.
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!
Where are these plugins downloaded to?
|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.|
The .terraform.d directory in the directory terraform init was executed in.
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 private install
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|
it is automatically deleted
Terraform Enterprise (also referred to as pTFE) requires what type of backend database for a clustered deployment?
Which of the following is not a valid Terraform string function?
Which are some of the benefits of using Infrastructure as Code in general? (select three)
|A.||it is always platform agnostic|
it can be versioned
it can be shared
|D.||it can be reused|
Terraform has detailed logs which can be enabled by setting the _________ environmental variable.
Freddy and his co-worker Jason are deploying resources in GCP using Terraform for their team. After resources have been deployed, they need to destroy the cloud-based resources to save on costs. However, two other team members, Michael and Chucky, are using a Cloud SQL instance for testing and are asking to keep it running.
How can Freddy and Jason easily destroy all other resources without negatively impacting the database?
|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|
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|
Which of the following statements best describes the Terraform list(...) type?
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.|
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)
Terraform is distributed as a single binary and available for many different platforms. Select all Operating Systems that Terraform is available for. (select five)
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.
Which of the following variable declarations is going to result in an error?
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|
|E.||CVS Version Control|
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|
Environment variables can be used to set variables. The environment variables must be in the format "____"_<<em>variablename</em>>. Select the correct prefix string from the following list.
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.
Which of the following commands will launch the Interactive console for Terraform interpolations?
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?
While Terraform is generally written using the HashiCorp Configuration Language (HCL). What other syntax can Terraform be expressed in?
Select all features which are exclusive to Terraform Enterprise and Terraform Cloud for Business (select three).