EMT Practice Test

1. Question Content...


Question List

Question1: Given the Terraform configuration below, in which order will the resources be created?
1. resource "aws_instance" "web_server"
2. {
3. ami = "ami-b374d5a5"
4. instance_type = "t2.micro"
5. }
6. resource "aws_eip" "web_server_ip"
7. {
8. vpc = true instance = aws_instance.web_server.id
9. }

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

Question3: When multiple engineers start deploying infrastructure using the same state file, what is a feature of remote state storage that is critical to ensure the state doesn't become corrupt?

Question4: You are using a terraform operation that writes state. Unfortunately automatic state unlocking has failed for that operation. Which of the below commands can be used to remove the already acquired lock on the state?

Question5: lookup retrieves the value of a single element from which of the below data type?

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

Question7: You have declared a variable name my_var in terraform configuration without a value associated with it.
variable my_var {}
After running terraform plan it will show an error as variable is not defined.

Question8: Which of the following command can be used to view the specified version constraints for all providers used in the current configuration.

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

Question10: In Terraform Enterprise, a workspace can be mapped to how many VCS repos?

Question11: 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)

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

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

Question14: You have already set TF_LOG = DEBUG to enable debug log. Now you want to always write the log to the directory you're currently running terraform from. what should you do to achieve this.

Question15: What kind of resource dependency is stored in terraform.tfstate file?

Question16: Which of the following challenges would Terraform be a candidate for solving? (Select THREE)

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

Question18: Which of the below backends support state locking?

Question19: You have created a terraform script that uses a lot of new constructs that have been introduced in terraform v0.12. However, many developers who are cloning the script from your git repo, are using v0.11, and getting errors. What can be done from your end to solve this problem?

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

Question21: What does terraform refresh command do?

Question22: 1. resource "aws_s3_bucket" "example" {
2. bucket = "my-test-s3-terraform-bucket"
3. ...} resource "aws_iam_role" "test_role" {
4. name = "test_role"
5. ...}
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?

Question23: Which of the following is the right substitute for static values that can make Terraform configuration file more dynamic and reusable?

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

Question25: What resource dependency information is stored in Terraform's state?

Question26: Multiple providers can be declared within a single Terraform configuration file.

Question27: What is the default backend for Terraform?

Question28: Which of the following allows Terraform users to apply policy as code to enforce standardized configurations for resources being deployed via infrastructure as code?

Question29: You want to use terraform import to start managing infrastructure that was not originally provisioned through infrastructure as code. Before you can import the resource's current state, what must you do in order to prepare to manage these resources using Terraform?

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

Question31: Which of the below options is a valid interpolation syntax for retrieving a data source?

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

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

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

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

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

Question37: You wanted to destroy some of the dependent resources from real infrastructure. You choose to delete those resources from your configuration file and run terraform plan and then apply. Which of the following way your resources would be destroyed?

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

Question39: Valarie has created a database instance in AWS and for ease of use is outputting the value of the database password with the following code. Valarie wants to hide the output value in the CLI after terraform apply that's why she has used sensitive parameter.
1. output "db_password" {
2. value = local.db_password
3. sensitive = true
4. }
Since sensitive is set to true, will the value associated with db password be available in plain-text in the state file for everyone to read?

Question40: What does terrafom plan do ?

Question41: A variable az has the following default value. What will be the datatype of the variable?
az=["us-west-1a","us-east-1a"]

Question42: Mary has created a database instance in AWS and for ease of use is outputting the value of the database password with the following code:
1. output "db_password"
2. {
3. value = local.db_password
4. }
Mary wants to hide the output value in the CLI after terraform apply? What is the best way?

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

Question44: Terraform import command can import resources into modules as well directly into the root of your state.

Question45: Command terraform refresh will update state file?

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

Question47: Which of the following clouds does not have a provider maintained HashiCorp?

Question48: Terraform must track metadata such as resource dependencies. Where is this data stored?

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

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

Question51: A user has created three workspaces using the command line - prod, dev, and test. The user wants to create a fourth workspace named stage. Which command will the user execute to accomplish this?

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

Question53: Terraform has detailed logs which can be enabled by setting the _________ environmental variable.

Question54: Your company has a lot of workloads in AWS , and Azure that were respectively created using CloudFormation , and AzureRM Templates. However , now your CIO has decided to use Terraform for all new projects , and has asked you to check how to integrate the existing environment with terraform code.
What should be your next plan of action?

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

Question56: Terraform works well in Windows but a Windows server is required.

Question57: Terraform-specific settings and behaviors are declared in which configuration block type?

Question58: Which Terraform command will check and report errors within modules, attribute names, and value types to make sure they are syntactically valid and internally consistent?

Question59: What is a downside to using the Vault provider to read secrets from Vault?