EMT Practice Test

1. Question Content...


Question List

Question1: Which of the below features of Terraform can be used for managing small differences between different environments which can act more like completely separate working directories.

Question2: What does state locking accomplish?

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

Question4: Which of the following type of variable allows multiple values of several distinct types to be grouped together
as a single value?

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

Question6: You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (*.tf files). You need to enable debug messages to find this out.
Which of the following would achieve this?

Question7: Terraform provisioners can be added to any resource block.

Question8: Which of the following best describes a Terraform provider?

Question9: You have created 2 workspaces PROD and RQA. You have switched to RQA and provisioned RQA infrastructure from this workspace. Where is your state file stored?

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

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

Question12: You need to constrain the GitHub provider to version 2.1 or greater.
Which of the following should you put into the Terraform 0.12 configuration's provider block?

Question13: What is the standard workflow that a developer follows while working with terraform open source version?

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

Question15: Provisioners should only be used as a last resort.

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

Question17: As a developer, you want to ensure your plugins are up to date with the latest versions. Which Terraform
command should you use?

Question18: Terraform Cloud always encrypts state at rest and protects it with TLS in transit. Terraform Cloud also knows the identity of the user requesting state and maintains a history of state changes.

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

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

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

Question22: Which of the following is not true of Terraform providers?

Question23: When configuring a remote backend in Terraform, it might be a good idea to purposely omit some of the required arguments to ensure secrets and other important data aren't inadvertently shared with others. What are the ways the remaining configuration can be added to Terraform so it can initialize and communicate with the backend? (select three)

Question24: You write a new Terraform configuration and immediately run terraform apply in the CLI using the local backend.
Why will the apply fail?

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

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

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

Question28: Eric needs to make use of module within his terraform code. Should the module always be public and
open-source to be able to be used?

Question29: Refer to the below code where developer is outputting the value of the database password but has used
sensitive parameter to hide the output value in the CLI.
output "db_password" { value = aws_db_instance.db.password description = "The password for logging in to
the database." sensitive = true}
Since sensitive is set to true, the value associated with db password will not be present in state file as
plain-text?

Question30: terraform validate validates the syntax of Terraform files.

Question31: What does terraform import allow you to do?

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

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

Question34: You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script.
Which of the following commands would you use first?

Question35: When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?

Question36: You have created two workspaces PROD and DEV. You have switched to DEV and provisioned DEV infrastructure from this workspace. Where is your state file stored?

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

Question38: You have written a terraform IaC script which was working till yesterday , but is giving some vague error from today , which you are unable to understand . You want more detailed logs that could potentially help you troubleshoot the issue , and understand the root cause. What can you do to enable this setting? Please note , you are using terraform OSS.

Question39: What does the default "local" Terraform backend store?

Question40: What type of block is used to construct a collection of nested configuration blocks?

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

Question42: Your configuration file has been locked accidentally. What of the following command would you use to
unlock?

Question43: While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax can Terraform are expressed in?

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

Question45: Which of the following is not true of Terraform providers?

Question46: You've used Terraform to deploy a virtual machine and a database. You want to replace this virtual machine
instance with an identical one without affecting the database. What is the best way to achieve this using
Terraform?

Question47: Which of the following connection types are supported by the remote-exec provisioner? (select two)

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

Question49: Terraform providers are always installed from the Internet.

Question50: Given the Terraform configuration below, in which order will the resources be created?

Question51: Which of the following are string functions? Select three

Question52: What allows you to conveniently switch between multiple instances of a single configuration within its single
backend?

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

Question54: Which of the following is the correct way to pass the value in the variable num_servers into a module with the
input servers?

Question55: Which of the following connection types are supported by the remote-exec provisioner? (select two)

Question56: Why should secrets not be hard coded into Terraform code? Choose two correct answers

Question57: What is the purpose of using the local-exec provisioner? (Select Two)

Question58: 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

Question59: What is the workflow for deploying new infrastructure with Terraform?

Question60: How would you reference the "name" value of the second instance of this fictitious resource?

Question61: You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)

Question62: FILL BLANK
You need to specify a dependency manually.
What resource meta-parameter can you use to make sure Terraform respects the dependency?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct
answer are accepted.

Question63: The canonical format may change in minor ways between Terraform versions, so after upgrading Terraform it
is recommended to proactively run.

Question64: Terraform variables and outputs that set the "description" argument will store that description in the state file.

Question65: Terraform variables and outputs that set the "description" argument will store that description in the state file.

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

Question67: The terraform.tfstate file always matches your currently built infrastructure.

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

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

Question70: 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.)

Question71: If a Terraform creation-time provisioner fails, what will occur by default?

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

Question73: Which statement describes a goal of infrastructure as code?

Question74: What is the default backend for Terraform?

Question75: Terraform will sync all resources in state by default for every plan and apply, hence for larger infrastructures
this can slow down terraform plan and terraform apply commands?

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

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

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

Question79: You should store secret data in the same version control repository as your Terraform configuration.

Question80: Module variable assignments are inherited from the parent module and do not need to be explicitly set.

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

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

Question83: When writing Terraform code, HashiCorp recommends that you use how many spaces between each nesting
level?

Question84: Workspaces in Terraform provides similar functionality in the open-source, Terraform Cloud, and Enterprise
versions of Terraform.

Question85: A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state file.

Question86: You have configured an Auto Scaling group in AWS to automatically scale the number of instances behind a load balancer based on the instances CPU utilization. The instances are configured using a Launch Configuration. You have observed that the Auto Scaling group doesn't successfully scale when you apply changes that require replacing the Launch Configuration. Why is this happening?

Question87: Terraform can run on Windows or Linux, but it requires a Server version of the Windows operating system.

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

Question89: Most Terraform providers interact with ____________.

Question90: The Terraform language does not support user-defined functions, and so only the functions built in to the language are available for use.

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

Question92: Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.

Question93: What is the default backend for Terraform?

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

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

Question96: terraform validate validates the syntax of Terraform files.

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

Question98: Which of the following Terraform files should be ignored by Git when committing code to a repo? (select
Three)

Question99: Which of the following is allowed as a Terraform variable name?

Question100: How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?

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

Question102: Which of the following is considered a Terraform plugin?

Question103: Terraform provisioners that require authentication can use the ______ block.

Question104: If a Terraform creation-time provisioner fails, what will occur by default?

Question105: In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?

Question106: terraform refresh command will not modify infrastructure, but does modify the state file.

Question107: Which of the below backends support state locking?

Question108: If a DevOps team adopts AWS Cloud Formation as their standardized method for provisioning public cloud resources, which of the following scenarios poses a challenge for this team?

Question109: What features stops multiple admins from changing the Terraform state at the same time?

Question110: When using Terraform in a team it is important for everyone to be working with the same state so that
operations will be applied to the same remote objects. Which of the below option is a recommended solution
for this?

Question111: 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

Question112: Which of the following is not a benefit of adopting infrastructure as code?

Question113: In order to reduce the time it takes to provision resources, Terraform uses parallelism. By default, how many
resources will Terraform provision concurrently?

Question114: What command does Terraform require the first time you run it within a configuration directory?

Question115: Which of the following type of variable allows multiple values of several distinct types to be grouped together as a single value?

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

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

Question118: You need to deploy resources into two different cloud regions in the same Terraform configuration. To do that, you declare multiple provider configurations as follows:

What meta-argument do you need to configure in a resource block to deploy the resource to the "us-west-2" AWS region?

Question119: Which command lets you experiment with Terraform's built-in functions?

Question120: All Terraform Cloud tiers support team management and governance.

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

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

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

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

Question125: Your manager has instructed you to start using terraform for your day-to-day operations, but your security
team is concerned about the terraform state files. They have heard it contains confidential information, and are
worried that it will not be securely protected. What should be your response to the security team in this regard?

Question126: What features does the hosted service Terraform Cloud provide? (Choose two.)

Question127: Your firm employs a version control system (for example, git) and has requested that you commit all terraform
code to it. During the commit, you must be cautious with sensitive information. Which of the following files
should be left out of the commit?

Question128: What is a key benefit of the Terraform state file?

Question129: Running terraform fmt without any flags in a directory with Terraform configuration files will check the formatting of those files without changing their contents.

Question130: When configuring a remote backend in Terraform, it might be a good idea to purposely omit some of the required arguments to ensure secrets and other important data aren't inadvertently shared with others. What are the ways the remaining configuration can be added to Terraform so it can initialize and communicate with the backend? (select three)

Question131: Your team uses terraform OSS . You have created a number of resuable modules for important , independent
network components that you want to share with your team to enhance consistency . What is the correct
option/way to do that?

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

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

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

Question135: Which of the below terraform commands do not run terraform refresh implicitly before taking actual action of the command?

Question136: What information does the public Terraform Module Registry automatically expose about published modules?

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

Question138: What is the purpose of using the local-exec provisioner? (Select Two)

Question139: You want to get involved in the development of Terraform. As this is an open source project, you would like to contribute a fix for an open issue of Terraform. What programming language will need to use to write the fix?

Question140: Which of the following statements about local modules is incorrect:

Question141: Terraform can import modules from a number of sources - which of the following is not a valid source?

Question142: Command terraform refresh will update state file?

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

Question144: You have to initialize a Terraform backend before it can be configured.

Question145: You have been working in a Cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that is listening on port 80. After some application changes, you updated the Terraform code to change the port to 443.
You run terraform plan and see that the execution plan shows the port changing from 80 to 443 like you intended, and step away to grab some coffee.
In the meantime, another team member manually changes the load balancer port to 443 through the Cloud provider console before you get back to your desk.
What will happen when you terraform apply upon returning to your desk?

Question146: Your manager has instructed you to start using terraform for your day-to-day operations, but your security team is concerned about the terraform state files. They have heard it contains confidential information, and are worried that it will not be securely protected. What should be your response to the security team in this regard?

Question147: Every region in AWS has a different AMI ID for Linux and these are keep on changing. What is the best approach to create the EC2 instances that can deal with different AMI IDs based on regions?

Question148: Which task does teraform ini- not perform?

Question149: You have created an AWS EC2 instance of type t2.micro through your terraform configuration file ec2.tf .
Now you want to change the instance type from t2.micro to t2.medium. Accordingly you have changed your configuration file and and ran terraform plan. After running terraform plan you check the output and saw one instance will be updated from t2.micro --> t2.medium. After this you went to grab a coffee without running terraform apply and meanwhile a member of your team changed the instance type of that EC2 instance to t2.medium from aws console. After coming to your desk you run terraform apply. What will happen?

Question150: You have configured an Auto Scaling group in AWS to automatically scale the number of instances behind a load balancer based on the instances CPU utilization. The instances are configured using a Launch Configuration. You have observed that the Auto Scaling group doesn't successfully scale when you apply changes that require replacing the Launch Configuration. Why is this happening?

Question151: A Terraform output that sets the ''sensitive'' argument to true will not store that value in the state file.

Question152: Why would you use the terraform taint command?

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

Question154: While Terraform is generally written using the HashiCorp Configuration Language (HCL), what other syntax
can Terraform are expressed in?

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

Question156: Suppose terraformcode is taking up some values which are not defined inside the code files. In which of the
following options issue might have occurred?

Question157: What does the command terraform fmt do?

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

Question159: 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.)

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

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

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

Question163: When does Sentinel enforce policy logic during a Terraform Enterprise run?

Question164: What does terraform refresh command do?

Question165: A Terraform provisioner must be nested inside a resource configuration block.

Question166: You would like to reuse the same Terraform configuration for your development and production environments with a different state file for each.
Which command would you use?

Question167: What happens when a terraform apply command is executed?

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

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

Question170: You have a Terraform configuration that defines a single virtual machine with no references to it. You have
run terraform apply to create the resource, and then removed the resource definition from your Terraform
configuration file.
What will happen when you run terraform apply in the working directory again?

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

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

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

Question174: terraform validate validate validates that your infrastructure matches the Terraform state file.

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

Question176: Terraform can import modules from a number of sources - which of the following is not a valid source?

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

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

Question179: Jim has created several AWS resources from a single terraform configuration file. Someone from his team has manually modified one of the EC2 instance.
Now to discard the manual change, Jim wants to destroy and recreate the EC2 instance. What is the best way to do it?

Question180: terraform validate reports HCL syntax errors.

Question181: How does Terraform handle working with so many providers?

Question182: True or False? terraform init cannot automatically download Community providers.

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

Question184: Taint the resource "aws_instance" "baz" resource that lives in module bar which lives in module foo.

Question185: Which of the following is not a valid Terraform collection type?

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

Question187: Consider the following Terraform 0.12 configuration snippet:
1. variable "vpc_cidrs" {
2. type = map
3. default = {
4. us-east-1 = "10.0.0.0/16"
5. us-east-2 = "10.1.0.0/16"
6. us-west-1 = "10.2.0.0/16"
7. us-west-2 = "10.3.0.0/16"
8. }
9. }
10.
11. resource "aws_vpc" "shared" {
12. cidr_block = _____________
13. }
How would you define the cidr_block for us-east-1 in the aws_vpc resource using a variable?

Question188: What does the command terraform fmt do?

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

Question190: Why would you use the terraform taint command?

Question191: You want to get involved in the development of Terraform. As this is an open source project, you would like to contribute a fix for an open issue of Terraform. What programming language will need to use to write the fix?

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

Question193: What does terraform refresh modify?

Question194: In terraform, most resource dependencies are handled automatically. Which of the following statements describes best how terraform resource dependencies are handled?

Question195: Terraform requires the Go runtime as a prerequisite for installation.

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

Question197: Terraform will sync all resources in state by default for every plan and apply, hence for larger infrastructures this can slow down terraform plan and terraform apply commands?

Question198: Which of the following connection types are supported by the remote-exec provisioner? (select two)

Question199: When does Sentinel enforce policy logic during a Terraform Enterprise run?

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

Question201: In contrast to Terraform Open Source, when working with Terraform Enterprise and Cloud Workspaces,
conceptually you could think about them as completely separate working directories.

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

Question203: A fellow developer on your team is asking for some help in refactoring their Terraform code. As part of their application's architecture, they are going to tear down an existing deployment managed by Terraform and deploy new. However, there is a server resource named aws_instance.ubuntu[1] they would like to keep to perform some additional analysis.
What command should be used to tell Terraform to no longer manage the resource?

Question204: In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.

Question205: You have created 2 workspaces PROD and RQA.
You have switched to RQA and provisioned RQA infrastructure from this workspace. Where is your state file stored?

Question206: What is not processed when running a terraform refresh?

Question207: After executing a terraform apply, you notice that a resource has a tilde (~) next to it. What does this infer?

Question208: You have recently started a new job at a retailer as an engineer. As part of this new role, you have been tasked with evaluating multiple outages that occurred during peak shopping time during the holiday season.
Your investigation found that the team is manually deploying new compute instances and configuring each compute instance manually. This has led to inconsistent configuration between each compute instance.
How would you solve this using infrastructure as code?

Question209: Which task does teraform init not perform?

Question210: State is a requirement for Terraform to function

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

Question212: What type of block is used to construct a collection of nested configuration blocks?

Question213: You can reference a resource created with for_each using a Splat (*) expression.

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

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

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

Question217: Where does the Terraform local backend store its state?

Question218: 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. }

Question219: What is the workflow for deploying new infrastructure with Terraform?

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

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

Question222: Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to begin storing the state file in a central location.
Which of the following backends would not work?

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

Question224: By default, where does Terraform store its state file?

Question225: 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

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

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

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

Question229: You have a Terraform configuration file where a variable itemNum is defined as follows:
variable "itemNum" { default = 3}
You also have a defined the following environment variables in your shell: TF_itemNum =6, TF_VAR_itemNum =9. You also have a terraform.tfvars file with the following contents itemNum = 7 When you run the following apply command, what is the value assigned to the itemNum variable?
terraform apply -var itemNum =4

Question230: HashiCorp Configuration Language (HCL) supports user-defined functions.

Question231: Which of the following is not an advantage of using infrastructure as code operations?

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

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

Question234: When should you use the force-unlock command?

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

Question236: If writing Terraform code that adheres to the Terraform style conventions, how would you properly indent
each nesting level compared to the one above it?

Question237: Module version is required to reference a module on the Terraform Module Registry.

Question238: Terraform is currently being used by your organisation to create resources on AWS for the development of a
web application. One of your coworkers wants to change the instance type to "t2.large" while keeping the
default set values.
What adjustments does the teammate make in order to meet his goal?

Question239: You have deployed a new webapp with a public IP address on a clod provider. However, you did not create
any outputs for your code.
What is the best method to quickly find the IP address of the resource you deployed?

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

Question241: If writing Terraform code that adheres to the Terraform style conventions, how would you properly indent each nesting level compared to the one above it?

Question242: Examine the following Terraform configuration, which uses the data source for an AWS AMI.
What value should you enter for the ami argument in the AWS instance resource?

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

Question244: When configuring a remote backend in Terraform, it might be a good idea to purposely omit some of the required arguments to ensure secrets and other important data aren't inadvertently shared with others. What are the ways the remaining configuration can be added to Terraform so it can initialize and communicate with the backend? (select three)

Question245: Choose the best option from below to make Terraform code more user configuration-centric.

Question246: Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?

Question247: Why might a user opt to include the following snippet in their configuration file?

Question248: In the below configuration, how would you reference the module output vpc_id ?

Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

Question249: You're building a CI/CD (continuous integration/ continuous delivery) pipeline and need to inject sensitive
variables into your Terraform run.
How can you do this safely?