'm having hard time working with modules of multiple versions, i even tried using Alias but its not working. Here’s an sample code. Can someone suggest where i’m doing wrong? or what’s the correct way.
This syntax is not valid here - it’s only valid within a module block, for identifying which providers to pass down to the nested module. Just delete it from your top level Terraform code.
Actually the providers block was within the module.
So i have made changes as per your suggestion, i have removed alias under provider:
provider “azurerm3” {
features {} #alias = “permission”
subscription_id = data.vault_generic_secret.vault-spoke-spn.data[“subscription_id”]
tenant_id = data.vault_generic_secret.vault-spoke-spn.data[“tenant_id”]
client_id = data.vault_generic_secret.vault-spoke-spn.data[“client_id”]
client_secret = data.vault_generic_secret.vault-spoke-spn.data[“client_secret”]
}
and also removed configuration_aliases but it didnt work. I tried with azurerm3 with aliases
as well but same result.
This is a module and there are few other modules which are inter-dependent and we dont want to change the versions, so thought there might be a way to use both versions on same provider(azurerm)
Below is the error which i get while i do terraform init:
Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/azurerm: no available releases match the given constraints
│ ~> 2.76, ~> 3.7.0
╵
Oh dear, Terraform has merged the two requirements blocks.
I fear then, it might be impossible to use two different versions of the provider, without taking a copy of one of them, and arranging for it to be available under a name other than "hashicorp/azurerm".
Yeah i googled almost all the pages but was not able to find the solution.
So i read somewhere about copying the provider and reusing it with another name.
by any chance, do you have any documentation where i can follow?
one last question, if i copy and use that renamed provider, will everyone in my Team should do that as its local on my computer right? like, how can they use that?storing in somewhere?