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 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?
How would you output returned values from a child module in the Terraform CLI output?
How would you reference the volume IDs associated with the ebs_block_device blocks in this configuration?
It is best practice to store secret data in the same version control repository as your Terraform configuration.
The Terraform binary version and provider versions must match each other in a single configuration.
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?
Your security team scanned some Terraform workspaces and found secrets stored in plaintext in state files. How can you protect that data?
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?
You must use different Terraform commands depending on the cloud provider you use.
You are writing a child Terraform module that provisions an AWS instance. You want to reference the IP address returned by the child module in the root configuration. You name the instance resource "main'.
Which of these is the correct way to define the output value?
A)
B)
C)
D)
What information does the public Terraform Module Registry automatically expose about published modules?
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?
How does the Terraform cloud integration differ from other state backends such as S3, Consul,etc?
Infrastructure as Code (laC) can be stored in a version control system along with application code.
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)
If you update the version constraint in your Terraform configuration, Terraform will update your lock file the next time you run terraform Init.
You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.
Now you realize that you do not actually need the load balancer, so you run terraform destroy without any flags. What will happen?
You have declared a variable called var.list which is a list of objects that all have an attribute id . Which options will produce a list of the IDs? Choose two correct answers.
Running terraform fmt without any flags in a directory with Terraform configuration files check the formatting of those files without changing their contents.
In Terraform HCL, an object type of object({name=string, age-number}) would match this value.
A)
B)
C)
D)
terraform validate confirms that your infrastructure matches the Terraform state file.
Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into stdout.
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?
Which two steps are required to provision new infrastructure in the Terraform workflow? Choose two correct answers.