- (Exam Topic 4)
Which of the following terraform subcommands could be used to remove the lock on the state for the current configuration?
Correct Answer:
B
https://www.terraform.io/docs/commands/force-unlock.html
- (Exam Topic 4)
Module version is required to reference a module on the Terraform Module Registry.
Correct Answer:
B
- (Exam Topic 4)
What resource dependency information is stored in Terraform's state?
Correct Answer:
B
Terraform state captures all dependency information, both implicit and explicit. One purpose for state is to determine the proper order to destroy resources. When resources are created all of their dependency information is stored in the state. If you destroy a resource with dependencies, Terraform can still determine
the correct destroy order for all other resources because the dependencies are stored in the state. https://www.terraform.io/docs/state/purpose.html#metadata
- (Exam Topic 4)
You have a Terraform configuration that defines a single virtual machine with no references to it. You have run terraform apply to create the resource, and then removed the resource definition from your Terraform configuration file.
What will happen when you run terraform apply in the working directory again?
Correct Answer:
B
If you remove the resource from your config file and the resource is in your state file, terraform will apply the configuration in the config file - which is to delete the resource
- (Exam Topic 4)
Given the Terraform configuration below, in which order will the resources be created?
Correct Answer:
D
The aws_instance will be created first, and then aws_eip will be created second due to the aws_eip's resource dependency of the aws_instance id