HashiCorp Terraform Associate Exam (page: 10)
HashiCorp Certified: Terraform Associate
Updated on: 25-Dec-2025

Examine the following Terraform configuration, which uses the data source for an AWS AMI.
What value should you enter for the ami argument in the AWS instance resource?

  1. aws_ami.ubuntu
  2. data.aws_ami.ubuntu
  3. data.aws_ami.ubuntu.id
  4. aws_ami.ubuntu.id

Answer(s): C

Explanation:

resource "aws_instance" "web" {
ami = data.aws_ami.ubuntu.id


Reference:

https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/instance



FILL BLANK
You need to specify a dependency manually.
What resource meta-parameter can you use to make sure Terraform respects the dependency?
Type your answer in the field provided. The text field is not case-sensitive and all variations of the correct answer are accepted.

  1. depends_on

Answer(s): A



You have never used Terraform before and would like to test it out using a shared team account for a cloud provider. The shared team account already contains
15 virtual machines (VM). You develop a Terraform configuration containing one VM, perform terraform apply, and see that your VM was created successfully.
What should you do to delete the newly-created VM with Terraform?

  1. The Terraform state file contains all 16 VMs in the team account. Execute terraform destroy and select the newly-created VM.
  2. The Terraform state file only contains the one new VM. Execute terraform destroy.
  3. Delete the Terraform state file and execute Terraform apply.
  4. Delete the VM using the cloud provider console and terraform apply to apply the changes to the Terraform state file.

Answer(s): B



What is the name assigned by Terraform to reference this resource?

  1. dev
  2. azurerm_resource_group
  3. azurerm
  4. test

Answer(s): A



Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.

  1. True
  2. False

Answer(s): B

Explanation:


Reference:

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



Viewing Page 10 of 71



Share your comments for HashiCorp Terraform Associate exam with other users:

DN 9/4/2023 11:19:00 PM

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


YK 12/11/2023 1:10:00 AM

good one nice
JAPAN


Mn8300 11/9/2023 8:53:00 AM

nice questions
Anonymous