Recall & Review
beginner
What is module versioning in Terraform?
Module versioning in Terraform means keeping track of different versions of a module so you can use a specific, stable version in your infrastructure code.
Click to reveal answer
beginner
Why should you use versioned modules in Terraform?
Using versioned modules helps avoid unexpected changes by locking your infrastructure to a tested module version, making your deployments more reliable.
Click to reveal answer
beginner
How do you specify a module version in Terraform?
You specify a module version by adding a version argument in the module block, like: <br>
module "example" {<br> source = "registry.terraform.io/hashicorp/example"<br> version = "1.2.0"<br>}Click to reveal answer
intermediate
What happens if you don’t specify a module version?
If you don’t specify a version, Terraform uses the latest available module version, which might cause unexpected changes if the module updates.
Click to reveal answer
intermediate
How can you update a module to a newer version safely?
To update safely, change the version number in your module block, run
terraform init -upgrade to download the new version, then test your infrastructure.Click to reveal answer
What is the purpose of specifying a module version in Terraform?
✗ Incorrect
Specifying a module version locks your infrastructure to a known stable version, preventing unexpected changes.
Which command updates Terraform modules to the latest allowed version?
✗ Incorrect
terraform init -upgrade downloads the latest module versions allowed by your version constraints.What happens if you omit the version argument in a Terraform module source?
✗ Incorrect
Without a version, Terraform defaults to the latest available module version.
Why is it risky to always use the latest module version without specifying a version?
✗ Incorrect
Using the latest version can introduce changes you did not test, risking your infrastructure stability.
How do you specify a module version in Terraform code?
✗ Incorrect
You specify the version inside the module block with the argument
version = "1.0.0".Explain what module versioning is in Terraform and why it is important.
Think about how using a fixed version helps keep your infrastructure predictable.
You got /3 concepts.
Describe the steps to safely update a Terraform module to a newer version.
Consider how you control the version and apply the update carefully.
You got /3 concepts.