Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Terraform Associate Exam questions with correct answers
Typology: Exams
1 / 8
Terraform stores a cache of the attribute values for all resources in the state. True or False. CORRECT ANSWER True Terraform stores a cache of the attribute values for all resources in the state. This is the most optional feature of Terraform state and is done only as a performance improvement. How do you avoid performance issues due to cloud API limits when building larger infrastructure? a) -refresh=false b) -refreshAPI=false c) -refresh=true d) -refreshAPI=true CORRECT ANSWER a) -refresh=false Many cloud providers do not provide APIs to query multiple resources at once, and the round trip time for each resource is hundreds of milliseconds. On top of this, cloud providers almost always have API rate limiting so Terraform can only request a certain number of resources in a period of time. Larger users of Terraform make heavy use of the -refresh=false flag as well as the -target flag in order to work around this. In these scenarios, the cached state is treated as the record of truth. Use -refresh=false flag as well as the -target flag Which of these are terraform provisioners?
a) file b) local-exec c) remote-exec d) None of these CORRECT ANSWER a b and c The file provisioner is used to copy files or directories from the machine executing Terraform to the newly created resource. The local-exec provisioner invokes a local executable after a resource is created. This invokes a process on the machine running Terraform, not on the resource. The remote-exec provisioner invokes a script on a remote resource after it is created. This can be used to run a configuration management tool, bootstrap into a cluster, etc What will happen if the creation-time provisioner fails? a) The resource will be marked as tainted b) Terraform will skip the provisioner and continue with resource creation c) Terraform will destroy the complete resource in the template d) None of the above CORRECT ANSWER a) The resource will be marked as tainted If a creation-time provisioner fails, the resource is marked as tainted. A tainted resource will be planned for destruction and recreation upon the next terraform apply.
Which of the following are valid logging configurations? a) export TF_LOG_CORE=TRACE
(enable core logging) b) export TF_LOG_PROVIDER=TRACE
(enable provider logging) c) export TF_LOG_PATH=logs.txt
(redirecting logs to specific file logs.txt) CORRECT ANSWER All of them Terraform 0.15 allows you to generate logs from the Terraform provider and the core application separately. The Terraform development team needs the core logs for your attempted operation to troubleshoot core-related errors. To enable core logging, set the TF_LOG_CORE environment variable to the appropriate log level. For bug reports, you should use the TRACE level. $ export TF_LOG_CORE=TRACE TRACE provides the highest level of logging and contains all the information the development teams need. There are other logging levels but are typically reserved for developers looking for specific information. You can also generate provider logs by setting the TF_LOG_PROVIDER environment variable. By including these in your bug reports, the provider development team can reproduce and debug provider-specific errors. Once you have configured your logging, set the path for your error logs as an environment variable. If your TF_LOG_CORE or TF_LOG_PROVIDER environment variables are enabl Which of the below are requirements of publishing a module to Terraform public registry? Select all that apply a) Module must be on GitHub and must be a public repo b) Module repos must use the three part name format of terraform-
c) Module must adhere to the standard module structure to allow the registry to inspect your module and generate documentation and track resource usage d) Modules published initially should have at least one release tag that follows semantic versioni CORRECT ANSWER all of these GitHub. The module must be on GitHub and must be a public repo. This is only a requirement for the public registry. If you're using a private registry, you may ignore this requirement. Named terraform-
Modules are containers for multiple resources that are used together. A module consists of a collection of .tf and/or .tf.json files kept together in a directory. Modules are the main way to package and reuse resource configurations with Terraform. What are the different planning modes available in terraform? a) refresh-only mode b) destroy mode c) creation mode d) provision mode CORRECT ANSWER a and b, refresh and destroy Destroy mode: creates a plan whose goal is to destroy all remote objects that currently exist, leaving an empty Terraform state. This can be useful for situations like transient development environments, where the managed objects cease to be useful once the development task is complete. Activate destroy mode using the -destroy command line option. Refresh-only mode: creates a plan whose goal is only to update the Terraform state and any root module output values to match changes made to remote objects outside of Terraform. This can be useful if you've intentionally changed one or more remote objects outside of the usual workflow (e.g. while responding to an incident) and you now need to reconcile Terraform's records with those changes. Activate refresh-only mode using the -refresh-only command line option. https://www.terraform.io/docs/cli/commands/plan.html How do you disable the state lock during a terraform apply? a) -lock=false
b) -lock=ignore c) -lock=true d) none of the above CORRECT ANSWER a) -lock=false -lock=false - Don't hold a state lock during the operation. This is dangerous if others might concurrently run commands against the same workspace. S3 is what kind of backend? a) enhanced b) standard c) remote d) none of these CORRECT ANSWER b) standard What are the features of terraform cloud business account? Select all that apply a) Team management and governance b) advanced security, compliance, and goverance c) self-service infrastructure d) additional concurrent runs CORRECT ANSWER all of these Which of the following terraform features is NOT available in the terraform cloud free tier? select all that apply a) manage and share infrastructure b) team management and governance
c) sso, audit, private datacenter networking d) support for ServiceNow / configuration designer workflows CORRECT ANSWER b, c, and d Terraform cloud is offered as a multi-tenant SaaS platform and is designed to suit the needs of smaller teams and organizations a) True b) False CORRECT ANSWER a) True Terraform Cloud is offered as a multi-tenant SaaS platform and is designed to suit the needs of smaller teams and organizations. Its smaller plans default to one run at a time, which prevents users from executing multiple runs concurrently. If you have defined a variable value, but not its corresponding variable {} definition, you may get an error or warning depending on how you have provided that value. True or False a) True b) False CORRECT ANSWER a) True Outputs are only rendered when Terraform applies your plan. Running terraform plan will not render outputs. True or False a) True b) False CORRECT ANSWER a) True -parallelism flag can be set on which of the below commands?
a) plan b) apply c) destroy d) all of the above CORRECT ANSWER d) all of the above By default, up to 10 nodes in the graph will be processed concurrently. This number can be set using the -parallelism flag on the plan, apply, and destroy commands.