C correct answer
Version
When using modules installed from a module registry, we recommend explicitly constraining the acceptable version numbers to avoid unexpected or unwanted changes.
Use the version argument in the module block to specify versions:
module "consul" {
source = "hashicorp/consul/aws"
version = "0.0.5"
servers = 3
}
Although please note that version is now deprecated in favour of the required_providers block https://developer.hashicorp.com/terraform/language/providers/configuration#version-deprecated
C is correct answer.
The version argument accepts a version constraint string. Terraform will use the newest installed version of the module that meets the constraint; if no acceptable versions are installed, it will download the newest version that meets the constraint.
Version constraints are supported only for modules installed from a module registry, such as the public Terraform Registry or Terraform Cloud's private module registry. Other module sources can provide their own versioning mechanisms within the source string itself, or might not support versions at all. In particular, modules sourced from local file paths do not support version; since they're loaded from the same source repository, they always share the same version as their caller.
https://www.terraform.io/language/modules/syntax#version
C is correct
https://www.terraform.io/language/modules/syntax
upvoted 3 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
amrith501
Highly Voted 2 years, 5 months agoenook
Most Recent 10 months, 3 weeks agoBere
1 year, 3 months agoforeverlearner
1 year, 4 months agoforeverlearner
1 year, 4 months agoNi33
1 year, 6 months agoPower123
1 year, 7 months agosahara99
1 year, 9 months agoaleksand41
2 years, 1 month agoEltooth
2 years, 5 months agoelvancedonzy
2 years, 5 months ago