Free Terraform Associate Exam Braindumps (page: 61)

Page 61 of 113

You wanted to destroy some of the dependent resources from real infrastructure. You choose to delete those resources from your configuration file and run terraform plan and then apply. Which of the following way your resources would be destroyed?

  1. Terraform can still determine the correct order for destruction from the state even when you delete one or more items from the configuration.
  2. Those would be destroyed in the order in which they were written in the configuration file previously before you have deleted them from configuration file.
  3. The resource will be destructed in random order as you have already deleted them from configuration.
  4. You can not destroy resources by deleting them from configuration file and running plan and apply.

Answer(s): A

Explanation:

Terraform typically uses the configuration to determine dependency order. However, when you delete a resource from a Terraform configuration, Terraform must know how to delete that resource. Terraform can see that a mapping exists for a resource not in your configuration and plan to destroy. However, since the configuration no longer exists, the order cannot be determined from the configuration alone.
To ensure correct operation, Terraform retains a copy of the most recent set of dependencies within the state. Now Terraform can still determine the correct order for destruction from the state when you delete one or more items from the configuration.



Your developers are facing a lot of problem while writing complex expressions involving difficult interpolations . They have to run the terraform plan every time and check whether there are errors , and also check terraform apply to print the value as a temporary output for debugging purposes.
What should be done to avoid this?

  1. Use terraform console command to have an interactive UI with full access to the underlying terraform state to run your interpolations , and debug at real-time.
  2. Add a breakpoint in your code, using the watch keyword , and output the value to console for temporary debugging.
  3. Use terraform zipmap function , it will be able to easily do the interpolations without complex code.
  4. Use terraform console command to have an interactive UI , but you can only use it with local state
    , and it does not work with remote state.

Answer(s): A

Explanation:

The terraform console command provides an interactive console for evaluating expressions. This is useful for testing interpolations before using them in configurations, and for interacting with any values currently saved in state.


Reference:

https://www.terraform.io/docs/commands/console.html



When writing Terraform code, HashiCorp recommends that you use how many spaces between each nesting level?

  1. 0
  2. 1
  3. 2
  4. 4

Answer(s): C

Explanation:

The Terraform parser allows you some flexibility in how you lay out the elements in your configuration files, but the Terraform language also has some idiomatic style conventions which we recommend users always follow for consistency between files and modules written by different teams. Automatic source code formatting tools may apply these conventions automatically.
Indent two spaces for each nesting level.
When multiple arguments with single-line values appear on consecutive lines at the same nesting level, align their equals signs:
ami = "abc123" instance_type = "t2.micro"
When both arguments and blocks appear together inside a block body, place all of the arguments together at the top and then place nested blocks below them. Use one blank line to separate the arguments from the blocks.
Use empty lines to separate logical groups of arguments within a block.
For blocks that contain both arguments and "meta-arguments" (as defined by the Terraform language semantics), list meta-arguments first and separate them from other arguments with one blank line. Place meta-argument blocks last and separate them from other blocks with one blank line.
resource "aws_instance" "example" { count = 2 # meta-argument first ami = "abc123" instance_type = "t2.micro" network_interface {
# ...
}
lifecycle { # meta-argument block last create_before_destroy = true
}
}
Top-level blocks should always be separated from one another by one blank line. Nested blocks should also be separated by blank lines, except when grouping together related blocks of the same type (like multiple provisioner blocks in a resource).
Avoid separating multiple blocks of the same type with other blocks of a different type, unless the block types are defined by semantics to form a family. (For example: root_block_device, ebs_block_device and

ephemeral_block_device on aws_instance form a family of block types describing AWS block devices, and can therefore be grouped together and mixed.)



When using parent/child modules to deploy infrastructure, how would you export a value from one module to import into another module.
For example, a module dynamically deploys an application instance or virtual machine, and you need the IP address in another module to configure a related DNS record in order to reach the newly deployed application.

  1. Export the value using terraform export and input the value using terraform input.
  2. Configure the pertinent provider's configuration with a list of possible IP addresses to use.
  3. Configure an output value in the application module in order to use that value for the DNS module.
  4. Preconfigure the IP address as a parameter in the DNS module.

Answer(s): C

Explanation:

Output values are like the return values of a Terraform module, and have several uses:
* A child module can use outputs to expose a subset of its resource attributes to a parent module.
* A root module can use outputs to print certain values in the CLI output after running terraform apply.
* When using remote state, root module outputs can be accessed by other configurations via a terraform_remote_state data source.


Reference:

https://www.terraform.io/docs/configuration/outputs.html



Page 61 of 113



Post your Comments and Discuss HashiCorp Terraform Associate exam with other Community members:

Bin Mahamood commented on November 03, 2024
terraform { required_providers { aws = { version = ">= 2.7.0" source = "hashicorp/aws" } } }
Anonymous
upvote

Nayaran commented on October 21, 2024
First and for most... this exam is extremely hard. Second this exam dump contains majority of the questions. I passed the certification exam.
UNITED STATES
upvote

Marc commented on October 21, 2024
hello would need help
UNITED STATES
upvote

Marcellus Werifah commented on October 20, 2024
Verified answers
UNITED STATES
upvote

Nathan commented on October 20, 2024
Using dumps are my last resort. And that is what I ended up using with this exam to pass. The exam is extremely difficult.
France
upvote

Marcellus Werifah commented on October 20, 2024
Who decides what is the correct in case of conflicts
UNITED STATES
upvote

Marcellus Werifah commented on October 20, 2024
Novice. Would need detailed explanation of any questions
UNITED STATES
upvote

Siva commented on June 17, 2024
It's a good platform to start preparing for the HCTA 003 exam
Anonymous
upvote

Dhiraj Bhattad commented on June 14, 2024
It's a good platform to start preparing for the HCTA 003 exam.
Anonymous
upvote

Amizhchandra commented on May 12, 2024
Good material
CHINA
upvote

Direen commented on February 16, 2024
This was a easy passsss! Scored 95%. Unbelievable! I was hesitant at first but then I saw the pass guarantee policy so I said what the hell. If I fa I will get my money back. I am glad I bought it. Saved me so much time.
United States
upvote

Satya commented on February 09, 2024
Q83:--Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument. Answer is "False"
UNITED STATES
upvote

Satya commented on February 09, 2024
Q76:---Which of these options is the most secure place to store secrets foe connecting to a Terraform remote backend? Shouldn't the answer be "Defined in a connection configuration outside of Terraform"
UNITED STATES
upvote

Satya commented on February 09, 2024
Q39:---Which argument(s) is (are) required when declaring a Terraform variable? Answer should be "None of the above" as Nothing is required while declaring variable
UNITED STATES
upvote

DN commented on September 04, 2023
question 14 - run terraform import: this is the recommended best practice for bringing manually created or destroyed resources under terraform management. you use terraform import to associate an existing resource with a terraform resource configuration. this ensures that terraform is aware of the resource, and you can subsequently manage it with terraform.
Anonymous
upvote

YK commented on December 11, 2023
good one nice
JAPAN
upvote

Mn8300 commented on November 09, 2023
nice questions
Anonymous
upvote

Naka commented on January 19, 2024
Very good, many questions same as the real exam
BRAZIL
upvote

vasu commented on December 22, 2023
good for practice
INDIA
upvote

MDN commented on December 11, 2023
Good sample questions
UNITED STATES
upvote

YK commented on December 11, 2023
Good one nice
JAPAN
upvote

YK 11 commented on December 09, 2023
Good one nice
JAPAN
upvote

Mn8300 commented on November 13, 2023
Very useful
Anonymous
upvote

Mn8300 commented on November 09, 2023
Nice questions
Anonymous
upvote

mpakal commented on October 19, 2023
Good and realistic questions.
UNITED STATES
upvote

pakalamb1995@gmail.com commented on October 19, 2023
so far nice
UNITED STATES
upvote

CP commented on October 09, 2023
Let Hope for the Best
EUROPEAN UNION
upvote

DN commented on September 04, 2023
Question 14 - Run terraform import: This is the recommended best practice for bringing manually created or destroyed resources under Terraform management. You use terraform import to associate an existing resource with a Terraform resource configuration. This ensures that Terraform is aware of the resource, and you can subsequently manage it with Terraform.
Anonymous
upvote

sipho commented on August 30, 2023
i will study ans see how it goes
Anonymous
upvote

Jersey boy commented on June 25, 2023
I just paid and download my files. I will report in a week after writing my exam to see how this goes.
UNITED STATES
upvote

Yung K. commented on October 11, 2021
Thank you for this exams dumps package. From the 2 exams I purchased as part of the 50% sale I alredy passed first exam.
TAIWAN
upvote