Free Terraform Associate Exam Braindumps (page: 41)

Page 40 of 113

John wants to use two different regions to deploy two different EC2 instances. He has specified two provider blocks in his providers.tf file. provider "aws" { region = "us-east-1" } provider "aws" { region = "us-west-2" }
When he run terraform plan he encountered an error. How to fix this?

  1. Use another provider version
  2. Use alias for region = "us-west-2"
  3. Use default keyword with region = "us-east-1"
  4. It can not be fixed

Answer(s): B



How does Terraform handle working with so many providers?

  1. Terraform ships with all of the plugins embedded in the Terraform binary.
  2. Terraform uses a plugin architecture for providers and only installs the provider plugins required by your configuration in the configuration's working directory.
  3. Terraform uses a plugin architecture for providers and only installs the provider plugins required by your configuration in a shared, system-wide plugins directory.
  4. Terraform allows you to select the providers you want to support during the Terraform installation process.

Answer(s): B

Explanation:

Terraform is built on a plugin-based architecture. All providers and provisioners that are used in Terraform configurations are plugins, even the core types such as AWS and Heroku. Users of Terraform are able to write new plugins in order to support new functionality in Terraform.



What is the standard workflow that a developer follows while working with terraform open source version?

  1. Run terraform refresh to update the terraform state , then write the terraform code , and finally run terraform apply.
  2. Run terraform destroy first since you need to start from fresh every time , before running terraform apply.
  3. Write terraform code , and run terraform push , to update the terraform state to the remote repo , which in turn will take care of the next steps.
  4. Write the terraform code on the developer machine , run terraform plan to check the changes , and run terraform apply to provision the infra.

Answer(s): D

Explanation:

You do not need to run terraform refresh as terraform plan implicitly will run terraform refresh. https://www.terraform.io/guides/core-workflow.html



You are using a terraform operation that writes state. Unfortunately automatic state unlocking has failed for that operation. Which of the below commands can be used to remove the already acquired lock on the state?

  1. terraform unlock
  2. terraform force-unlock
  3. terraform state unlock
  4. None of the above

Answer(s): B

Explanation:

Command: force-unlock
Manually unlock the state for the defined configuration.
This will not modify your infrastructure. This command removes the lock on the state for the current configuration. The behavior of this lock is dependent on the backend being used. Local state files cannot be unlocked by another process.
https://www.terraform.io/docs/commands/force-unlock.html https://www.terraform.io/docs/state/locking.html
Terraform has a force-unlock command to manually unlock the state if unlocking failed.
If you unlock the state when someone else is holding the lock it could cause multiple writers. Force unlock should only be used to unlock your own lock in the situation where automatic unlocking failed.






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

Terraform Associate Exam Discussions & Posts