Multiple team members are collaborating on infrastructure using Terraform and want to format the* Terraform code following standard Terraform-style convention.
How should they ensure the code satisfies conventions?
You have a list of numbers representing the number of free CPU cores on each virtual cluster:
numcpus = [18, 3, 7, 11, 2]
Which Terraform built-in function would you use to select the largest number from the list?
You need to destroy all of the resources in your Terraform workspace, except for aws_instance.ubuntu[1], which you want to keep. How can you tell Terraform to stop managing that specific resource without destroying it?
Exhibit:
provider " aws " { region = " us-east-1 " }
provider " aws " { region = " us-west-2 " }
You need to deploy resources into two different AWS regions in the same Terraform configuration using the provider blocks shown in the exhibit. What do you need to add to the provider configuration to deploy a resource to the us-west-2 AWS region?
A resource block is shown in the Exhibit section of this page. How would you reference the attribute name of this resource in HCL?
Which of the following is not a way to trigger terraform destroy?
Exhibit:
module " web_stack " {
source = " ./modules/web_stack "
}
Your configuration defines the module block shown in the exhibit. The web_stack module accepts an input variable named servers. Which of the following changes to the module block sets the servers variable to the value of 3?
How can you enable verbose logging to troubleshoot Terraform?
Using the terraform state rm command against a resource will destroy it.
Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.