admin管理员组文章数量:1289845
I'm using OpenTofu for the deployment of some basic Azure resources. When running tofu init
I get the following error:
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/random versions matching "~> 3.0"...
- Finding latest version of hashicorp/azure...
- Finding hashicorp/azurerm versions matching "~> 4.0"...
- Installing hashicorp/random v3.6.3...
- Installed hashicorp/random v3.6.3 (signed, key ID 0C0AF313E5FD9F80)
- Installing hashicorp/azurerm v4.19.0...
- Installed hashicorp/azurerm v4.19.0 (signed, key ID 0C0AF313E5FD9F80)
Providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
/
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/azure: provider registry
│ registry.opentofu does not have a provider named registry.opentofu/hashicorp/azure
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when
│ using a module. To see which modules are currently depending on hashicorp/azure, run the following command:
│ tofu providers
│
│ If you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry
│
Things I've tried:
- deleting the lock file and running it again
- expressly using the terraform registry as opposed to the OpenTofu one using a
.config
and setting the environment variableTF_REGISTRY_DISCOVERY=1
- updating the
azurerm
provider to ~>4.0 - searching for any other references to
hashicorps\azure
(there are none)
The output of tofu providers
is this:
Providers required by configuration:
.
├── provider[registry.opentofu/hashicorp/azurerm] ~> 4.0
├── provider[registry.opentofu/hashicorp/random] ~> 3.0
└── provider[registry.opentofu/hashicorp/azure]
and this is the contents of my providers file:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.0"
}
}
}
provider "azurerm" {
features {
}
}
I've exhausted all of ChatGPT's ideas so anything you can think of would be helpful.
I'm using OpenTofu for the deployment of some basic Azure resources. When running tofu init
I get the following error:
Initializing the backend...
Initializing provider plugins...
- Finding hashicorp/random versions matching "~> 3.0"...
- Finding latest version of hashicorp/azure...
- Finding hashicorp/azurerm versions matching "~> 4.0"...
- Installing hashicorp/random v3.6.3...
- Installed hashicorp/random v3.6.3 (signed, key ID 0C0AF313E5FD9F80)
- Installing hashicorp/azurerm v4.19.0...
- Installed hashicorp/azurerm v4.19.0 (signed, key ID 0C0AF313E5FD9F80)
Providers are signed by their developers.
If you'd like to know more about provider signing, you can read about it here:
https://opentofu./docs/cli/plugins/signing/
╷
│ Error: Failed to query available provider packages
│
│ Could not retrieve the list of available versions for provider hashicorp/azure: provider registry
│ registry.opentofu. does not have a provider named registry.opentofu./hashicorp/azure
│
│ All modules should specify their required_providers so that external consumers will get the correct providers when
│ using a module. To see which modules are currently depending on hashicorp/azure, run the following command:
│ tofu providers
│
│ If you believe this provider is missing from the registry, please submit a issue on the OpenTofu Registry
│ https://github/opentofu/registry/issues/new/choose
Things I've tried:
- deleting the lock file and running it again
- expressly using the terraform registry as opposed to the OpenTofu one using a
.config
and setting the environment variableTF_REGISTRY_DISCOVERY=1
- updating the
azurerm
provider to ~>4.0 - searching for any other references to
hashicorps\azure
(there are none)
The output of tofu providers
is this:
Providers required by configuration:
.
├── provider[registry.opentofu./hashicorp/azurerm] ~> 4.0
├── provider[registry.opentofu./hashicorp/random] ~> 3.0
└── provider[registry.opentofu./hashicorp/azure]
and this is the contents of my providers file:
terraform {
required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = "~> 3.0"
}
random = {
source = "hashicorp/random"
version = "~> 3.0"
}
}
}
provider "azurerm" {
features {
}
}
I've exhausted all of ChatGPT's ideas so anything you can think of would be helpful.
Share Improve this question asked Feb 19 at 22:44 AliciaAlicia 1591 silver badge13 bronze badges 1 |1 Answer
Reset to default 2It seems that somewhere in your configuration you have a resource that is declared with a resource type that starts with azure_
instead of azurerm_
, and so OpenTofu is guessing that you are trying to use a provider named hashicorp/azure
in an attempt to be backward-compatible with old modules written for very old versions of HashiCorp Terraform from before there were multiple namespaces for providers and so all providers were effectively in the "hashicorp" namespace.
If you find that resource block and correct its resource type to have the azurerm_
prefix instead then this spurious dependency should no longer be detected.
本文标签: terraformOpenTofu fails to query provider packagesStack Overflow
版权声明:本文标题:terraform - OpenTofu fails to query provider packages - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741466744a2380357.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
tofu -version
:OpenTofu v1.9.0 on darwin_arm64
– Alicia Commented Feb 19 at 22:50