Free Terraform Associate Exam Braindumps (page: 33)

Page 32 of 113

Terraform has detailed logs which can be enabled by setting the environmental variable.

  1. TF_TRACE
  2. TF_DEBUG
  3. TF_LOG
  4. TF_INFO

Answer(s): C

Explanation:

Terraform has detailed logs that can be enabled by setting the TF_LOG environment variable to any value. This will cause detailed logs to appear on stderr.
You can set TF_LOG to one of the log levels TRACE, DEBUG, INFO, WARN or ERROR to change the verbosity of the logs. TRACE is the most verbose and it is the default if TF_LOG is set to something other than a log level name.


Reference:

https://www.terraform.io/docs/internals/debugging.html



Which of the following best describes a Terraform provider?

  1. A plugin that Terraform uses to translate the API interactions with the service or provider.
  2. Serves as a parameter for a Terraform module that allows a module to be customized.
  3. Describes an infrastructure object, such as a virtual network, compute instance, or other components.
  4. A container for multiple resources that are used together.

Answer(s): A

Explanation:

A provider is responsible for understanding API interactions and exposing resources. Providers generally are an IaaS (e.g. Alibaba Cloud, AWS, GCP, Microsoft Azure, OpenStack), PaaS (e.g. Heroku), or SaaS services (e.g. Terraform Cloud, DNSimple, Cloudflare). https://www.terraform.io/docs/providers/index.html



Which one of the following will run echo 0 and echo 1 on a newly created host?

  1. provisioner "local-exec" { command = "echo 0"
    command = "echo 1"
    }
  2. provisioner "remote-exec" {
    inline = [
    echo 0,
    echo 1
    ]
    }
  3. provisioner "remote-exec" {
    command = "${echo 0}"
    command = "${echo 1}"
    }
  4. provisioner "remote-exec" {
    inline = [
    "echo 0",
    "echo 1"
    ]
    }

Answer(s): D

Explanation:

remote-exec Provisioner Example usage
resource "aws_instance" "web" { # ...
provisioner "remote-exec" { inline = [
"puppet apply",
"consul join ${aws_instance.web.private_ip}",
]
}
}



How can you ensure that the engineering team who has access to git repo will not create any non- compliant resources that might lead to a security audit failure in future. your team is using Hashicorp Terraform Enterprise Edition.

  1. Use Terraform OSS Sentinel Lite version , which will save cost , since there is no charge for OSS , but it can still check for most non-compliant rules using Policy-As-Code.
  2. Implement a review process where every code will be reviewed before merging to the master branch.
  3. Since your team is using Hashicorp Terraform Enterprise Edition , enable Sentinel , and write Policy-As-Code rules that will check for non-compliant resource provisioning , and prevent/report them.
  4. Create a design /security document (in PDF) and share to the team , and ask them to always follow that document , and never deviate from it.

Answer(s): C


Reference:

https://www.terraform.io/docs/cloud/sentinel/index.html






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

Terraform Associate Discussions & Posts