nerdexam
HashiCorpHashiCorp

TA-002-P · Question #274

TA-002-P Question #274: Real Exam Question with Answer & Explanation

The correct answer is B: 1.2.3. {"question_number": 4, "correct_answer": "B, C", "explanation": "The ~> (pessimistic constraint) operator with a version like ~> 1.2.0 allows only patch-level version increments within the 1.2.x series. It is equivalent to >= 1.2.0, < 1.3.0. Therefore: 1.2.3 (B) is valid - it is

Read, generate, and modify configuration

Question

When using constraint expressions to signify a version of a provider, which of the following are valid provider versions that satisfy the expression found in the following code snippet: (select two) 1. terraform 2. { 3. required_providers 4. { 5. aws = "~> 1.2.0" 6. } 7. }

Options

  • A1.3.1
  • B1.2.3
  • C1.2.9
  • D1.3.0

Explanation

{"question_number": 4, "correct_answer": "B, C", "explanation": "The ~> (pessimistic constraint) operator with a version like ~> 1.2.0 allows only patch-level version increments within the 1.2.x series. It is equivalent to >= 1.2.0, < 1.3.0. Therefore: 1.2.3 (B) is valid - it is within the 1.2.x range. 1.2.9 (C) is valid - it is also within the 1.2.x range. 1.3.0 (D) is invalid - it is at the boundary and the constraint is strictly less than 1.3.0. 1.3.1 (A) is invalid - it exceeds the 1.2.x ceiling. If the constraint were ~> 1.2 (without the patch digit), it would allow up to < 2.0, but the .0 patch digit locks it to the 1.2.x series only.", "generated_by": "claude-sonnet", "llm_judge_score": 5}

Topics

#Provider versioning#Version constraints#Optimistic operator#Configuration syntax

Community Discussion

No community discussion yet for this question.

Full TA-002-P PracticeBrowse All TA-002-P Questions