You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The issue occurs when running terraform init for the 03-Network-Hub module in the AKS Landing Zone Accelerator repository. The error specifically states that no provider versions match the given constraints for hashicorp/azurerm. However, the same issue is not encountered when initializing other modules like 04-Network-LZ or 06-AKS-Cluster.
Navigate to the Scenarios/03-Network-Hub directory.
Run the following command: terraform init
Observe the error:
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 >= 3.71.0, ~> 3.71, ~> 3.117, ~> 4.0, < 4.0.0, < 5.0.0
Navigate to other modules such as 04-Network-LZ or 06-AKS-Cluster:
cd Scenarios/04-Network-LZ
terraform init
Observe that no error occurs during initialization for these modules.
Expected Behavior:
Terraform should successfully initialize the 03-Network-Hub module without errors, similar to the other modules.
Actual Behavior:
Terraform fails to initialize the 03-Network-Hub module and outputs the following error:
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 >= 3.71.0, ~> 3.71, ~> 3.117, ~> 4.0, < 4.0.0, < 5.0.0
Logs:
Attach Terraform debug logs (TF_LOG=TRACE terraform init) for the 03-Network-Hub module. Focus on any discrepancies in provider download attempts.
The text was updated successfully, but these errors were encountered:
I found the root cause. In the main.tf file, the below code didn't specify the version and it was taking the latest version 0.4.0 which depends on azurerm ~> 4.0 which was conflicting with other modules which depends on azurerm ~> 3.x.
By adding the version line, fixes the issue. version = "0.3.0"
### Fix for Provider Version Conflict in 03-Network-Hub Module
This PR addresses the issue described in Azure#162, where the `azure_bastion` module causes a provider version conflict for `azurerm`. The conflict arises due to differing provider version constraints between the root module and the `Azure/avm-res-network-routetable/azurerm` module.
#### Changes Made:
1. Updated the `main.tf` in the root module to ensure consistent provider constraints by adding version attribute with the value 0.3.0:
```hcl
module "azure_bastion" {
source = "Azure/avm-res-network-bastionhost/azurerm"
version = "0.3.0"
name = "bastion"
resource_group_name = azurerm_resource_group.rg.name
location = azurerm_resource_group.rg.location
copy_paste_enabled = true
file_copy_enabled = false
sku = "Standard"
ip_configuration = {
name = "bastion-ipconfig"
subnet_id = module.avm-res-network-virtualnetwork.subnets["AzureBastionSubnet"].resource_id
public_ip_address_id = module.publicIpBastion.public_ip_id
}
ip_connect_enabled = true
scale_units = 4
shareable_link_enabled = true
tunneling_enabled = true
kerberos_enabled = false
}
```
The issue occurs when running terraform init for the 03-Network-Hub module in the AKS Landing Zone Accelerator repository. The error specifically states that no provider versions match the given constraints for hashicorp/azurerm. However, the same issue is not encountered when initializing other modules like 04-Network-LZ or 06-AKS-Cluster.
Steps to Reproduce:
terraform init
Expected Behavior:
Terraform should successfully initialize the 03-Network-Hub module without errors, similar to the other modules.
Actual Behavior:
Terraform fails to initialize the 03-Network-Hub module and outputs the following error:
Logs:
Attach Terraform debug logs (TF_LOG=TRACE terraform init) for the 03-Network-Hub module. Focus on any discrepancies in provider download attempts.
The text was updated successfully, but these errors were encountered: