nerdexam
HashiCorp

TA-002-P · Question #183

Refer below code where pessimistic constraint operator has been used to specify a version of a provider. terraform { required_providers { aws = "~> 1.1.0" }} Which of the following options are valid…

The correct answer is A. 1.1.1 C. 1.1.8. The pessimistic constraint operator (~>) with a three-part version like ~> 1.1.0 means 'allow only patch-level changes within the 1.1.x series.' Formally, it is equivalent to >= 1.1.0 and < 1.2.0. Therefore: 1.1.1 (A) - valid, it is within the 1.1.x range; 1.1.8 (C) - valid…

Read, generate, and modify configuration

Question

Refer below code where pessimistic constraint operator has been used to specify a version of a provider. terraform { required_providers { aws = "~> 1.1.0" }} Which of the following options are valid provider versions that satisfy the above constraint. (select two)

Options

  • A1.1.1
  • B1.2.9
  • C1.1.8
  • D1.2.0

How the community answered

(27 responses)
  • A
    89% (24)
  • B
    7% (2)
  • D
    4% (1)

Explanation

The pessimistic constraint operator (~>) with a three-part version like ~> 1.1.0 means 'allow only patch-level changes within the 1.1.x series.' Formally, it is equivalent to >= 1.1.0 and < 1.2.0. Therefore: 1.1.1 (A) - valid, it is within the 1.1.x range; 1.1.8 (C) - valid, also within 1.1.x. 1.2.9 (B) and 1.2.0 (D) both exceed the 1.2.0 upper boundary and are therefore rejected. If the constraint had been ~> 1.1 (only two parts), it would allow up to < 2.0.0.

Topics

#provider versions#version constraints#pessimistic constraint operator#required_providers

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice