What type of information can be found on the Terraform Registry when using published modules?
terraform validate confirms that your infrastructure matches the Terraform state file.
Module variable assignments are inherited from the parent module and you do not need to explicitly set them.
What is the provider for this resource?
You want to define a single input variable to capture configuration values for a server. The values must represent memory as a number, and the server name as a string.
Which variable type could you use for this input?
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
Which argument can you use toprevent unexpected updatesto a module's configuration when calling Terraform Registry modules?
A module can always refer to all variables declared in its parent module.
How can terraform plan aid in the development process?
Your root module contains a variable namednum_servers. Which is the correct way to pass its value to a child module with an input namedservers?
How does Terraform determine dependencies between resources?
What information does the public Terraform Module Registry automatically expose about published modules?
Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
Using the terraform state rm command against a resource will destroy it.
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
Which statement describes a goal of Infrastructure as Code (IaC)?
A developer on your team is going lo leaf down an existing deployment managed by Terraform and deploy a new one. However, there is a server resource named aws instant.ubuntu[l] they would like to keep. What command should they use to tell Terraform to stop managing that specific resource?
terraform validate reports syntax check errors for which of the following?
What feature stops multiple users from operating on the Terraform state at the same time?
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?
HashiCorp Configuration Language (HCL) supports user-denned functions.
By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
A module block is shown in the Exhibit space of this page. When you use a module block to reference a module from the Terraform Registry such as the one in the example, how do you specify version 1.0.0 of the module?
Which of the following should you add in the required_providers block to define a provider version constraint?
What is the workflow for deploying new infrastructure with Terraform?
You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains 15 virtual machines (VM). You develop a Terraform configuration containing one VM. perform terraform apply, and see that your VM was created successfully. What should you do to delete the newly-created VM with Terraform?
Terraform installs its providers during which phase?
In a HCP Terraform/Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
You want to define multiple data disks as nested blocks inside the resource block for a virtual machine. What Terraform feature would help you define the blocks using the values in a variable?
How is terraform import run?
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
You just upgraded the version of a provider in an existing Terraform project. What do you need to do to install the new provider?
Which of the following is not a way to trigger terraform destroy?
Where does the Terraform local backend store its state?
A provider configuration block is required in every Terraform configuration.
Example:
You must use different Terraform commands depending on the cloud provider you use.
A Terraform backend determines how Terraform loads state and stores updates when you execute which command?
What is the purpose of the terraform.lock.hcl file in Terraform?
When you run terraform apply, the Terraform CLI will print output values from both the root module and any child modules.
Which of the following locations can Terraform use as aprivate sourcefor modules?(Pick 2 correct responses)
Terraform encrypts sensitive values stored in your state file.
What type of block is used to construct a collection of nested configuration blocks?
What is a key benefit of the Terraform state file?
What is the Terraform style convention for indenting a nesting level compared to the one above it?
Which of the following is not a key principle of infrastructure as code?
terraform apply is failing with the following error. What next step should you take to determine the root cause of the problem?
Error:
yaml
CopyEdit
Error loading state: AccessDenied: Access Denied
status code: 403, request id: 288766CE5CCA24A0, host id: web.example.com
Variables declared within a module are accessible outside of the module.
You modified your Terraform configuration to fix a typo in the resource ID by renaming it from photoes to photos. What configuration will you add to update the resource ID in state without destroying the existing resource?
Original configuration:
resource "aws_s3_bucket" "photoes" {
bucket_prefix = "images"
}
Updated configuration:
resource "aws_s3_bucket" "photos" {
bucket_prefix = "images"
}
Which method for sharing Terraform configurations fulfills the following criteria:
1. Keeps the configurations confidential within your organization
2. Support Terraform’s semantic version constrains
3. Provides a browsable directory
What kind of configuration block will create an infrastructure object with settings specified within the block?
What task does the terraform import command perform?
You modified your Terraform configuration and run Terraform plan to review the changes. Simultaneously, your teammate manually modified the infrastructure component you are working on. Since you already ran terraform plan locally, the execution plan for terraform apply will be the same.
You ate creating a Terraform configuration which needs to make use of multiple providers, one for AWS and one for Datadog. Which of the following provider blocks would allow you to do this?
A)
B)
C)
D)
Which of the following should you put into the required_providers block?
Which of the following is not a valid Terraform collection type?
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
You are working on some new application features and you want to spin up a copy of your production deployment to perform some quick tests. In order to avoid having to configure a new state backend, what open source Terraform feature would allow you create multiple states but still be associated with your current code?
You are using a networking module in your Terraform configuration with the name label my-network. In your main configuration you have the following code:
When you run terraform validate, you get the following error:
What must you do to successfully retrieve this value from your networking module?
What does this code do?
terraform { required_providers { aws = ">= 3.0" }}
What does state looking accomplish?
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 you run terraform apply in the working directory again?
How can a ticket-based system slow down infrastructure provisioning and limit the ability to scale? Choose two correct answers.
Which of the following is not a valid Terraform variable type?
How would you output returned values from a child module in the Terraform CLI output?
Your DevOps team is currently using the local backend for your Terraform configuration. You would like to move to a remote backend to store the state file in a central location. Which of the following backends would not work?
Which command doesnotcause Terraform to refresh its state?
You use a cloud provider account that is shared with other team members. You previously used Terraform to create a load balancer that listens on port 80. After 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 run terraform apply upon returning to your desk?
Which of the following ate advantages of using infrastructure as code (laC) instead of provisioning with a graphical user interface (GUI)? Choose two correct answers.
Terraform providers are always installed from the Internet.
You want to know from which paths Terraform is loading providers referenced in your Terraform configuration (* files). You need to enable additional logging messages to find this out. Which of the following would achieve this?