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?
A. Nothing B. Terraform will destroy the virtual machine C. Terraform will error D. Terraform will remove the virtual machine from the state file, but the resource will still exist
B. Terraform will destroy the virtual machine
Explanation
If you remove the resource from your config file and the resource is in your state file, terraform will apply the configuration in the config file-which is to delete the resource
Question 92:
It is best practice to store secret data in the same version control repository as your Terraform configuration.
A. True B. False
B. False
Explanation
It is not a best practice to store secret data in the same version control repository as your Terraform configuration, as it could expose your sensitive information to unauthorized parties or compromise your security. You should use environment variables, vaults, or other mechanisms to store and provide secret data to Terraform.
Question 93:
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?
A. Terraform automatically formats configuration on terraform apply B. Run terraform validate prior to executing terraform plan or terraform apply C. Use terraform fmt D. Replace all tabs with spaces
C. Use terraform fmt
Explanation
The terraform fmt command is used to format Terraform configuration files to a canonical format and style. This ensures that all team members are using a consistent style, making the code easier to read and maintain. It automatically applies
Terraform's standard formatting conventions to your configuration files, helping maintain consistency across the team's codebase.
References:
Terraform documentation on terraform fmt: Terraform Fmt
Question 94:
How does Terraform manage most dependencies between resources?
A. Terraform will automatically manage most resource dependencies B. Using the depends_on parameter C. By defining dependencies as modules and including them in a particular order D. The order that resources appear in Terraform configuration indicates dependencies
A. Terraform will automatically manage most resource dependencies
Explanation
This is how Terraform manages most dependencies between resources, by using the references between them in the configuration files. For example, if resource A depends on resource B, Terraform will create resource B first and then pass its attributes to resource A.
Question 95:
You have already set TF_LOG = DEBUG to enable debug log. Now you want to always write the log to the directory you're currently running terraform from. what should you do to achieve this.
A. Run the command export TF_LOG_FILE=./terraform.log. B. Run the command export TF_LOG_PATH=./terraform.log. C. Run the command export TF_DEBUG_PATH=./terraform.log. D. No explicit action required. Terraform will take care of this as you have enable TF_LOG.
B. Run the command export TF_LOG_PATH=./terraform.log.
Which of the following is not a valid string function in Terraform?
A. split B. join C. slice D. chomp
C. slice
Explanation
https://www.terraform.io/language/functions
Question 97:
Do terraform workspaces help in adding/allowing multiple state files for a single configuration?
A. True B. False
A. True
Explanation
Question 98:
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?
A. terraform apply rm aws_instance.ubuntu[1] B. terraform state rm aws_instance.ubuntu[1] C. terraform plan rm aws_instance.ubuntu[1] D. terraform delete aws_instance.ubuntu[1]
B. terraform state rm aws_instance.ubuntu[1]
Explanation
"You can use terraform state rm in the less common situation where you wish to remove a binding to an existing remote object without first destroying it, which will effectively make Terraform "forget" the object while it continues to exist in the remote system."
https://www.terraform.io/cli/commands/state/rm
Question 99:
True or False? Each Terraform workspace uses its own state file to manage the infrastructure associated with that particular workspace.
A. False B. True
B. True
Explanation
The persistent data stored in the backend belongs to a workspace. Initially, the backend has only one workspace, called "default", and thus there is only one Terraform state associated with that configuration.
Question 100:
If a DevOps team adopts AWS Cloud Formation as their standardized method for provisioning public cloud resoruces, which of the following scenarios poses a challenge for this team?
A. The team is asked to manage a new application stack built on AWS-native services B. The organization decides to expand into Azure wishes to deploy new infrastructure C. The team is asked to build a reusable code based that can deploy resources into any AWS region D. The DevOps team is tasked with automating a manual, web console-based provisioning.
B. The organization decides to expand into Azure wishes to deploy new infrastructure
Explanation
This is the scenario that poses a challenge for this team, if they adopt AWS CloudFormation as their standardized method for provisioning public cloud resources, as CloudFormation only supports AWS services and resources, and cannot be used to provision infrastructure on other cloud platforms such as Azure.
Nowadays, the certification exams become more and more important and required by more and more
enterprises when applying for a job. But how to prepare for the exam effectively? How to prepare
for the exam in a short time with less efforts? How to get a ideal result and how to find the
most reliable resources? Here on Vcedump.com, you will find all the answers.
Vcedump.com provide not only HashiCorp exam questions,
answers and explanations but also complete assistance on your exam preparation and certification
application. If you are confused on your TERRAFORM-ASSOCIATE-003 exam preparations
and HashiCorp certification application, do not hesitate to visit our
Vcedump.com to find your solutions here.