HashiCorp Terraform Associate Exam Practice Questions (P. 2)
- Full Access (358 questions)
- Six months of Premium Access
- Access to one million comments
- Seamless ChatGPT Integration
- Ability to download PDF files
- Anki Flashcard files for revision
- No Captcha & No AdSense
- Advanced Exam Configuration
Question #11
Which of the following is not a key principle of infrastructure as code?
- AVersioned infrastructure
- BGolden imagesMost Voted
- CIdempotence
- DSelf-describing infrastructure
Correct Answer:
ABD
Reference:
https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as-code#:~:text=Idempotence%20is%20a%20principle%20of,of%20the%
20environment's%20starting%20state
.
ABD
Reference:
https://docs.microsoft.com/en-us/azure/devops/learn/what-is-infrastructure-as-code#:~:text=Idempotence%20is%20a%20principle%20of,of%20the%
20environment's%20starting%20state
.
send
light_mode
delete
Question #12
Terraform variables and outputs that set the "description" argument will store that description in the state file.
- ATrue
- BFalseMost Voted
Correct Answer:
A
A

The assertion that the "description" argument for Terraform variables and outputs is stored in the state file is incorrect. The "description" argument serves solely as metadata providing human-readable explanations about the variables or outputs, assisting other users in understanding the Terraform configuration. It does not influence the actual management of infrastructure by Terraform and is consequently not recorded in the state file, which primarily tracks the values and configurations necessary for managing the current state of the infrastructure. Descriptions, while helpful for documentation, do not have a role in the state management process.
send
light_mode
delete
Question #13
What is the provider for this fictitious resource?


- Avpc
- Bmain
- CawsMost Voted
- Dtest
Correct Answer:
C
Reference:
https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html
C
Reference:
https://docs.aws.amazon.com/cloudformation-cli/latest/userguide/resource-types.html
send
light_mode
delete
Question #14
If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
- ARun terraform refreshMost Voted
- BIt will happen automatically
- CManually update the state fire
- DRun terraform import
Correct Answer:
B
B

When you manually destroy infrastructure outside of Terraform, there isn't an explicit action required on your part in Terraform to reflect this change. The system is designed to automatically handle the synchronization during the next plan or apply operation. This means whenever you run ‘terraform plan’ or ‘terraform apply’, Terraform updates its state to match the real-world resources, ensuring accuracy without manual intervention. It’s a smooth, automatic process built into the operations already commonly used in managing your configurations.
send
light_mode
delete
Question #15
What is not processed when running a terraform refresh?
- AState file
- BConfiguration fileMost Voted
- CCredentials
- DCloud provider
Correct Answer:
CD
Reference:
https://www.terraform.io/docs/cli/commands/refresh.html
CD
Reference:
https://www.terraform.io/docs/cli/commands/refresh.html
send
light_mode
delete
Question #16
What information does the public Terraform Module Registry automatically expose about published modules?
- ARequired input variables
- BOptional inputs variables and default values
- COutputs
- DAll of the aboveMost Voted
- ENone of the above
Correct Answer:
E
Reference:
https://www.terraform.io/docs/registry/modules/publish.html
E
Reference:
https://www.terraform.io/docs/registry/modules/publish.html

send
light_mode
delete
Question #17
If a module uses a local values, you can expose that value with a terraform output.
- ATrueMost Voted
- BFalse
Correct Answer:
A
Output values are like function return values.
Reference:
https://www.terraform.io/docs/language/values/locals.html
https://www.terraform.io/docs/language/values/outputs.html
A
Output values are like function return values.
Reference:
https://www.terraform.io/docs/language/values/locals.html
https://www.terraform.io/docs/language/values/outputs.html
send
light_mode
delete
Question #18
You should store secret data in the same version control repository as your Terraform configuration.
- ATrue
- BFalseMost Voted
Correct Answer:
B
Reference:
https://blog.gruntwork.io/a-comprehensive-guide-to-managing-secrets-in-your-terraform-code-1d586955ace1
B
Reference:
https://blog.gruntwork.io/a-comprehensive-guide-to-managing-secrets-in-your-terraform-code-1d586955ace1
send
light_mode
delete
Question #19
Which of the following is not a valid string function in Terraform?
- Asplit
- Bjoin
- CsliceMost Voted
- Dchomp
Correct Answer:
D
Reference:
https://www.terraform.io/docs/language/functions/chomp.html
D
Reference:
https://www.terraform.io/docs/language/functions/chomp.html

send
light_mode
delete
Question #20
You have provisioned some virtual machines (VMs) on Google Cloud Platform (GCP) using the gcloud command line tool. However, you are standardizing with
Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)
Terraform and want to manage these VMs using Terraform instead.
What are the two things you must do to achieve this? (Choose two.)
- AProvision new VMs using Terraform with the same VM names
- BUse the terraform import command for the existing VMsMost Voted
- CWrite Terraform configuration for the existing VMsMost Voted
- DRun the terraform import-gcp command
Correct Answer:
BD
The terraform import command is used to import existing infrastructure.
Import existing Google Cloud resources into Terraform with Terraformer.
Reference:
https://www.terraform.io/docs/cli/import/usage.html
https://cloud.google.com/docs/terraform
BD
The terraform import command is used to import existing infrastructure.
Import existing Google Cloud resources into Terraform with Terraformer.
Reference:
https://www.terraform.io/docs/cli/import/usage.html
https://cloud.google.com/docs/terraform
send
light_mode
delete
All Pages