Controlling the version of Terraform provider
In order to make use of certain functions and features of a Terraform provider, you might want to use a particular version of a Terraform provider. To use a particular version of a provider, add version argument in the provider block of Terraform. This prevents Terraform engine from using the latest version of the provider and instead use the version that you need.
The value of the version can be a single version or a range of versions. You can use the following formats to specify a range of versions:
>= 1.0.0
- Versions greater than or equal to the 1.0.0.<= 1.0.0
- Versions lesser than or equal to 1.0.0.>= 1.0.0, <= 2.0.0
- This includes all versions between 1.0.0 and version number 2.0.0~> 1.0.0
- Any non-beta version greater than or equal to 1.0.0 and lesser than or equal to 1.1.0.~> 1.1
- Any non-beta version greater than equal to 1.1.0 and lesser than 2.0
Example:
provider "aws" {
version = "~> 1.0"
access_key = "${var.aws_access_key}"
secret_key = "${var.aws_secret_key}"
region = "${var.aws_region}"
}