I am trying to understand why during terraform init
Terraform v0.13.5 is installing additional plugins, that are not referenced in my code.
I have the following providers configured
terraform {
required_version = ">= 0.13"
required_providers {
aws = {
source = "hashicorp/aws"
region = "us-west-2"
version = "~> 2.0"
assume_role = {
role_arn = "arn:aws:iam::xxxxxxxx:role/Terraform"
session_name = "automation"
}
}
random = {
source = "hashicorp/random"
version = "~> 2.0"
}
}
}
During initialization I can see that both aws and random providers are downloaded and installed twice. I cant seem to find any information regarding this behaviour, so is this intentional ? or am I missing something?
Initializing modules...
Initializing the backend...
Initializing provider plugins...
Finding latest version of -/random...
Finding hashicorp/random versions matching "~> 2.0"...
Finding hashicorp/aws versions matching "~> 2.0"...
Finding latest version of -/aws...
Installing -/random v3.0.0...
Installed -/random v3.0.0 (signed by HashiCorp)
Installing hashicorp/random v2.3.1...
Installed hashicorp/random v2.3.1 (signed by HashiCorp)
Installing hashicorp/aws v2.70.0...
Installed hashicorp/aws v2.70.0 (signed by HashiCorp)
Installing -/aws v3.13.0...
Installed -/aws v3.13.0 (signed by HashiCorp)
terraform version
Terraform v0.13.5
provider registry.terraform.io/-/aws v3.13.0
provider registry.terraform.io/-/random v3.0.0
provider registry.terraform.io/hashicorp/aws v2.70.0
provider registry.terraform.io/hashicorp/random v2.3.1
I also get the following warning during initialization. This concerns me, because, it makes me believe that the wrong provider will be used at run time.
To prevent automatic upgrades to new major versions that may contain breaking
changes, we recommend adding version constraints in a required_providers block
in your configuration, with the constraint strings suggested below.
* -/aws: version = "~> 3.13.0"
* -/random: version = "~> 3.0.0"
Any help will be greatly appreciated.
Thanks!!