terraform,

'Failed to install provider unsuccessful request to 403 forbidden' error in Terraform

May 24, 2022 · 1 min read · Post a comment

On today’s menu we got yet another TF error to resolve. For any other Terraform-related issues, browse by category here.

Prerequisites

  • Terraform

The error

│ Error: Failed to install provider
│
│ Error while installing hashicorp/azuread v2.22.0: unsuccessful request to
│ https://releases.hashicorp.com/terraform-provider-azuread/2.22.0/terraform-provider-azuread_2.22.0_windows_386.zip: 403 Forbidden
╵

Solution

Even though the error doesn’t say much, it’s safe to say that there’s no one size fits all solution, thus I’ll list a few.

  1. Make sure your machine is not sitting behind a network proxy such as Zscaler that might be blocking the access.
  2. Confirm that you don’t have any lack of permissions associated with the Terraform managed objects – S3 bucket for instance.
  3. At last, verify you have installed the right Terraform binary. As you could see from the error example above, I’m using the 386 version therefore, try to install Amd64 instead.

Conclusion

If you have any questions, thoughts or opinions, feel free to leave a comment below. On a side note, follow our official channel on Telegram.