0
0
Terraformcloud~20 mins

Provider versioning constraints in Terraform - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Provider Versioning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Provider Version Constraints

Which Terraform provider version constraint ensures that only versions from 2.0.0 up to, but not including, 3.0.0 are allowed?

A"~> 2.0"
B"^2.0"
C">= 2.0, < 3.0"
D"= 2.0"
Attempts:
2 left
💡 Hint

Think about specifying a range explicitly with both minimum and maximum versions.

Configuration
intermediate
2:00remaining
Identifying Invalid Provider Version Constraint

Which of the following Terraform provider version constraints will cause a syntax error?

A"^1.0"
B"~> 1.5.0"
C">= 1.0, < 2.0"
D"= 1.5.0"
Attempts:
2 left
💡 Hint

Check which syntax is not supported by Terraform for version constraints.

Architecture
advanced
2:00remaining
Ensuring Provider Compatibility Across Modules

You have two Terraform modules in your project. Module A requires provider version "~> 2.1", and Module B requires provider version ">= 2.0, < 2.3". Which provider version range will Terraform select to satisfy both modules?

AAny version >= 2.0 and < 3.0
BAny version >= 2.1 and < 2.3
CAny version >= 2.3
DAny version >= 2.0 and < 2.1
Attempts:
2 left
💡 Hint

Find the overlapping version range between both constraints.

security
advanced
2:00remaining
Risks of Using Loose Provider Version Constraints

What is a potential risk of specifying a very loose provider version constraint like ">= 1.0" in Terraform?

ATerraform will ignore the provider block and use a default version.
BTerraform will always use the oldest provider version, causing missing features.
CTerraform will fail to initialize due to ambiguous version selection.
DTerraform may use a newer provider version with breaking changes, causing unexpected failures.
Attempts:
2 left
💡 Hint

Consider what happens when new versions introduce changes.

service_behavior
expert
2:00remaining
Terraform Provider Version Conflict Resolution Behavior

When Terraform detects conflicting provider version constraints across modules that cannot be satisfied by a single version, what is the expected behavior during terraform init?

ATerraform fails initialization with an error indicating version conflict.
BTerraform automatically picks the highest version that satisfies at least one module and ignores others.
CTerraform merges all constraints and picks the lowest common version automatically.
DTerraform downloads all conflicting versions and uses them in parallel.
Attempts:
2 left
💡 Hint

Think about how Terraform ensures consistent provider versions.