Skip to content

How to pin Terraform provider version constraints to a single patch release #130

Answered by zackproser
zackproser asked this question in Help
Discussion options

You must be logged in to vote

To pin to a specific "patch" version release using semantic versioning, you can use an equal sign in front of the exact version you want installed:

provider "aws" {

  region = var.aws_region

  # Require exactly version 2.70.1 
  version = "= 2.70.1"
}

With this configuration, Terraform will attempt to fetch and install the exact version you have specified:

terraform init 

Initializing the backend...

Initializing provider plugins...
- Finding hashicorp/aws versions matching "2.70.1"...
- Finding latest version of hashicorp/null...
- Installing hashicorp/aws v2.70.1...
- Installed hashicorp/aws v2.70.1 (signed by HashiCorp)
- Using previously-installed hashicorp/null v3.1.0

Terraform …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by zackproser
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment