Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Typo in resource providers registrations error #27110

Open
1 task done
roy-work opened this issue Aug 20, 2024 · 1 comment
Open
1 task done

Typo in resource providers registrations error #27110

roy-work opened this issue Aug 20, 2024 · 1 comment

Comments

@roy-work
Copy link

roy-work commented Aug 20, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave comments along the lines of "+1", "me too" or "any updates", they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment and review the contribution guide to help.

Terraform Version

1.5.7

AzureRM Provider Version

3.116.0

Affected Resource(s)/Data Source(s)

N/A

Terraform Configuration Files

N/A

Debug Output/Panic Output

N/A

Expected Behaviour

The error message suggests the following snippet:

provider "azurerm" {
  "resource_provider_registrations = "none"
}

First, there should not be a " before resource_provider_registrations, syntactically.

Second, there is no "resource_provider_registrations" attribute to the provider, and attempting to set it as the diagnostic suggests results in the following error:

│ Error: Unsupported argument
│
│   on main.tf line 27, in provider "azurerm":
│   27:   resource_provider_registrations = "none"
│
│ An argument named "resource_provider_registrations" is not expected here.

If you attempt to follow this link in the last line of the diagnostic:

│ https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#resource_provider_registrations

… the target portion of that link is broken.

skip_provider_registration appears to be the actual name of the attribute. The actual link to the docs appears to be https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#skip_provider_registration. (And I think this is a boolean, so likely it should read skip_provider_registration = true.)

Actual Behaviour

The error message reads:

Planning failed. Terraform encountered an error while generating this plan.

╷
│ Error: Terraform does not have the necessary permissions to register Resource Providers.
│
│ Terraform automatically attempts to register the Azure Resource Providers it supports, to
│ ensure it is able to provision resources.
│
│ If you don't have permission to register Resource Providers you may wish to disable this
│ functionality by adding the following to the Provider block:
│
│ provider "azurerm" {
│   "resource_provider_registrations = "none"
│ }
│
│ Please note that if you opt out of Resource Provider Registration and Terraform tries
│ to provision a resource from a Resource Provider which is unregistered, then the errors
│ may appear misleading - for example:
│
│ > API version 2019-XX-XX was not found for Microsoft.Foo
│
│ Could suggest that the Resource Provider "Microsoft.Foo" requires registration, but
│ this could also indicate that this Azure Region doesn't support this API version.
│
│ More information on the "resource_provider_registrations" property can be found here:
│ https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs#resource_provider_registrations

Steps to Reproduce

  1. terraform plan, where you do not have permission to register resource providers

Important Factoids

No response

References

No response

@cdituri
Copy link
Contributor

cdituri commented Aug 22, 2024

Took a pass at this issue report and opened a PR. Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants