You add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The existing and new resources use the same provider. The working contains a .terraform.lock, hc1 file.
How will Terraform choose which version of the provider to use?
- Terraform will use the version recorded in your lock file
- Terraform will use the latest version of the provider for the new resource and the version recorded in the lock file to manage existing resources
- Terraform will check your state file to determine the provider version to use
- Terraform will use the latest version of the provider available at the time you provision your new resource
Answer(s): A
Explanation:
This is how Terraform chooses which version of the provider to use, when you add a new resource to an existing Terraform configuration, but do not update the version constraint in the configuration. The lock file records the exact version of each provider that was installed in your working directory, and ensures that Terraform will always use the same provider versions until you run terraform init - upgrade to update them.
Reveal Solution Next Question