When should you run terraform init?
Which of the following is not a way to trigger terraform destroy?
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?
What feature stops multiple users from operating on the Terraform state at the same time?
Which of these is true about Terraform's plugin-based architecture?
Which of the following should you add in the required_providers block to define a provider version constraint?
Which command must you first run before performing further Terraform operations in a working directory?
In a Terraform Cloud workpace linked to a version control repository speculative plan rum start automatically commit changes to version control.
Which of the following isnotan advantage of using Infrastructure as Code (IaC) operations?
When does Terraform create the .terraform.lock.hc1 file?
Which parameters does terraform import require? Choose two correct answers.
Which task does terraform init not perform?
Which configuration consistency errors does terraform validate report?
When you include a module block in your configuration that references a module from the Terraform Registry, the "version" attribute is required.
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
terraform validate confirms thesyntaxof Terraform files.
Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
Which of the following is not a valid string function in Terraform?
You have just developed a new Terraform configuration for two virtual machines with a cloud provider. You would like to create the infrastructure for the first time.
Which Terraform command should you runfirst?
Which of these are benefits of using Sentinel with HCP Terraform/Terraform Cloud? (Pick the 3 correct responses)
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)
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
You have used Terraform lo create an ephemeral development environment in the (loud 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 Terraform will delete.
Which command should you use to show all of the resources that mil be deleted? Choose two correct answers.
How is terraform import run?
Changing the Terraform backend from the default "local" backend to a different one after performing your first terrafom apply is:
The Terraform binary version and provider versions must match each other in a single configuration.
You decide to move a Terraform state file to Amazon S3 from another location. You write the code below into a file called backend.tf.
Which command will migrate your current state file to the new S3 remote backend?
Which of these statements about Terraform Cloud workspaces is false?
What is the name of the default file where Terraform stores the state?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.
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 correct answers.
You 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 Terraform will delete.
Which command should you use to show all the resources that will be deleted? (Pick the 2 correct responses)
terraform validate reports syntax check errors for which of the following?
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?
You want to use API tokens and other secrets within your team's Terraform workspaces. Where does HashiCorp recommend you store these sensitive values? (Pick the 3 correct responses)
What is a Terraform provider not responsible for?
What does this code do?
terraform { required_providers { aws = ">= 3.0" }}
Select the command that doesn’t cause Terraform to refresh its state.
What is the provider for the resource shown in the Exhibit?
resource "aws_vpc" "main" {
name = "test"
}
One remote backend configuration always maps to a single remote workspace.
Where can Terraform not load a provider from?
Variables declared within a module are accessible outside of the module.
When do changes invoked by terraform apply take effect?
By default, if you do not define a backend for your configuration, where does Terraform store information about the resources that it manages?
All modules published on the official Terraform Module Registry have been verified by HasihCorp.
Which of the following command would be use to access all of the attributes and details of a resource managed by Terraform?
Which command should you run to check if all code in a Terraform configuration that references multiple modules is properly formatted without making changes?
Why does this backend configuration not follow best practices?
Which of these are features of HCP Terraform/Terraform Cloud? (Pick the 2 correct responses)
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 two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.
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"
}
Why would you use the -replace flag for terraform apply?
You can configure Terraform to log to a file using the TF_LOG environment variable.
You add a new provider to your configuration and immediately run terraform apply in the CD using the local backend. Why does the apply fail?
What command can you run to generateDOT (Graphviz)formatted data to visualize Terraform dependencies?
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?
Outside of the required_providers block, Terraform configurations always refer to providers by their local names.
Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.
You have multiple team members collaborating on infrastructure as code (IaC) using Terraform, and want to apply formatting standards for readability.
How can you format Terraform HCL (HashiCorp Configuration Language) code according to standard Terraform style convention?
Which of these ate secure options for storing secrets for connecting to a Terraform remote backend? Choose two correct answers.
What is one disadvantage of using dynamic blocks in Terraform?
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?
Which Terraform command checks that your configuration syntax is correct?
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?
Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.
Terraform encrypts sensitive values stored in your state file.
Which of the following does terraform apply change after you approve the execution plan? (Choose two.)
Which of these actions are forbidden when the Terraform state file is locked? (Pick the 3 correct responses)
Before you can use a remote backend, you must first execute terra-form init.
Which of the following is not a key principle of infrastructure as code?
It is best practice to store secret data in the same version control repository as your Terraform configuration.