EMT Practice Test

1. Question Content...


Question List

Question1: Multiple provider instances blocks for AWS can be part of a single configuration file?

Question2: terraform validate validates the syntax of Terraform files.

Question3: Which of the following Terraform commands will automatically refresh the state unless supplied with additional flags or arguments? Choose TWO correct answers.

Question4: What does terrafom plan do ?

Question5: Select the feature below that best completes the sentence:
The following list represents the different types of __________ available in Terraform.
1. max
2. min
3. join
4. replace
5. list
6. length
7. range

Question6: Which of the below datatype is not supported by Terraform.

Question7: The Security Operations team of ABC Enterprise wants to mandate that all the Terraform configuration that creates an S3 bucket must have encryption feature enabled. What is the best way to achieve it?

Question8: The terraform init command is always safe to run multiple times, to bring the working directory up to date with changes in the configuration. Though subsequent runs may give errors, this command will never delete your existing configuration or state.

Question9: 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 __________.

Question10: After creating a new workspace "PROD" you need to run the command terraform select PROD to switch to it.

Question11: terraform refresh will update the state file?

Question12: Where in your Terraform configuration do you specify a state backend?

Question13: State locking does not happen automatically and must be specified at run

Question14: John is writing a module and within the module, there are multiple places where he has to use the same conditional expression but he wants to avoid repeating the same values or expressions multiple times in a configuration,. What is a better approach to dealing with this?

Question15: Select all features which are exclusive to Terraform Enterprise. (Select Three)

Question16: Only the user that generated a plan may apply it.

Question17: You have created a custom variable definition file testing.tfvars. How will you use it for provisioning infrastructure?

Question18: True or False? By default, Terraform destroy will prompt for confirmation before proceeding.

Question19: What Terraform feature is shown in the example below?

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

Question21: If a module uses a local variable, you can expose that value with a terraform output.

Question22: When does terraform apply reflect changes in the cloud environment?

Question23: Once a resource is marked as tainted, the next plan will show that the resource will be _________ and
___________ and the next apply will implement this change.

Question24: Which of the following value will be accepted for var1?
variable "var1" {
type = string
}

Question25: Dawn has created the below child module. Without changing the module, can she override the instance_type from t2.micro to t2.large form her code while calling this module?
1. resource "aws_instance" "myec2"
2. {
3. ami = "ami-082b5a644766e0e6f"
4. instance_type = "t2.micro
5. }

Question26: In order to make a Terraform configuration file dynamic and/or reusable, static values should be converted to use what?

Question27: What is the result of the following terraform function call?

Question28: How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?

Question29: A user creates three workspaces from the command line - prod, dev, and test. Which of the following commands will the user run to switch to the dev workspace?

Question30: terraform init initializes a sample main.tf file in the current directory.

Question31: What is the provider for this fictitious resource?

Question32: Multiple configurations for the same provider can be used in a single configuration file.

Question33: Select two answers to complete the following sentence: Before a new provider can be used, it must be ______ and _______.

Question34: What is the name assigned by Terraform to reference this resource?

Question35: After running into issues with Terraform, you need to enable verbose logging to assist with troubleshooting the error. Which of the following values provides the MOST verbose logging?

Question36: Which of the following is an invalid variable name?

Question37: You can migrate the Terraform backend but only if there are no resources currently being managed.

Question38: What are some of the features of Terraform state? (select three)

Question39: Terraform providers are always installed from the Internet.

Question40: Which of the following is not a key principle of infrastructure as code?

Question41: Which statements best describes what the local variable assignment is doing in the following code snippet:

Question42: Talal is a DevOps engineer and he has deployed the production infrastructure using Terraform. He is using a very large configuration file to maintain and update the actual infrastructure. As the infrastructure have grown to a very complex and large, he has started experiencing slowness when he run runs terraform plan. What are the options for him to resolve this slowness?

Question43: In regards to deploying resources in multi-cloud environments, what are some of the benefits of using Terraform rather than a provider's native tooling? (select three)

Question44: resource "aws_s3_bucket" "example" { bucket = "my-test-s3-terraform-bucket" ...} resource "aws_iam_role"
"test_role" { name = "test_role" ...}
Due to the way that the application code is written , the s3 bucket must be created before the test role is created , otherwise there will be a problem. How can you ensure that?

Question45: What are some of the problems of how infrastructure was traditionally managed before Infrastructure as Code?
(select three)

Question46: You cannot publish your own modules on the Terraform Registry.

Question47: You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)

Question48: The following is a snippet from a Terraform configuration file:
Which, when validated, results in the following error:
Fill in the blank in the error message with the correct string from the list below.

Question49: Select the answer below that completes the following statement: Terraform Cloud can be managed from the CLI but requires __________?

Question50: Select the operating systems which are supported for a clustered Terraform Enterprise: (select four)

Question51: Which option can not be used to keep secrets out of Terraform configuration files?

Question52: You have multiple developers working on a terraform project (using terraform OSS), and have saved the terraform state in a remote S3 bucket . However ,team is intermittently experiencing inconsistencies in the provisioned infrastructure / failure in the code . You have traced this problem to simultaneous/concurrent runs of terraform apply command for 2/more developers . What can you do to fix this problem?

Question53: What command should you run to display all workspaces for the current configuration?

Question54: When using parent/child modules to deploy infrastructure, how would you export a value from one module to import into another module.
For example, a module dynamically deploys an application instance or virtual machine, and you need the IP address in another module to configure a related DNS record in order to reach the newly deployed application.

Question55: In the example below, the depends_on argument creates what type of dependency?

Question56: Which of these is the best practice to protect sensitive values in state files?

Question57: Anyone can publish and share modules on the Terraform Public Module Registry, and meeting the requirements for publishing a module is extremely easy. Select from the following list all valid requirements.
(select three)

Question58: If you delete a remote backend from the configuration, will you need to rebuild your state files locally?

Question59: Please identify the offerings which are unique to Terraform Enterprise, and not available in either Terraform OSS, or Terraform Cloud. Select four.

Question60: What is one disadvantage of using dynamic blocks in Terraform?

Question61: If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?

Question62: When using a module block to reference a module stored on the public Terraform Module Registry such as:

How do you specify version 1.0.0?

Question63: Ric wants to enable detail logging and he wants highest verbosity of logs. Which of the following environment variable settings is correct option for him to select.

Question64: Using multi-cloud and provider-agnostic tools provides which of the following benefits?

Question65: Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors , and also check terraform apply to print the value as a temporary output for debugging purposes. What should be done to avoid this?

Question66: From the answers below, select the advantages of using Infrastructure as Code.

Question67: You have provisioned some aws resources in your test environment through Terraform for a POC work. After the POC, now you want to destroy the resources but before destroying them you want to check what resources will be getting destroyed through terraform. what are the options of doing that? (Select TWO)

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

Question69: Complete the following sentence:
For local state, the workspaces are stored directly in a ___________.

Question70: Which of the below configuration file formats are supported by Terraform? (Select TWO)

Question71: By default, a defined provisioner is a creation-time provisioner.

Question72: Which of the following state management command allow you to retrieve a list of resources that are part of the state file?

Question73: You want to use different AMI images for different regions and for the purpose you have defined following code block.
1.variable "images"
2.{
3. type = "map"
4.
5. default = {
6. us-east-1 = "image-1234"
7. us-west-2 = "image-4567"
8. us-west-1 = "image-4589"
9. }
10.}
What of the following approaches needs to be followed in order to select image-4589?

Question74: Given the below resource configuration -
resource "aws_instance" "web" { # ... count = 4 }
What does the terraform resource address aws_instance.web refer to?

Question75: Forcing the recreation of a resource is useful when you want a certain side effect of recreation that is not visible in the attributes of a resource. What command will do this?

Question76: A colleague has informed you that a new version of a Terraform module that your team hosts on an Amazon S3 bucket is broken. The Amazon S3 bucket has versioning enabled. Your colleague tells you to make sure you are not using the latest version in your configuration. You have the following configuration block in your code that refers to the module:
module "infranet" { source = "s3::https://s3-us-west-2.amazonaws.com/infrabucket/infra_module.zip"} What is the best way to ensure that you are not using the latest version of the module?

Question77: When TF_LOG_PATH is set, TF_LOG must be set in order for any logging to be enabled.

Question78: Which of the following terraform subcommands could be used to remove the lock on the state for the current configuration?

Question79: Which one is the right way to import a local module names consul?

Question80: 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?

Question81: Named workspaces are not a suitable isolation mechanism for strong separation between staging and production?

Question82: Your organization has moved to AWS and has manually deployed infrastructure using the console. Recently, a decision has been made to standardize on Terraform for all deployments moving forward.
What can you do to ensure that all existing is managed by Terraform moving forward without interruption to existing services?

Question83: Which of the below command will upgrade the provider version to the latest acceptable one?

Question84: What is the command you can use to set an environment variable named "var1"of type String?

Question85: One remote backend configuration always maps to a single remote workspace.

Question86: What is the default backend for Terraform?

Question87: 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.

Question88: Which Terraform command will force a marked resource to be destroyed and recreated on the next apply?

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

Question90: Which provisioner invokes a process on the resource created by Terraform?

Question91: You have created a custom variable definition file my_vars.tfvars. How will you use it for provisioning infrastructure?

Question92: A single terraform resource file that defines an aws_instance resource can simple be renamed to azurerm_virtual_machine in order to switch cloud providers

Question93: 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)
1. terraform
2. {
3. required_providers
4. {
5. aws = "~> 1.2.0"
6. }
7. }

Question94: Your team lead does not trust the junior terraform engineers who now have access to the git repo . So , he wants you to have some sort of a checking layer , whereby , you can ensure that the juniors will not create any non-compliant resources that might lead to a security audit failure in future. What can you do to efficiently enforce this?

Question95: Which of the following actions are performed during a terraform init?

Question96: Terraform init can indeed be run only a few times, because, every time terraform init will initialize the project
, and download all plugins from the internet repository , regardless of whether they were present or not , and this increases the waiting time

Question97: Refer to the following terraform variable definition
variable "track_tag" { type = list default = ["data_ec2","integration_ec2","digital_ec2"]} track_tag = { Name = element(var.track_tag,count.index)} If count.index is set to 2, which of the following values will be assigned to the name attribute of track_tag variable?

Question98: Which argument(s) is (are) required when declaring a Terraform variable?